Skip to content

Record a failed API response as a failure - #29

Open
marvinm2 wants to merge 1 commit into
RECETOX:mainfrom
marvinm2:fix-silent-api-failure
Open

Record a failed API response as a failure#29
marvinm2 wants to merge 1 commit into
RECETOX:mainfrom
marvinm2:fix-silent-api-failure

Conversation

@marvinm2

Copy link
Copy Markdown

Closes #28.

write_stats_response checked the type of the response but not its status, so the body of an error reply was written to tmp/ as though it were collected data. The report generator then found no usable rows, preserved the previous ones, and the run finished green.

Non-2xx responses now go to failed/ with the status logged, which is what that folder appears to be for. The pd.Series and unexpected-type paths are unchanged.

This does not recover the missing GitHub weeks and does not fix whatever made the traffic calls start failing. It only means the next failure is visible rather than silent.

Two tests added alongside the existing write_stats_response ones, checking that an error status is filed under failed/ and that the error body is not written as data.

Run with python -m unittest discover -s tests from the repo root. Two tests in test_galaxy.py fail on my machine, but they fail the same way on an unmodified main, so they look unrelated to this change.

write_stats_response checked the type of the response but not its status, so
the body of an error reply was written to tmp/ as though it were data. The
report generator then found no usable rows, preserved the previous ones, and
the run finished green.

That is why GitHub views and clones stopped at 2026-W14 while every weekly run
since has reported success: the traffic endpoints need a token, and once the
call started failing there was nothing to say so.

Non-2xx responses now go to failed/ with the status logged, which is what that
folder is for.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub views and clones stopped updating in April

1 participant