Skip to content

Give the desktop release tests an explicit utf-8 encoding - #11372

Merged
danielhanchen merged 3 commits into
mainfrom
fix-settings-kwarg-format
Sep 20, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
fix-settings-kwarg-format

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

The repo's own guard in tests/security fails 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, so Repo tests (CPU, rest) is red on every PR opened against current main:

AssertionError: 1 file reads in the test trees touch a checked-in file with the platform
default encoding ... ['tests/security/test_release_desktop_integrity.py:911: read_text()']
AssertionError: 2 file reads ... ['tests/security/test_desktop_release_resolver.py:124: read_text()',
                                  'tests/security/test_desktop_release_resolver.py:132: read_text()']

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 the write_text that copies one of them. pytest tests/security/test_desktop_release_resolver.py tests/security/test_release_desktop_integrity.py is 47 passed, and the guard itself passes.

This PR originally also carried the settings.py formatting fix for ruff-format-with-kwargs; #11371 landed that first, so only the encoding fix is left here.

`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`.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T14:22:08.511177Z 5d553b3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 20, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 57b85a379d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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.
@danielhanchen danielhanchen changed the title Format the validator #11370 added, so pre-commit.ci is green again Give the desktop release tests an explicit utf-8 encoding Sep 20, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 5d553b3d78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit 7cc58b4 into main Sep 20, 2026
26 checks passed
@danielhanchen
danielhanchen deleted the fix-settings-kwarg-format branch September 20, 2026 14:35
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 20, 2026
pull Bot pushed a commit to y1024/unsloth that referenced this pull request Sep 20, 2026
…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.
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…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.
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…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.
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.

1 participant