Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Switch existing task processor health checks to new liveness probe #5161

Merged
merged 13 commits into from
Mar 5, 2025

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Feb 25, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

This accommodates for changes introduced in Flagsmith/flagsmith-task-processor#25 by intercepting python manage.py checktaskprocessorthreadhealth command and redirecting it to new liveness probe introduced in #5151.

How did you test this code?

Ran python manage.py checktaskprocessorthreadhealth and made sure the correct HTTP call is made.

@khvn26 khvn26 requested a review from a team as a code owner February 25, 2025 12:53
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team February 25, 2025 12:53
Copy link

vercel bot commented Feb 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Mar 4, 2025 7:33pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Mar 4, 2025 7:33pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Mar 4, 2025 7:33pm

@github-actions github-actions bot added the api Issue related to the REST API label Feb 25, 2025
@khvn26 khvn26 requested a review from rolodato February 25, 2025 12:53
@github-actions github-actions bot added the feature New feature or request label Feb 25, 2025
Copy link
Contributor

github-actions bot commented Feb 25, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-5161 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-5161 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-5161 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-5161 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5161 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5161 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Feb 25, 2025

Uffizzi Preview deployment-61312 was deleted.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.49%. Comparing base (edbd3fa) to head (e9e5a41).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5161      +/-   ##
==========================================
+ Coverage   97.47%   97.49%   +0.02%     
==========================================
  Files        1224     1223       -1     
  Lines       42590    42581       -9     
==========================================
+ Hits        41515    41516       +1     
+ Misses       1075     1065      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


sys.exit(0 if 200 >= status < 300 else 1)
def main() -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a deprecation warning when this is being used? In case we need to troubleshoot other customer deployments that have similar issues, this could tell us immediately if they are using the old style healthchecks or not.

I understand this code is only ever called by Docker Compose healthchecks, which should be removed.

Otherwise LGTM 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am slightly concerned with the deprecation warning that's been added here since, if I understand correctly, anyone invoking python manage.py checktaskprocessorthreadhealth will also see this confusing deprecation warning.

I think that could be anyone who explicitly uses the management command, but more likely anyone that updates the flagsmith version without updating their chart version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point. I've reworked the warning to be more descriptive.

@khvn26 khvn26 requested a review from rolodato February 25, 2025 15:54
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Feb 25, 2025
@rolodato
Copy link
Member

@khvn26 Added 236df86 to remove healthchecks from Docker Compose, and bake them directly into the Dockerfile. I understand this should only be used automatically by Compose, and not ECS, Kubernetes or other orchestrators.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Feb 25, 2025
@khvn26 khvn26 requested a review from a team as a code owner February 26, 2025 21:19
@khvn26 khvn26 requested review from kyle-ssg and removed request for a team February 26, 2025 21:19
@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard feature New feature or request and removed feature New feature or request labels Feb 26, 2025
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Feb 28, 2025

sys.exit(0 if 200 >= status < 300 else 1)
def main() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am slightly concerned with the deprecation warning that's been added here since, if I understand correctly, anyone invoking python manage.py checktaskprocessorthreadhealth will also see this confusing deprecation warning.

I think that could be anyone who explicitly uses the management command, but more likely anyone that updates the flagsmith version without updating their chart version?

@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Mar 4, 2025
@khvn26 khvn26 force-pushed the feat/adapt-removed-task-processor-health-cmd branch from a7cf5ed to ac086b4 Compare March 4, 2025 19:30
@github-actions github-actions bot added the docs Documentation updates label Mar 4, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Mar 4, 2025
@khvn26 khvn26 merged commit 647712c into main Mar 5, 2025
38 checks passed
@khvn26 khvn26 deleted the feat/adapt-removed-task-processor-health-cmd branch March 5, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants