Repository navigation
Recognize explicit tox environments and nox sessions in Python workflow checks - #344
Conversation
…ow checks Signed-off-by: Emmanuel Mawulolo Tagbor <etagbor@gmail.com>
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c49a9c776
ℹ️ 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".
| checks = checks.filter((check) => { | ||
| if (!isPythonSession(check.command)) return true; |
There was a problem hiding this comment.
Filter linked workflows before deduplicating sessions
When .github/workflows/a.yml is a symlink to a regular b.yml declaring a supported nox -s lint check, workflowFiles() reads a.yml first and discoverPythonChecks() deduplicates by command, retaining only the entry whose script is a.yml. This post-discovery filter then removes that entry even though the regular workflow still declares the check. I reproduced plannedChecks() changing from one RUN check to [] solely by adding the symlink. Reject linked workflow inputs before discovery/deduplication, or preserve the regular occurrence; otherwise verification silently omits a real CI check without reporting it as skipped.
Useful? React with 👍 / 👎.
Signed-off-by: Emmanuel Mawulolo Tagbor <etagbor@gmail.com>
|
Thanks for this, and for flagging the two CLI tests that fail on macOS. You were right that they weren't caused by this PR. Both were broken on main for Linux and macOS, and Core CI never ran the CLI's own tests there, so nobody saw it. The merge gate selected them here because the PR touches
CI also runs the CLI test suite on Ubuntu and Windows now. Could you update the branch from main? The merge gate re-tests the old merge commit, so re-running the job alone won't clear it. I'll review the tox/nox changes in the meantime. |
adityankale190895
left a comment
There was a problem hiding this comment.
Thanks for this. The parsing is careful: the tox and nox readers turn away anything unusual, the base-commit check declines when the session config changed, and the new files are in release-files.json. Two things before merge:
1. The two workflows this is modeled on don't get a check. Their real CI files set up Python and install the runner before calling it:
- mykrok/mykrok:
actions/checkout→actions/setup-python→pip install tox tox-uv→tox -e lint,type - googleads/google-ads-mcp:
actions/checkout→actions/setup-python→pip install black nox→nox -s lint
Any uses other than a plain actions/checkout, and any earlier run step, sets unknownSessionContext, so discoverPythonChecks returns nothing for both. The same happens for actions/checkout with fetch-depth or a tag like @v4.2.2. Most real workflows have these steps, so as written the feature mostly matches the test fixtures.
Could you allow the usual setup steps? For example, actions/setup-python / astral-sh/setup-uv with literal inputs, checkout with literal inputs and semver tags, and a pip install / uv tool install whose arguments are only package names (tox, nox, tox-uv, and the check tools). A test against workflows shaped like these two would cover it. If you'd rather keep this PR strict, please say in the design note that real workflows aren't matched yet, and we can widen it in a follow-up.
2. Small: empty PATH entries on Windows (python-session-files.ts, pathIsUnambiguous). Windows PATHs often end with ; or contain ;;. The empty segment fails isAbsolute, so nox sessions are always left to CI there. Windows lookup ignores empty segments (only POSIX reads them as the current directory), so filtering them out on win32 should be safe.
Signed-off-by: Emmanuel Mawulolo Tagbor <etagbor@gmail.com>
Signed-off-by: Emmanuel Mawulolo Tagbor <etagbor@gmail.com>
adityankale190895
left a comment
There was a problem hiding this comment.
Thanks @KingEmma7, this is ready. All three points are handled:
- The design note now says real workflows with setup or install steps stay in CI, and names both examples. Keeping this PR strict is fine. I'll open a follow-up for
actions/setup-python/astral-sh/setup-uv, checkout inputs and package-only installs. - The Windows PATH check drops empty segments and is stricter than I asked for (PATHEXT required, cwd checked for
cmd.exeand the tools). Nice. - Linked workflows are now excluded before deduplication, so the regular workflow's session survives. The new test covers it.
I checked it merged with current main: typecheck, the planner and CLI tests, and the release boundary audit all pass.
|
Thank you @KingEmma7, merged! tox and nox sessions are now planned in Python workflow checks, after uv in #333. With Yarn Classic (#63, #67, #70) and Yarn Berry (#245) behind you, I'd like to invite you to be Area maintainer: Yarn (tiers). You'd be named in the README and the Yarn docs, requested as a reviewer on Yarn PRs, and co-author of a short write-up on Yarn lockfile narrowing if you'd like one. As before, there's no fixed availability, and you can step back any time. If you want the next piece, #345 is the follow-up to this PR (setup-python and pip install before tox/nox). It's yours to take first. We also have a Discord for contributors if you'd like to chat there: https://discord.gg/vAftSVeYgk |
|
Thanks, Aditya! I’d be happy to accept the Yarn Area Maintainer role. I appreciate the flexibility and look forward to weighing in on Yarn design decisions and reviewing PRs as my schedule allows. |
Accepted on #344. README tier and a maintainer line next to the Yarn lockfile narrowing docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Welcome aboard, @KingEmma7! You're now Area maintainer: Yarn. The README lists you that way (982291e), and the Yarn lockfile docs in release-boundary.md name you as maintainer. diffci.com/contributors will pick it up on its next sync. From now on I'll request your review on Yarn PRs and tag you on Yarn design questions. We'd also like to hear what else would help you. That could be how your work is recognised, what you get out of contributing, or anything we could do better. We're collecting ideas in Contributors: how else would you like your work recognised?, and your input there would mean a lot. |
Addresses item 2 of #330.
DiffCI can now plan a root-level
tox -e lint,typeornox -s lintwhen it can read every selected command fromtox.iniornoxfile.py. Discovery reads text. Verification runs the original command, so a failure in either environment reaches the check receipt.The supported subset uses preinstalled tools. Tox must skip installing the project and explicitly allow its check programs. Nox must declare literal sessions using the current environment. Ruff format needs
--check, Ruff lint needs both--no-fixand--no-fix-only, and mypy needs--config-file=and literal paths. Non-isolated Ruff runs on any change because a config can include other file extensions. A Python-only session can skip unrelated edits after DiffCI checks both Git trees for symlinks and submodules.Setup scripts, custom actions, alternate working directories, dynamic declarations, install steps, hooks, mixed mutating commands and ambiguous local overrides leave the session to CI. Tox also stays with CI on Windows because its effective user config cannot be confirmed there. The design note documents the grammar and the two public workflows that inspired the fixtures. Both real jobs set up Python and install packages first. Mykrok’s tox environments also install project extras. Google’s nox session builds its Black command in a Python helper. These jobs continue to run in CI. The CLI package keeps its existing Core pin for the normal release process.
Reproduction and validation
node --import tsx --test tests/planner/python-checks.test.tsruns synthetic workflows that model the named invocations from the mykrok and Google examples. mykrok workflow · google-ads-mcp workflowf5ddf3d, which this revision incorporates. Both corrected fixtures passed in the full CLI suite.