Repository navigation
Conversation
On a non-401 HTTP error, fetch_github_stars saved whatever it had and
exited 1. With no restored cache that is {}, which still passes the
deploy workflow's "Verify star data exists" step (file exists, valid
JSON), so the site deployed with no stars. Only save a non-empty cache,
so the verify step fails as intended; a restored cache is still saved.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the first star fetch fails with no restored cache, the deploy goes out with zero stars instead of failing. The workflow's guard is meant to catch exactly this case:
On any non-401 HTTP error,
fetch_github_stars.pyprints "Saving partial cache and exiting." and callssave_cache(cache)beforesys.exit(1). With no cache restored (a first deploy, or an evicted cache),cacheis still{}. The fetch step iscontinue-on-error, the file now exists and is valid JSON, so the guard passes.build.pythen renders every entry without stars or last-commit dates and drops the stars figure from the homepage.This change saves only a non-empty cache. A restored cache plus a failed batch is still saved as before. With nothing fetched and nothing restored, no file is written, so the verify step fails with its own error message. The 401 path already behaved this way.
Before and after, with a mocked 502 on the first batch and no prior cache, then the verify step's shell run as written:
Two tests drive
main()with a 502. The first (no cache, so no file must be written) fails on the unchanged base. The second (a restored cache must be kept) passes on both and guards the existing partial-save behavior.Validation, on Python 3.14.10 (macOS):
pytest website/tests/: 172 passed (170 on the base, plus the 2 new cases).ty check website, all pass.This fixes the website tooling and does not add a project listing, so the project-admission template does not apply.