Repository navigation
Give the desktop release tests an explicit utf-8 encoding - #11372
Conversation
`ruff-format-with-kwargs` runs over the whole tree, so one unformatted signature fails the hook on every open PR rather than only on the one that introduced it. `_validate_sidebar_nav_auto` fits on a single line under the pinned ruff 0.6.9, and this is exactly the output of `python scripts/run_ruff_format.py studio/backend/routes/settings.py`.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The repo's own guard in tests/security fails any read of a checked-in file at the platform default encoding, because it breaks on Windows the moment that file gains a non-ASCII byte. Three reads added with the desktop release work were missing it, which fails `Repo tests (CPU, rest)` on every PR opened against current main, #11371 and #11372 included.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…lothai#11386) A pull_request run does not test the branch head. It tests refs/pull/N/merge, a merge of the branch into the base as the base stood when the run was created. GitHub does not rebuild that ref because the base later moved, and a re-run replays the same merge commit, so a fix that lands on main after a run starts stays invisible to that run until someone pushes to the branch. That cost real time today. unslothai#11372 gave three test files encoding = "utf-8" and merged at 14:35 UTC. Runs created at 13:39, 14:26 and 14:29 on unslothai#11375, unslothai#11357 and unslothai#11373 all went on failing tests/test_source_read_encoding.py on exactly those three lines, and all three were first read as defects in branches that had never touched the files. Adds .github/actions/merge-ref-age, which asks the compare endpoint how far the base branch has moved since this run's merge ref was built and prints a notice if the answer is not zero. It is wired into the two studio-backend-ci.yml jobs that run pytest, gated on failure(), so a green job never pays for it and it stays quiet when the base has not moved. It is advisory and cannot fail a job. A stale merge ref does not make a failure untrue: the merge really does fail. Deciding otherwise for the reader would be worse than the confusion it is fixing, so the script never exits non-zero and never emits ::error::. tests/studio/test_merge_ref_age_is_reported.py keeps both properties: every job in that workflow running pytest carries the step under failure(), and the action's script cannot fail the job it sits in. Each assertion was checked by reverting it individually against a green baseline. The repo's own test_workflow_guards_run_unfiltered caught the new guard missing from the unfiltered job, so it is registered in workflow-trigger-lint.yml too.
…11372) * Format the validator unslothai#11370 added, so pre-commit.ci is green again `ruff-format-with-kwargs` runs over the whole tree, so one unformatted signature fails the hook on every open PR rather than only on the one that introduced it. `_validate_sidebar_nav_auto` fits on a single line under the pinned ruff 0.6.9, and this is exactly the output of `python scripts/run_ruff_format.py studio/backend/routes/settings.py`. * Give the desktop release tests an explicit utf-8 encoding The repo's own guard in tests/security fails any read of a checked-in file at the platform default encoding, because it breaks on Windows the moment that file gains a non-ASCII byte. Three reads added with the desktop release work were missing it, which fails `Repo tests (CPU, rest)` on every PR opened against current main, unslothai#11371 and unslothai#11372 included.
…lothai#11386) A pull_request run does not test the branch head. It tests refs/pull/N/merge, a merge of the branch into the base as the base stood when the run was created. GitHub does not rebuild that ref because the base later moved, and a re-run replays the same merge commit, so a fix that lands on main after a run starts stays invisible to that run until someone pushes to the branch. That cost real time today. unslothai#11372 gave three test files encoding = "utf-8" and merged at 14:35 UTC. Runs created at 13:39, 14:26 and 14:29 on unslothai#11375, unslothai#11357 and unslothai#11373 all went on failing tests/test_source_read_encoding.py on exactly those three lines, and all three were first read as defects in branches that had never touched the files. Adds .github/actions/merge-ref-age, which asks the compare endpoint how far the base branch has moved since this run's merge ref was built and prints a notice if the answer is not zero. It is wired into the two studio-backend-ci.yml jobs that run pytest, gated on failure(), so a green job never pays for it and it stays quiet when the base has not moved. It is advisory and cannot fail a job. A stale merge ref does not make a failure untrue: the merge really does fail. Deciding otherwise for the reader would be worse than the confusion it is fixing, so the script never exits non-zero and never emits ::error::. tests/studio/test_merge_ref_age_is_reported.py keeps both properties: every job in that workflow running pytest carries the step under failure(), and the action's script cannot fail the job it sits in. Each assertion was checked by reverting it individually against a green baseline. The repo's own test_workflow_guards_run_unfiltered caught the new guard missing from the unfiltered job, so it is registered in workflow-trigger-lint.yml too.
The repo's own guard in
tests/securityfails any read of a checked-in file at the platform default encoding, because that read breaks on Windows the moment the file gains a non-ASCII byte. Three reads added with the desktop release work are missing it, soRepo tests (CPU, rest)is red on every PR opened against current main:Seen on #11371 and #11369, neither of which goes near those files. #11368, opened before the reads landed, is green.
encoding = "utf-8"on the three reads, and on thewrite_textthat copies one of them.pytest tests/security/test_desktop_release_resolver.py tests/security/test_release_desktop_integrity.pyis 47 passed, and the guard itself passes.This PR originally also carried the
settings.pyformatting fix forruff-format-with-kwargs; #11371 landed that first, so only the encoding fix is left here.