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

Enhance health check workflows and scripts #23190

Merged
merged 3 commits into from
Mar 21, 2025
Merged

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Mar 19, 2025

Fixes: mozilla/addons#15464
Fixes: mozilla/addons#15450

Description

  • Added output for fork detection in health_check_completed.yml.
  • Updated health_check.yml to ensure health check file existence before proceeding.
  • Refactored health_check.py to use a session with retries for HTTP requests, improving error handling.
  • Modified tests in test_health_check.py to validate new error handling and retry logic.
  • Added dummy_monitor to trigger successful or failing monitors in any environment

Context

This is patching a few holes at once but its a nightmare to test and they all cover the originally discovered problem

Testing

Test failing healtcheck

  • make up the env to ensure the waffle switch is created
  • run the healtcheck which should pass
./scripts/health_check.py --env local --verbose --retries 0
  • Enable the waffle switch to trigger a failure
./manage.py waffle_switch dummy-monitor-fails on
  • Rerun the healthcheck and now it should fail

Note

If you're feeling very adventurous you could add a high retry count and disable the waffle switch midway.. should be failures until you disable it

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind force-pushed the kevinmind/addons/15464 branch from c1a5b5c to d778250 Compare March 19, 2025 12:47
- Added output for fork detection in health_check_completed.yml.
- Updated health_check.yml to ensure health check file existence before proceeding.
- Refactored health_check.py to use a session with retries for HTTP requests, improving error handling.
- Modified tests in test_health_check.py to validate new error handling and retry logic.
@KevinMind KevinMind force-pushed the kevinmind/addons/15464 branch 2 times, most recently from 1dfd6c7 to 10b1957 Compare March 19, 2025 14:01
@KevinMind KevinMind force-pushed the kevinmind/addons/15464 branch from 10b1957 to d9a287f Compare March 19, 2025 14:18
@KevinMind KevinMind requested review from a team, eviljeff and diox and removed request for a team and eviljeff March 19, 2025 15:20
@KevinMind KevinMind merged commit d9d7b29 into master Mar 21, 2025
42 checks passed
@KevinMind KevinMind deleted the kevinmind/addons/15464 branch March 21, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants