Skip to content

Add rustflags passthrough to setup-rust and rust-build-release - #391

Open
leynos wants to merge 10 commits into
mainfrom
add-rustflags-passthrough-inputs
Open

Add rustflags passthrough to setup-rust and rust-build-release#391
leynos wants to merge 10 commits into
mainfrom
add-rustflags-passthrough-inputs

Conversation

@leynos

@leynos leynos commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

This branch adds a rustflags passthrough to the setup-rust and rust-build-release composite actions so consumers can stop the nested actions-rust-lang/setup-rust-toolchain step from silently stripping flags their builds require.

That nested step exports RUSTFLAGS="-D warnings" into the job environment whenever the variable is unset, and an ambient RUSTFLAGS overrides Cargo's build.rustflags configuration. Projects whose source tree requires specific flags in .cargo/config.toml — netsuke's -Zpolonius=next borrow-checker flag being the motivating case (leynos/netsuke#465, leynos/netsuke#472) — therefore fail to compile in any step after setup unless every recipe re-states the flags.

  • setup-rust/action.yml gains a rustflags input forwarded to all three nested setup-rust-toolchain invocations. The default preserves the historical -D warnings; the empty string leaves RUSTFLAGS unset so the project's Cargo configuration applies.
  • rust-build-release/action.yml gains a rustflags input exported ahead of its internally pinned setup-rust step, through a GITHUB_ENV heredoc with env-var indirection (no template expansion inside the script). A pre-existing RUSTFLAGS still takes precedence. Implementing the export locally avoids bumping the internal setup-rust-v1 pin inside this pull request.

Review walkthrough

Validation

  • uv run --with pytest --with pyyaml pytest .github/actions/setup-rust/tests/ .github/actions/rust-build-release/tests/test_manifest_input_step.py -q: all pass (30 + 7).
  • uv tool run ruff check and ruff format --check on the changed test files: clean.
  • markdownlint-cli2 on the changed READMEs and changelogs: 0 errors.

Notes

Behaviour is unchanged for existing consumers: setup-rust defaults to the historical -D warnings, and rust-build-release defaults to not touching the environment. Netsuke currently works around the issue with job-level RUSTFLAGS env blocks; once this lands and the action tags move, it can adopt the inputs instead.

References

Summary by Sourcery

Add configurable RUSTFLAGS passthrough to the shared Rust setup and release build composite actions to avoid clobbering project-specific compiler flags while preserving default behaviour for existing consumers.

New Features:

  • Introduce a rustflags input to the setup-rust composite action to control the RUSTFLAGS value used by nested setup-rust-toolchain steps.
  • Expose a rustflags input in the rust-build-release composite action that can export caller-provided RUSTFLAGS before toolchain setup.

Enhancements:

  • Ensure the rust-build-release action only exports RUSTFLAGS when the rustflags input is set and defers to any pre-existing RUSTFLAGS environment variable.
  • Document the new rustflags inputs and defaults in the READMEs and changelogs for both setup-rust and rust-build-release actions.

Tests:

  • Add manifest-level tests to verify the rustflags input defaults and wiring in setup-rust and rust-build-release action manifests.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary

  • Added configurable rustflags inputs to setup-rust and rust-build-release.
  • Preserved setup-rust’s -D warnings default while allowing empty values to leave RUSTFLAGS unset.
  • Exported rust-build-release flags before toolchain setup without overriding inherited values, with collision-safe heredoc handling compatible with macOS Bash 3.2.
  • Added manifest and runtime coverage for flag forwarding, delimiter safety, inherited values, and step ordering.
  • Updated action documentation and changelogs.
  • Included test-helper complexity, path-resolution, typing, formatting, and documentation-style improvements.

Targeted tests, Ruff, formatting checks, and Markdown linting passed; the full run reported 1,079 tests passed and 7 skipped.

Walkthrough

The pull request adds configurable rustflags handling to Rust GitHub Actions, forwards flags through toolchain setup paths, expands manifest tests, and updates related documentation. It also applies repository maintenance changes and formatting-only edits across Python examples and execution plans.

Changes

Rust flags configuration

Layer / File(s) Summary
Export caller Rust flags
.github/actions/rust-build-release/action.yml, .github/actions/rust-build-release/tests/*, .github/actions/rust-build-release/README.md, .github/actions/rust-build-release/CHANGELOG.md
Add the optional rustflags input, export it before toolchain setup with a generated heredoc delimiter, and test its wiring, precedence, ordering, and payload handling.
Forward Rust flags to toolchain setup
.github/actions/setup-rust/action.yml, .github/actions/setup-rust/tests/*, .github/actions/setup-rust/README.md, .github/actions/setup-rust/CHANGELOG.md
Declare rustflags, forward it through all toolchain installation paths, and validate the default and manifest wiring.

Repository maintenance

Layer / File(s) Summary
Metadata and helper updates
.coverage, .github/actions/linux-packages/scripts/package.py, .github/actions/release-to-pypi-uv/tests/_helpers.py
Update stored coverage path metadata, annotate OctalInt._octal_width, and derive helper paths from __file__.
Type alias ordering
workflow_scripts/graphql_client.py
Reorder None within the unchanged JsonValue union.

Documentation formatting

Layer / File(s) Summary
Python rules examples
.rules/python-*.md
Adjust spacing and presentation in Python rule examples without changing their described semantics.
Guide and script examples
docs/cmd-mox-users-guide.md, docs/python-action-scripts.md, docs/scripting-standards.md, docs/local-validation-of-github-actions-with-act-and-pytest.md
Reformat embedded examples and add spacing in documentation snippets.
Exec plan corrections
docs/execplans/*
Add placeholder spacing, correct spelling, and adjust string quoting in embedded examples.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant rust-build-release
  participant GITHUB_ENV
  participant setup-rust
  participant RustToolchain
  Caller->>rust-build-release: supply rustflags
  rust-build-release->>GITHUB_ENV: export RUSTFLAGS before setup
  rust-build-release->>setup-rust: invoke toolchain setup
  setup-rust->>RustToolchain: forward inputs.rustflags
  RustToolchain-->>setup-rust: complete installation
Loading

Suggested reviewers: codescene-access

Poem

Rust flags cross the setup gate,
Heredocs guard the payload’s state.
Guides gain space and snippets align,
Metadata follows a cleaner line.
Through paths and docs the changes flow.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 3 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error The rust-build-release tests stay Linux-only, still assert -v RUSTFLAGS, and never exercise empty inherited RUSTFLAGS or Bash 3.2 parsing. Add a behaviour-based test for empty inherited RUSTFLAGS and avoid asserting the shell operator; run the export fragment under Bash 3.2-compatible coverage.
User-Facing Documentation ⚠️ Warning No docs/users-guide.md exists; rustflags is only documented in READMEs/CHANGELOGs, not in a user guide. Add a user-guide doc (or equivalent end-user guide) covering the new rustflags inputs, defaults, empty-string behaviour, and inherited-RUSTFLAGS precedence.
Developer Documentation ⚠️ Warning The rustflags action changes are documented in READMEs, but docs/developers-guide.md and the relevant design docs were not updated for the new API/behaviour. Update docs/developers-guide.md or the relevant design doc with the rustflags passthrough and export behaviour, then sync any matching roadmap/execplan items.
Testing (Property / Proof) ⚠️ Warning The RUSTFLAGS export introduces a broad delimiter-safety invariant, but the PR adds only example-based pytest cases and no property/proof coverage. Add property-based coverage (for example Hypothesis/proptest) that generates varied RUSTFLAGS payloads and checks round-trip, delimiter-safety, and inherited-value precedence.
Concurrency And State ❓ Inconclusive placeholder Need repository evidence before final verdict.
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR’s main change: adding rustflags passthrough to both Rust actions.
Description check ✅ Passed The description is directly related to the changeset and explains the new rustflags passthrough, tests, and docs updates.
Docstring Coverage ✅ Passed Docstring coverage is 89.47% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Module-Level Documentation ✅ Passed PASS: every changed Python module has a top-level docstring describing its role, so the module-level documentation rule is met.
Testing (Unit And Behavioural) ✅ Passed Verify the action boundary with manifest assertions and bash execution, covering delimiter collisions, inherited RUSTFLAGS, and ordering.
Testing (Compile-Time / Ui) ✅ Passed The diff touches only a Python manifest test helper and no Rust/TypeScript sources, so the trybuild/snapshot requirement is not applicable here.
Unit Architecture ✅ Passed Keep the side-effect in the shell step: Export caller RUSTFLAGS writes to GITHUB_ENV, and parsing lives in small test helpers.
Domain Architecture ✅ Passed Keep it as infrastructure: the diff only touches GitHub Actions manifests, tests, and docs, with no domain model or repository logic involved.
Observability ✅ Passed Action logs inherited-RUSTFLAGS and delimiter-failure branches at the decision points; no metrics/tracing/alerts are needed for this workflow-only change.
Security And Privacy ✅ Passed PASS: the new RUSTFLAGS forwarding uses env indirection and a random heredoc delimiter, with no secrets, auth, or permission changes introduced.
Performance And Resource Use ✅ Passed No avoidable regressions: the new export step uses a 3-try bounded loop with fixed-size urandom reads, and the tests’ parsing is linear.
Architectural Complexity And Maintainability ✅ Passed PASS — Keep the change explicit: the only new helper factors heredoc parsing in tests, and the action changes add one input plus one early export step without new layers or indirection.
Rust Compiler Lint Integrity ✅ Passed No Rust source changed; the diff only touches action manifests, docs, and a Python test helper, with no lint suppressions or artificial anchors.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-rustflags-passthrough-inputs

Comment @coderabbitai help to get the list of available commands.

codescene-access[bot]

This comment was marked as outdated.

@sourcery-ai

sourcery-ai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a configurable rustflags passthrough to the setup-rust and rust-build-release composite actions, including wiring into nested setup-rust-toolchain calls, a guarded export step in rust-build-release, tests, and documentation/changelog updates while preserving existing default behavior.

Sequence diagram for rustflags passthrough in setup-rust and rust-build-release

sequenceDiagram
    actor Workflow
    participant RustBuildRelease as rust-build-release
    participant SetupRust as setup-rust
    participant SetupRustToolchain as setup-rust-toolchain

    Workflow->>RustBuildRelease: run (inputs.rustflags)
    alt inputs.rustflags != ''
        RustBuildRelease->>RustBuildRelease: Export caller RUSTFLAGS
        alt env.RUSTFLAGS already set
            RustBuildRelease-->>RustBuildRelease: keep inherited RUSTFLAGS
        else env.RUSTFLAGS unset
            RustBuildRelease-->>RustBuildRelease: write RUSTFLAGS to GITHUB_ENV
        end
    else inputs.rustflags == ''
        RustBuildRelease-->>RustBuildRelease: environment untouched
    end

    RustBuildRelease->>SetupRust: Setup Rust toolchain (rustflags input)
    SetupRust->>SetupRustToolchain: call with rustflags: ${{ inputs.rustflags }}
    alt env.RUSTFLAGS unset in setup-rust-toolchain
        SetupRustToolchain-->>SetupRustToolchain: export RUSTFLAGS "-D warnings"
    else env.RUSTFLAGS set
        SetupRustToolchain-->>SetupRustToolchain: keep existing RUSTFLAGS
    end
Loading

File-Level Changes

Change Details Files
Add rustflags input to setup-rust and forward it to all nested setup-rust-toolchain steps while preserving the historical -D warnings default.
  • Introduce optional rustflags input with default '-D warnings' describing precedence and interaction with Cargo config.
  • Pass inputs.rustflags through the with block to each actions-rust-lang/setup-rust-toolchain step (explicit toolchain, rust-toolchain file, stable default).
  • Document the new rustflags input in setup-rust README and record it in the setup-rust changelog with a new version entry.
  • Add tests to assert rustflags input existence, default value, and forwarding in all install steps.
.github/actions/setup-rust/action.yml
.github/actions/setup-rust/tests/test_setup_rust_manifest.py
.github/actions/setup-rust/README.md
.github/actions/setup-rust/CHANGELOG.md
Add rustflags input to rust-build-release and export it into the job environment before invoking setup-rust, without changing existing behavior when unset.
  • Introduce optional rustflags input with empty-string default and detailed description of interaction with nested setup-rust and Cargo config.
  • Add 'Export caller RUSTFLAGS' bash step that runs before toolchain setup, conditionally writes a RUSTFLAGS heredoc to GITHUB_ENV via env-var indirection, and defers to a pre-existing RUSTFLAGS.
  • Ensure step ordering so the export runs before 'Setup Rust toolchain'.
  • Document the rustflags input in rust-build-release README and changelog, describing precedence and motivation.
  • Add tests to validate rustflags input declaration, export step wiring (if condition, env mapping, script content, lack of template expansion), and ordering before the toolchain setup step.
.github/actions/rust-build-release/action.yml
.github/actions/rust-build-release/tests/test_manifest_input_step.py
.github/actions/rust-build-release/README.md
.github/actions/rust-build-release/CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos
leynos marked this pull request as ready for review July 29, 2026 12:40

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f667b1b631

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

Comment on lines +85 to +87
echo "RUSTFLAGS<<__RBR_RUSTFLAGS_EOF__"
printf '%s\n' "$RBR_RUSTFLAGS"
echo "__RBR_RUSTFLAGS_EOF__"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Choose a collision-safe environment-file delimiter

When rustflags contains a line exactly equal to __RBR_RUSTFLAGS_EOF__, this fixed marker terminates the value early and GitHub parses the remaining caller-provided lines as additional environment-file commands; that can either fail the action with an invalid format or set unintended variables for subsequent setup and build steps. Generate a unique delimiter and verify it does not occur in the value, or reject multiline input before writing it.

AGENTS.md reference: AGENTS.md:L144-L144

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai Has this now been resolved in the latest commit?

Use codegraph analysis to determine your answer.

If this comment is now resolved, please mark it as such using the API. Otherwise, please provide an AI agent prompt for the remaining work to be done to address this comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the action metadata and its directly referenced scripts without executing them.
ast-grep outline .github/actions/rust-build-release --items all 2>/dev/null || true
printf '\n--- RUSTFLAGS producer/consumer flow ---\n'
rg -n -C 5 \
  'RBR_RUSTFLAGS|RUSTFLAGS|setup-rust|action_setup\.py|main\.py' \
  .github/actions/rust-build-release .github/actions/setup-rust

printf '\n--- Current delimiter implementation ---\n'
sed -n '/name: Export caller RUSTFLAGS/,/name: Setup Rust toolchain/p' \
  .github/actions/rust-build-release/action.yml

Length of output: 72850


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Identify the thread for the supplied review comment, its author, and whether it is already resolved.
gh api graphql \
  -F owner='leynos' \
  -F name='shared-actions' \
  -F number=391 \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          id
          isResolved
          comments(first: 20) {
            nodes {
              url
              author { login }
              body
            }
          }
        }
      }
    }
  }
}' \
  --jq '.data.repository.pullRequest.reviewThreads.nodes[]
    | select(any(.comments.nodes[]; .url == "https://github.com/leynos/shared-actions/pull/391#discussion_r3674325431"))
    | {id, isResolved, comments}'

Length of output: 2434


@leynos, treat this finding as resolved.

The codegraph/data-flow inspection confirms that inputs.rustflags now reaches $GITHUB_ENV through a per-run random delimiter, which is rejected if it occurs as a complete line in RBR_RUSTFLAGS. The regression test in .github/actions/rust-build-release/tests/test_manifest_input_step.py verifies that the former fixed-marker injection payload remains entirely inside RUSTFLAGS and does not create RBR_INJECTED.

Resolve thread PRRT_kwDOO9OxNc6UwZ-8 from the chatgpt-codex-connector account. I cannot resolve it through the API because that account, rather than coderabbitai, authored the original review comment.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

.github/actions/rust-build-release/tests/test_manifest_input_step.py

Comment on lines +66 to +93

def _parse_env_file(text: str) -> dict[str, str]:
    """Parse ``GITHUB_ENV`` content, honouring heredoc-delimited values."""
    values: dict[str, str] = {}
    lines = text.splitlines()
    index = 0
    while index < len(lines):
        line = lines[index]
        index += 1
        if not line:
            continue
        name, separator, remainder = line.partition("=")
        if separator:
            values[name] = remainder
            continue
        name, separator, delimiter = line.partition("<<")
        if not separator:
            message = f"unparsable environment-file line: {line!r}"
            raise AssertionError(message)
        collected: list[str] = []
        while index < len(lines) and lines[index] != delimiter:
            collected.append(lines[index])
            index += 1
        if index >= len(lines):
            message = f"unterminated heredoc for {name}"
            raise AssertionError(message)
        index += 1
        values[name] = "\n".join(collected)
    return values

❌ New issue: Complex Method
_parse_env_file has a cyclomatic complexity of 10, threshold = 9

@coderabbitai

This comment was marked as resolved.

@leynos

leynos commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please investigate the cause of the following issue using codegraph exploration and research, identify a fix and provide an AI coding agent prompt for the fix:

Run uv sync --group dev
  uv sync --group dev
  uv run pytest
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    MERMAN_CLI_VERSION: 0.7.0
    WHITAKER_INSTALLER_VERSION: 0.2.6
    UV_PYTHON_INSTALL_DIR: /Users/runner/work/_temp/uv-python-dir
    UV_PYTHON: 3.13
    UV_CACHE_DIR: /Users/runner/work/_temp/setup-uv-cache
    PYTHONIOENCODING: utf-8
Using CPython 3.13.14 interpreter at: /usr/local/bin/python3.13
Creating virtual environment at: .venv
Resolved 48 packages in 203ms
   Building shared-actions @ file:///Users/runner/work/shared-actions/shared-actions
Downloading ty (10.8MiB)
Downloading lxml (8.2MiB)
Downloading pygments (1.2MiB)
 Downloaded ty
 Downloaded lxml
 Downloaded pygments
      Built shared-actions @ file:///Users/runner/work/shared-actions/shared-actions
Prepared 46 packages in 2.70s
Installed 46 packages in 94ms
 + annotated-doc==0.0.5
 + anyio==4.14.2
 + attrs==26.1.0
 + certifi==2026.7.22
 + cmd-mox==0.2.0
 + cyclopts==3.24.0
 + docstring-parser==0.18.0
 + docutils==0.23
 + gherkin-official==29.0.0
 + h11==0.16.0
 + httpcore==1.0.9
 + httpx==0.28.1
 + hypothesis==6.163.0
 + idna==3.18
 + iniconfig==2.3.0
 + jinja2==3.1.6
 + lxml==6.1.1
 + lxml-stubs==0.5.1
 + mako==1.3.12
 + markdown-it-py==4.2.0
 + markupsafe==3.0.3
 + mdurl==0.1.2
 + packaging==26.2
 + parse==1.22.1
 + parse-type==0.6.6
 + pathspec==1.1.1
 + pluggy==1.6.0
 + plumbum==1.10.0
 + polythene==0.1.0 (from git+https://github.com/leynos/polythene.git@61b4566130305fcb32f419f09ae8b3940ceb4107)
 + pygments==2.20.0
 + pytest==9.1.1
 + pytest-bdd==8.1.0
 + pyyaml==6.0.3
 + rich==15.0.0
 + rich-rst==1.3.2
 + shared-actions==1.2.2 (from file:///Users/runner/work/shared-actions/shared-actions)
 + shellingham==1.5.4
 + six==1.17.0
 + sortedcontainers==2.4.0
 + syrupy==5.5.3
 + syspath-hack==0.4.0
 + tenacity==9.1.4
 + ty==0.0.64
 + typer==0.27.0
 + typing-extensions==4.16.0
 + uuid6==2025.0.1
============================= test session starts ==============================
platform darwin -- Python 3.13.14, pytest-9.1.1, pluggy-1.6.0
rootdir: /Users/runner/work/shared-actions/shared-actions
configfile: pytest.ini (WARNING: ignoring pytest config in pyproject.toml!)
testpaths: .github/actions, workflow_scripts/tests
plugins: syrupy-5.5.3, hypothesis-6.163.0, anyio-4.14.2, bdd-8.1.0
collected 1090 items

.github/actions/determine-release-modes/tests/test_determine_release_modes.py . [  0%]
..........................                                               [  2%]
.github/actions/ensure-cargo-version/scripts/tests/test_ensure_cargo_version.py . [  2%]
..............                                                           [  3%]
.github/actions/export-cargo-metadata/tests/test_read_manifest.py ...... [  4%]
........                                                                 [  5%]
.github/actions/generate-coverage/scripts/tests/test_run_rust_windows.py . [  5%]
.                                                                        [  5%]
.github/actions/generate-coverage/tests/test_archive_masking.py ...      [  5%]
.github/actions/generate-coverage/tests/test_cmd_utils.py ..             [  5%]
.github/actions/generate-coverage/tests/test_cmd_utils_loader.py ...     [  6%]
.github/actions/generate-coverage/tests/test_common.py ................. [  7%]
.......................                                                  [  9%]
.github/actions/generate-coverage/tests/test_detect.py ................. [ 11%]
.......                                                                  [ 11%]
.github/actions/generate-coverage/tests/test_ratchet_baseline.py ....... [ 12%]
.....                                                                    [ 13%]
.github/actions/generate-coverage/tests/test_scripts.py ................ [ 14%]
........................................................................ [ 21%]
.......................................................................  [ 27%]
.github/actions/generate-coverage/tests/test_set_outputs.py ......       [ 28%]
.github/actions/linux-packages/tests/test_action_workdir.py .....        [ 28%]
.github/actions/linux-packages/tests/test_deb_package.py s               [ 28%]
.github/actions/linux-packages/tests/test_package_cli.py ............... [ 30%]
.........s..                                                             [ 31%]
.github/actions/linux-packages/tests/test_rpm_package.py s               [ 31%]
.github/actions/linux-packages/tests/test_script_utils_helpers.py ...... [ 31%]
.....                                                                    [ 32%]
.github/actions/macos-package/tests/test_build_component.py ..           [ 32%]
.github/actions/macos-package/tests/test_build_product.py ....           [ 32%]
.github/actions/macos-package/tests/test_check_platform.py ..            [ 33%]
.github/actions/macos-package/tests/test_compute_version.py .....        [ 33%]
.github/actions/macos-package/tests/test_prepare_license_resources.py .. [ 33%]
                                                                         [ 33%]
.github/actions/macos-package/tests/test_prepare_payload.py .....        [ 34%]
.github/actions/macos-package/tests/test_shared_utils.py .........       [ 34%]
.github/actions/macos-package/tests/test_sign_package.py ...             [ 35%]
.github/actions/release-to-pypi-uv/tests/test_action_python_version.py . [ 35%]
....                                                                     [ 35%]
.github/actions/release-to-pypi-uv/tests/test_check_github_release.py .. [ 35%]
..........                                                               [ 36%]
.github/actions/release-to-pypi-uv/tests/test_confirm_release.py ..      [ 36%]
.github/actions/release-to-pypi-uv/tests/test_determine_release.py ..... [ 37%]
......                                                                   [ 37%]
.github/actions/release-to-pypi-uv/tests/test_publish_release.py ....... [ 38%]
                                                                         [ 38%]
.github/actions/release-to-pypi-uv/tests/test_validate_toml_versions.py . [ 38%]
...................................................                      [ 43%]
.github/actions/release-to-pypi-uv/tests/test_write_summary.py ...       [ 43%]
.github/actions/rust-build-release/tests/test_action_setup.py .......... [ 44%]
...........                                                              [ 45%]
.github/actions/rust-build-release/tests/test_command_wrapper.py ...     [ 45%]
.github/actions/rust-build-release/tests/test_cross_install.py ......... [ 46%]
..                                                                       [ 46%]
.github/actions/rust-build-release/tests/test_features.py .............. [ 48%]
..                                                                       [ 48%]
.github/actions/rust-build-release/tests/test_linux_package_step.py .    [ 48%]
.github/actions/rust-build-release/tests/test_manifest_input_step.py ... [ 48%]
......FFFF.                                                              [ 49%]
.github/actions/rust-build-release/tests/test_manifest_path.py ......... [ 50%]
.......                                                                  [ 51%]
.github/actions/rust-build-release/tests/test_runtime.py ............... [ 52%]
.............................                                            [ 55%]
.github/actions/rust-build-release/tests/test_rust_toy_workflow.py ..    [ 55%]
.github/actions/rust-build-release/tests/test_setup_rust_reference.py .. [ 55%]
                                                                         [ 55%]
.github/actions/rust-build-release/tests/test_smoke.py s..ss             [ 56%]
.github/actions/rust-build-release/tests/test_stage_artefacts_step.py .. [ 56%]
..                                                                       [ 56%]
.github/actions/rust-build-release/tests/test_stage_script_behaviour.py . [ 56%]
.....                                                                    [ 56%]
.github/actions/rust-build-release/tests/test_target_install.py ........ [ 57%]
................................                                         [ 60%]
.github/actions/rust-build-release/tests/test_toolchain_helpers.py ..... [ 61%]
.....                                                                    [ 61%]
.github/actions/rust-build-release/tests/test_toolchain_sanitize.py s    [ 61%]
.github/actions/rust-build-release/tests/test_utils.py ....              [ 62%]
.github/actions/setup-rust/tests/test_copy_stdlib.py ...                 [ 62%]
.github/actions/setup-rust/tests/test_setup_rust_manifest.py ........... [ 63%]
..........                                                               [ 64%]
.github/actions/setup-rust/tests/test_validate_workspaces.py ......      [ 64%]
.github/actions/stage-release-artefacts/tests/test_binstall_bdd.py .     [ 64%]
.github/actions/stage-release-artefacts/tests/test_config.py ........... [ 65%]
....                                                                     [ 66%]
.github/actions/stage-release-artefacts/tests/test_environment.py ...    [ 66%]
.github/actions/stage-release-artefacts/tests/test_output.py ..........  [ 67%]
.github/actions/stage-release-artefacts/tests/test_resolution.py ...     [ 67%]
.github/actions/stage-release-artefacts/tests/test_stage_binstall.py ... [ 67%]
........                                                                 [ 68%]
.github/actions/stage-release-artefacts/tests/test_stage_cli.py ....     [ 69%]
.github/actions/stage-release-artefacts/tests/test_stage_core.py ....... [ 69%]
......                                                                   [ 70%]
.github/actions/stage-release-artefacts/tests/test_stage_path_safety.py . [ 70%]
.......                                                                  [ 71%]
.github/actions/stage-release-artefacts/tests/test_stage_powershell.py . [ 71%]
........                                                                 [ 71%]
.github/actions/tests/test_actions_common.py ....                        [ 72%]
.github/actions/upload-release-assets/tests/test_upload_release_assets.py . [ 72%]
..................................                                       [ 75%]
.github/actions/validate-linux-packages/tests/deb/test_validate_packages.py . [ 75%]
...                                                                      [ 75%]
.github/actions/validate-linux-packages/tests/locators/test_locators.py . [ 75%]
...                                                                      [ 76%]
.github/actions/validate-linux-packages/tests/metadata/test_metadata_validators.py . [ 76%]
.....                                                                    [ 76%]
.github/actions/validate-linux-packages/tests/rpm/test_validate_packages.py . [ 76%]
......                                                                   [ 77%]
.github/actions/validate-linux-packages/tests/test_action_manifest.py .. [ 77%]
                                                                         [ 77%]
.github/actions/validate-linux-packages/tests/test_validate_architecture.py . [ 77%]
..                                                                       [ 77%]
.github/actions/validate-linux-packages/tests/test_validate_cli.py ..... [ 78%]
...........................                                              [ 80%]
.github/actions/validate-linux-packages/tests/test_validate_commands.py . [ 80%]
...                                                                      [ 81%]
.github/actions/validate-linux-packages/tests/test_validate_exceptions.py . [ 81%]
                                                                         [ 81%]
.github/actions/validate-linux-packages/tests/test_validate_helpers.py . [ 81%]
...                                                                      [ 81%]
.github/actions/validate-linux-packages/tests/test_validate_metadata.py . [ 81%]
...                                                                      [ 81%]
.github/actions/validate-linux-packages/tests/test_validate_normalize.py . [ 82%]
......                                                                   [ 82%]
.github/actions/validate-linux-packages/tests/test_validate_packages_diagnostics.py . [ 82%]
..                                                                       [ 82%]
.github/actions/validate-linux-packages/tests/test_validate_polythene.py . [ 82%]
...............                                                          [ 84%]
.github/actions/windows-package/tests/test_manifest.py ..                [ 84%]
.github/actions/windows-package/tests/test_plaintext_to_rtf.py ......... [ 85%]
.........                                                                [ 86%]
.github/actions/windows-package/tests/test_resolve_version_ps1.py ...... [ 86%]
.............                                                            [ 87%]
.github/actions/windows-package/tests/test_validate_inputs_ps1.py ...... [ 88%]
.........                                                                [ 89%]
.github/actions/windows-package/tests/test_windows_installer_template.py . [ 89%]
..............                                                           [ 90%]
workflow_scripts/tests/test_dependabot_automerge.py .................... [ 92%]
...................                                                      [ 94%]
workflow_scripts/tests/test_mutation_detect_changes.py ..............    [ 95%]
workflow_scripts/tests/test_mutation_properties.py ......                [ 96%]
workflow_scripts/tests/test_mutation_run_cargo.py ..............         [ 97%]
workflow_scripts/tests/test_mutation_run_mutmut.py ...........           [ 98%]
workflow_scripts/tests/test_mutation_summarize_cargo.py ........         [ 99%]
workflow_scripts/tests/test_mutation_testing_caller.py ......            [ 99%]
workflow_scripts/tests/test_mutation_workflow_shape.py ....              [100%]

=================================== FAILURES ===================================
________________ test_export_rustflags_writes_single_line_value ________________

tmp_path = PosixPath('/private/var/folders/pd/2_nlvl1s4k121pdk4d5_2c8m0000gn/T/pytest-of-runner/pytest-0/test_export_rustflags_writes_s0')

    def test_export_rustflags_writes_single_line_value(tmp_path: Path) -> None:
        """An ordinary value round-trips through the environment file."""
        result, env_text = _run_export_script(tmp_path, "-Zpolonius=next")
    
>       assert result.returncode == 0, result.stderr
E       AssertionError: /bin/bash: -c: line 1: conditional binary operator expected
E         
E       assert 2 == 0
E        +  where 2 = CompletedProcess(args=['/bin/bash', '-c', 'set -euo pipefail\nif [[ -v RUSTFLAGS ]]; then\n  echo "RUSTFLAGS already s... >> "$GITHUB_ENV"\n'], returncode=2, stdout='', stderr='/bin/bash: -c: line 1: conditional binary operator expected\n').returncode

.github/actions/rust-build-release/tests/test_manifest_input_step.py:207: AssertionError
______________ test_export_rustflags_contains_delimiter_lookalike ______________

tmp_path = PosixPath('/private/var/folders/pd/2_nlvl1s4k121pdk4d5_2c8m0000gn/T/pytest-of-runner/pytest-0/test_export_rustflags_contains0')

    def test_export_rustflags_contains_delimiter_lookalike(tmp_path: Path) -> None:
        """A value carrying the old fixed marker must not escape its heredoc."""
        result, env_text = _run_export_script(tmp_path, INJECTED_RUSTFLAGS)
    
>       assert result.returncode == 0, result.stderr
E       AssertionError: /bin/bash: -c: line 1: conditional binary operator expected
E         
E       assert 2 == 0
E        +  where 2 = CompletedProcess(args=['/bin/bash', '-c', 'set -euo pipefail\nif [[ -v RUSTFLAGS ]]; then\n  echo "RUSTFLAGS already s... >> "$GITHUB_ENV"\n'], returncode=2, stdout='', stderr='/bin/bash: -c: line 1: conditional binary operator expected\n').returncode

.github/actions/rust-build-release/tests/test_manifest_input_step.py:215: AssertionError
_____________ test_export_rustflags_delimiter_differs_between_runs _____________

tmp_path = PosixPath('/private/var/folders/pd/2_nlvl1s4k121pdk4d5_2c8m0000gn/T/pytest-of-runner/pytest-0/test_export_rustflags_delimite0')

    def test_export_rustflags_delimiter_differs_between_runs(tmp_path: Path) -> None:
        """Delimiters are generated per run so callers cannot predict them."""
        _, first = _run_export_script(tmp_path / "first", "-Zpolonius=next")
        _, second = _run_export_script(tmp_path / "second", "-Zpolonius=next")
    
>       assert first.splitlines()[0] != second.splitlines()[0]
               ^^^^^^^^^^^^^^^^^^^^^
E       IndexError: list index out of range

.github/actions/rust-build-release/tests/test_manifest_input_step.py:228: IndexError
_______________ test_export_rustflags_defers_to_inherited_value ________________

tmp_path = PosixPath('/private/var/folders/pd/2_nlvl1s4k121pdk4d5_2c8m0000gn/T/pytest-of-runner/pytest-0/test_export_rustflags_defers_t0')

    def test_export_rustflags_defers_to_inherited_value(tmp_path: Path) -> None:
        """An inherited RUSTFLAGS wins and nothing is written to the env file."""
        result, env_text = _run_export_script(
            tmp_path, "-Zpolonius=next", inherited="-D warnings"
        )
    
>       assert result.returncode == 0, result.stderr
E       AssertionError: /bin/bash: -c: line 1: conditional binary operator expected
E         
E       assert 2 == 0
E        +  where 2 = CompletedProcess(args=['/bin/bash', '-c', 'set -euo pipefail\nif [[ -v RUSTFLAGS ]]; then\n  echo "RUSTFLAGS already s... >> "$GITHUB_ENV"\n'], returncode=2, stdout='', stderr='/bin/bash: -c: line 1: conditional binary operator expected\n').returncode

.github/actions/rust-build-release/tests/test_manifest_input_step.py:237: AssertionError
--------------------------- snapshot report summary ----------------------------
4 snapshots passed.
=========================== short test summary info ============================
FAILED .github/actions/rust-build-release/tests/test_manifest_input_step.py::test_export_rustflags_writes_single_line_value - AssertionError: /bin/bash: -c: line 1: conditional binary operator expected
  
assert 2 == 0
 +  where 2 = CompletedProcess(args=['/bin/bash', '-c', 'set -euo pipefail\nif [[ -v RUSTFLAGS ]]; then\n  echo "RUSTFLAGS already s... >> "$GITHUB_ENV"\n'], returncode=2, stdout='', stderr='/bin/bash: -c: line 1: conditional binary operator expected\n').returncode
FAILED .github/actions/rust-build-release/tests/test_manifest_input_step.py::test_export_rustflags_contains_delimiter_lookalike - AssertionError: /bin/bash: -c: line 1: conditional binary operator expected
  
assert 2 == 0
 +  where 2 = CompletedProcess(args=['/bin/bash', '-c', 'set -euo pipefail\nif [[ -v RUSTFLAGS ]]; then\n  echo "RUSTFLAGS already s... >> "$GITHUB_ENV"\n'], returncode=2, stdout='', stderr='/bin/bash: -c: line 1: conditional binary operator expected\n').returncode
FAILED .github/actions/rust-build-release/tests/test_manifest_input_step.py::test_export_rustflags_delimiter_differs_between_runs - IndexError: list index out of range
FAILED .github/actions/rust-build-release/tests/test_manifest_input_step.py::test_export_rustflags_defers_to_inherited_value - AssertionError: /bin/bash: -c: line 1: conditional binary operator expected
  
assert 2 == 0
 +  where 2 = CompletedProcess(args=['/bin/bash', '-c', 'set -euo pipefail\nif [[ -v RUSTFLAGS ]]; then\n  echo "RUSTFLAGS already s... >> "$GITHUB_ENV"\n'], returncode=2, stdout='', stderr='/bin/bash: -c: line 1: conditional binary operator expected\n').returncode
================== 4 failed, 1079 passed, 7 skipped in 55.08s ==================
Error: Process completed with exit code 1.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

manifest=".github/actions/rust-build-release/action.yml"
test_file=".github/actions/rust-build-release/tests/test_manifest_input_step.py"

printf '%s\n' '--- manifest outline ---'
ast-grep outline "$manifest" --items all --view expanded || true
printf '%s\n' '--- action manifest rustflags-related sections ---'
rg -n -C 12 'rustflags|RUSTFLAGS|Setup Rust toolchain|GITHUB_ENV' "$manifest" || true

printf '%s\n' '--- focused test module outline ---'
ast-grep outline "$test_file" --items all --view expanded || true
printf '%s\n' '--- export helper and tests ---'
rg -n -C 10 '_run_export_script|test_export_rustflags|RUSTFLAGS|bash' "$test_file" || true

printf '%s\n' '--- all Bash -v environment-presence checks ---'
rg -n -C 4 '\[\[\s+-v\s+[A-Za-z_][A-Za-z0-9_]*\s*\]\]' .github --glob '*.yml' --glob '*.yaml' --glob '*.sh' --glob '*.bash' || true

printf '%s\n' '--- portable environment-presence guard patterns ---'
rg -n -C 3 '\$\{[A-Za-z_][A-Za-z0-9_]*\+x\}|\$\{[A-Za-z_][A-Za-z0-9_]*:-|\$\{[A-Za-z_][A-Za-z0-9_]*\+[^}]' .github/actions --glob '*.yml' --glob '*.yaml' --glob '*.sh' --glob '*.bash' || true

Length of output: 21673


🤖 web_search executed:

Bash conditional expression -v var introduced version Bash 4.2 official manual

Length of output: 7105


@leynos .github/actions/rust-build-release/action.ymlExport caller RUSTFLAGS step
.github/actions/rust-build-release/tests/test_manifest_input_step.pytest_export_rustflags_step_wiring, _run_export_script consumers

Fix the macOS Bash 3.2 incompatibility in the inherited-RUSTFLAGS guard.

Cause

The export script uses:

if [[ -v RUSTFLAGS ]]; then

-v varname is a Bash conditional primary available in Bash 4.2+, but the macOS runner’s /bin/bash is Bash 3.2. It rejects the conditional while parsing the script, producing conditional binary operator expected. This happens before the generated heredoc delimiter or GITHUB_ENV write executes, which explains all four failed runtime tests and the subsequent empty-output IndexError.

Replace it with the Bash-3.2-compatible setness expansion:

if [[ ${RUSTFLAGS+x} ]]; then

This retains the required behaviour under set -u:

  • RUSTFLAGS unset → expansion is empty → export the input value.
  • RUSTFLAGS set, including RUSTFLAGS="" → expansion is x → preserve the inherited value.

Patch

--- a/.github/actions/rust-build-release/action.yml
+++ b/.github/actions/rust-build-release/action.yml
@@
-        if [[ -v RUSTFLAGS ]]; then
+        if [[ ${RUSTFLAGS+x} ]]; then
           echo "RUSTFLAGS already set; leaving the inherited value in place" >&2
           exit 0
         fi

Update the manifest-wiring assertion in .github/actions/rust-build-release/tests/test_manifest_input_step.py:

-    assert "-v RUSTFLAGS" in run_script
+    assert "${RUSTFLAGS+x}" in run_script

Add a runtime regression test which invokes _run_export_script(..., inherited="") and verifies that an inherited empty RUSTFLAGS causes a successful no-op. This protects the important distinction between unset and set to empty.

  • Replace the Bash-4.2-only environment-presence predicate with a Bash-3.2-compatible parameter-expansion check.
  • Update the manifest test to enforce the portable guard.
  • Add execution coverage for the inherited-but-empty environment variable case.

AI coding-agent prompt:

Fix the macOS CI failure in the Rust flags export action.

Affected files and symbols:
- `.github/actions/rust-build-release/action.yml` — `Export caller RUSTFLAGS` composite-action step
- `.github/actions/rust-build-release/tests/test_manifest_input_step.py` — `test_export_rustflags_step_wiring` and the `_run_export_script` runtime-test callers

Cause:
The export script uses `if [[ -v RUSTFLAGS ]]; then`. GitHub’s macOS `/bin/bash` is Bash 3.2, which cannot parse the `-v` conditional primary. The script exits before it writes to `GITHUB_ENV`.

Implement this fix:
1. In the `Export caller RUSTFLAGS` step, replace:
   `if [[ -v RUSTFLAGS ]]; then`
   with:
   `if [[ ${RUSTFLAGS+x} ]]; then`
2. Preserve `set -euo pipefail`, the existing message, the heredoc delimiter generation, and all existing `GITHUB_ENV` behaviour.
3. Preserve the semantics that a pre-existing `RUSTFLAGS` wins even when it is deliberately set to an empty string. `${RUSTFLAGS+x}` must remain unquoted inside `[[ ... ]]`.
4. In `test_export_rustflags_step_wiring`, replace the assertion for `-v RUSTFLAGS` with an assertion for `${RUSTFLAGS+x}`.
5. Add a focused runtime test that calls:
   `_run_export_script(tmp_path, "-Zpolonius=next", inherited="")`
   and asserts:
   - return code is zero;
   - the `GITHUB_ENV` text is empty;
   - stderr contains `leaving the inherited value in place`.
6. Do not alter the `rustflags` input contract, generated-delimiter logic, nested `setup-rust` pin, or production behaviour beyond Bash 3.2 compatibility.
7. Run:
   `uv run pytest .github/actions/rust-build-release/tests/test_manifest_input_step.py -q`
   Then run the repository-configured formatter and linter for the changed Python test file. Report the commands and results.

  • 📌 Commit the changes to this branch

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coverage:
- Around line 52-53: Remove the machine-specific .coverage artifact from the
change, add .coverage to the repository’s ignore configuration, and leave
coverage generation to CI. Do not retain the absolute worktree path; only
preserve repository-relative coverage data if intentionally versioned.

In @.github/actions/rust-build-release/action.yml:
- Around line 81-84: The inherited RUSTFLAGS check in
.github/actions/rust-build-release/action.yml lines 81-84 must use the Bash
3.2-compatible set-variable form [[ -n ${RUSTFLAGS+x} ]] instead of [[ -v
RUSTFLAGS ]]; update the corresponding assertion in
.github/actions/rust-build-release/tests/test_manifest_input_step.py line 197 to
expect the new guard.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py:
- Around line 55-56: Update the subprocess.run call in the test to pass
check=False explicitly, preserving the existing manual returncode assertion and
command execution behavior.

In @.github/actions/setup-rust/action.yml:
- Around line 44-46: Insert a comma before “so” in the RUSTFLAGS description at
.github/actions/setup-rust/action.yml lines 44-46 and the corresponding README
text at .github/actions/setup-rust/README.md line 23; make no other wording
changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3d36f68c-9f28-483d-abf7-bcb8dd8380d8

📥 Commits

Reviewing files that changed from the base of the PR and between dca6131 and 42e70a8.

📒 Files selected for processing (25)
  • .coverage
  • .github/actions/linux-packages/scripts/package.py
  • .github/actions/release-to-pypi-uv/tests/_helpers.py
  • .github/actions/rust-build-release/CHANGELOG.md
  • .github/actions/rust-build-release/README.md
  • .github/actions/rust-build-release/action.yml
  • .github/actions/rust-build-release/tests/test_manifest_input_step.py
  • .github/actions/setup-rust/CHANGELOG.md
  • .github/actions/setup-rust/README.md
  • .github/actions/setup-rust/action.yml
  • .github/actions/setup-rust/tests/test_setup_rust_manifest.py
  • .rules/python-00.md
  • .rules/python-context-managers.md
  • .rules/python-exception-design-raising-handling-and-logging.md
  • .rules/python-generators.md
  • .rules/python-return.md
  • .rules/python-typing.md
  • docs/cmd-mox-users-guide.md
  • docs/execplans/2-4-5-extend-architecture-enforcement-to-orchestration-code.md
  • docs/execplans/add-mutation-testing-workflows.md
  • docs/execplans/support-cranelift-codegen.md
  • docs/local-validation-of-github-actions-with-act-and-pytest.md
  • docs/python-action-scripts.md
  • docs/scripting-standards.md
  • workflow_scripts/graphql_client.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/polythene (auto-detected)

Comment thread .github/actions/rust-build-release/action.yml Outdated
Comment thread .github/actions/setup-rust/action.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coverage:
- Around line 52-53: Remove the machine-specific .coverage artifact from the
change, add .coverage to the repository’s ignore configuration, and leave
coverage generation to CI. Do not retain the absolute worktree path; only
preserve repository-relative coverage data if intentionally versioned.

In @.github/actions/rust-build-release/action.yml:
- Around line 81-84: The inherited RUSTFLAGS check in
.github/actions/rust-build-release/action.yml lines 81-84 must use the Bash
3.2-compatible set-variable form [[ -n ${RUSTFLAGS+x} ]] instead of [[ -v
RUSTFLAGS ]]; update the corresponding assertion in
.github/actions/rust-build-release/tests/test_manifest_input_step.py line 197 to
expect the new guard.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py:
- Around line 55-56: Update the subprocess.run call in the test to pass
check=False explicitly, preserving the existing manual returncode assertion and
command execution behavior.

In @.github/actions/setup-rust/action.yml:
- Around line 44-46: Insert a comma before “so” in the RUSTFLAGS description at
.github/actions/setup-rust/action.yml lines 44-46 and the corresponding README
text at .github/actions/setup-rust/README.md line 23; make no other wording
changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3d36f68c-9f28-483d-abf7-bcb8dd8380d8

📥 Commits

Reviewing files that changed from the base of the PR and between dca6131 and 42e70a8.

📒 Files selected for processing (25)
  • .coverage
  • .github/actions/linux-packages/scripts/package.py
  • .github/actions/release-to-pypi-uv/tests/_helpers.py
  • .github/actions/rust-build-release/CHANGELOG.md
  • .github/actions/rust-build-release/README.md
  • .github/actions/rust-build-release/action.yml
  • .github/actions/rust-build-release/tests/test_manifest_input_step.py
  • .github/actions/setup-rust/CHANGELOG.md
  • .github/actions/setup-rust/README.md
  • .github/actions/setup-rust/action.yml
  • .github/actions/setup-rust/tests/test_setup_rust_manifest.py
  • .rules/python-00.md
  • .rules/python-context-managers.md
  • .rules/python-exception-design-raising-handling-and-logging.md
  • .rules/python-generators.md
  • .rules/python-return.md
  • .rules/python-typing.md
  • docs/cmd-mox-users-guide.md
  • docs/execplans/2-4-5-extend-architecture-enforcement-to-orchestration-code.md
  • docs/execplans/add-mutation-testing-workflows.md
  • docs/execplans/support-cranelift-codegen.md
  • docs/local-validation-of-github-actions-with-act-and-pytest.md
  • docs/python-action-scripts.md
  • docs/scripting-standards.md
  • workflow_scripts/graphql_client.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/polythene (auto-detected)
🛑 Comments failed to post (1)
.coverage (1)

52-53: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Information Disclosure (CWE-200): Exposure of Sensitive Information to an Unauthorized Actor

Remove the machine-specific coverage database from the change.

Line 52-53 records an absolute /home/leynos/.../worktrees/... path, exposing local filesystem metadata and making the generated coverage artefact stale and non-portable. Remove .coverage from the patch, ignore it, and regenerate coverage in CI; retain only repository-relative data if versioning is intentional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.coverage around lines 52 - 53, Remove the machine-specific .coverage
artifact from the change, add .coverage to the repository’s ignore
configuration, and leave coverage generation to CI. Do not retain the absolute
worktree path; only preserve repository-relative coverage data if intentionally
versioned.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (3)
.github/actions/setup-rust/action.yml (1)

41-50: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Missing comma before "so" — still present from prior review.

"leave RUSTFLAGS unset so an inherited value" needs a comma before "so" to join the two clauses correctly.

✏️ Fix
       Value exported as the RUSTFLAGS environment variable by the toolchain
-      setup step. Set to the empty string to leave RUSTFLAGS unset so an
-      inherited value or the project's Cargo configuration
+      setup step. Set to the empty string to leave RUSTFLAGS unset, so an
+      inherited value or the project's Cargo configuration
       (build.rustflags in .cargo/config.toml) applies. A pre-existing
       RUSTFLAGS environment variable always takes precedence over this
       input.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/setup-rust/action.yml around lines 41 - 50, Update the
rustflags description in the action metadata to insert a comma before “so” in
the phrase describing leaving RUSTFLAGS unset, without changing the documented
behavior or other text.
.github/actions/rust-build-release/tests/test_manifest_input_step.py (1)

55-61: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add explicit check=False — still outstanding.

Ruff PLW1510 fires because subprocess.run omits check; the test manually asserts returncode, so make the intent explicit. Flagged in a prior review and still present.

🔧 Fix
     result = subprocess.run(  # noqa: S603,TID251 - exercise the bash fragment.
         [bash, "-c", _export_rustflags_run_script()],
         cwd=tmp_path,
         env=env,
         capture_output=True,
         text=True,
         timeout=30,
+        check=False,
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py around
lines 55 - 61, Update the subprocess.run invocation in the test around
_export_rustflags_run_script to pass check=False explicitly, preserving the
existing manual returncode assertions and all other subprocess options.

Source: Linters/SAST tools

.github/actions/rust-build-release/action.yml (1)

71-105: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

[[ -v RUSTFLAGS ]] still breaks on Bash 3.2 — unresolved from prior review.

Line 81 still uses the Bash-4.2-only -v unary test. macOS ships Bash 3.2 by default, so this guard raises conditional binary operator expected there — matching the CI failures already reported for this action. Swap to the Bash-2.02-compatible parameter-expansion check.

Also worth adding while touching this: the PR's comment history mentions adding coverage for an inherited empty RUSTFLAGS value; no such test is visible in the current test file — verify it landed.

🐛 Proposed fix
-        if [[ -v RUSTFLAGS ]]; then
+        if [[ -n ${RUSTFLAGS+x} ]]; then
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/rust-build-release/action.yml around lines 71 - 105, Replace
the Bash-4.2-only [[ -v RUSTFLAGS ]] guard in the “Export caller RUSTFLAGS” step
with a Bash-2.02-compatible parameter-expansion presence check that
distinguishes an inherited empty value from an unset variable and preserves the
existing early-exit behavior. Also verify the action’s tests include coverage
for inherited empty RUSTFLAGS, adding it if absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coverage:
- Around line 52-53: Remove the committed environment-specific .coverage
artifact containing the embedded /home/leynos workspace path. Keep .coverage
uncommitted and ensure future coverage data uses stable repository-relative
paths when regenerated; do not modify scripts/typos_rollout_check.py.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py:
- Around line 174-253: Add descriptive failure messages to every bare assertion
introduced in the RustFLAGS tests, including test_rustflags_input_declared,
test_export_rustflags_step_wiring, and the subsequent
export/delimiter/inheritance/order tests. Preserve each assertion’s existing
condition while using assert condition, "message" so failures identify the
specific manifest, script, or round-trip expectation that failed.

In @.github/actions/setup-rust/README.md:
- Line 23: Update the rustflags option description in the README table to insert
a comma before “so,” preserving the existing wording and meaning.

In @.github/actions/setup-rust/tests/test_setup_rust_manifest.py:
- Around line 380-401: Add descriptive failure messages to every bare assert in
test_rustflags_input_defaults_to_deny_warnings and
test_install_steps_forward_rustflags, including the required/default checks and
rustflags forwarding check. Preserve the existing assertions and make each
message identify the expected condition and relevant input or step_name.

---

Duplicate comments:
In @.github/actions/rust-build-release/action.yml:
- Around line 71-105: Replace the Bash-4.2-only [[ -v RUSTFLAGS ]] guard in the
“Export caller RUSTFLAGS” step with a Bash-2.02-compatible parameter-expansion
presence check that distinguishes an inherited empty value from an unset
variable and preserves the existing early-exit behavior. Also verify the
action’s tests include coverage for inherited empty RUSTFLAGS, adding it if
absent.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py:
- Around line 55-61: Update the subprocess.run invocation in the test around
_export_rustflags_run_script to pass check=False explicitly, preserving the
existing manual returncode assertions and all other subprocess options.

In @.github/actions/setup-rust/action.yml:
- Around line 41-50: Update the rustflags description in the action metadata to
insert a comma before “so” in the phrase describing leaving RUSTFLAGS unset,
without changing the documented behavior or other text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e8cd6766-c6d2-49d5-9b95-a1d79f4bebf2

📥 Commits

Reviewing files that changed from the base of the PR and between dca6131 and 42e70a8.

📒 Files selected for processing (25)
  • .coverage
  • .github/actions/linux-packages/scripts/package.py
  • .github/actions/release-to-pypi-uv/tests/_helpers.py
  • .github/actions/rust-build-release/CHANGELOG.md
  • .github/actions/rust-build-release/README.md
  • .github/actions/rust-build-release/action.yml
  • .github/actions/rust-build-release/tests/test_manifest_input_step.py
  • .github/actions/setup-rust/CHANGELOG.md
  • .github/actions/setup-rust/README.md
  • .github/actions/setup-rust/action.yml
  • .github/actions/setup-rust/tests/test_setup_rust_manifest.py
  • .rules/python-00.md
  • .rules/python-context-managers.md
  • .rules/python-exception-design-raising-handling-and-logging.md
  • .rules/python-generators.md
  • .rules/python-return.md
  • .rules/python-typing.md
  • docs/cmd-mox-users-guide.md
  • docs/execplans/2-4-5-extend-architecture-enforcement-to-orchestration-code.md
  • docs/execplans/add-mutation-testing-workflows.md
  • docs/execplans/support-cranelift-codegen.md
  • docs/local-validation-of-github-actions-with-act-and-pytest.md
  • docs/python-action-scripts.md
  • docs/scripting-standards.md
  • workflow_scripts/graphql_client.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/polythene (auto-detected)

Comment thread .github/actions/rust-build-release/tests/test_manifest_input_step.py Outdated
Comment thread .github/actions/setup-rust/README.md Outdated
Comment thread .github/actions/setup-rust/tests/test_setup_rust_manifest.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 4

♻️ Duplicate comments (3)
.github/actions/setup-rust/action.yml (1)

41-50: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Missing comma before "so" — still present from prior review.

"leave RUSTFLAGS unset so an inherited value" needs a comma before "so" to join the two clauses correctly.

✏️ Fix
       Value exported as the RUSTFLAGS environment variable by the toolchain
-      setup step. Set to the empty string to leave RUSTFLAGS unset so an
-      inherited value or the project's Cargo configuration
+      setup step. Set to the empty string to leave RUSTFLAGS unset, so an
+      inherited value or the project's Cargo configuration
       (build.rustflags in .cargo/config.toml) applies. A pre-existing
       RUSTFLAGS environment variable always takes precedence over this
       input.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/setup-rust/action.yml around lines 41 - 50, Update the
rustflags description in the action metadata to insert a comma before “so” in
the phrase describing leaving RUSTFLAGS unset, without changing the documented
behavior or other text.
.github/actions/rust-build-release/tests/test_manifest_input_step.py (1)

55-61: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add explicit check=False — still outstanding.

Ruff PLW1510 fires because subprocess.run omits check; the test manually asserts returncode, so make the intent explicit. Flagged in a prior review and still present.

🔧 Fix
     result = subprocess.run(  # noqa: S603,TID251 - exercise the bash fragment.
         [bash, "-c", _export_rustflags_run_script()],
         cwd=tmp_path,
         env=env,
         capture_output=True,
         text=True,
         timeout=30,
+        check=False,
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py around
lines 55 - 61, Update the subprocess.run invocation in the test around
_export_rustflags_run_script to pass check=False explicitly, preserving the
existing manual returncode assertions and all other subprocess options.

Source: Linters/SAST tools

.github/actions/rust-build-release/action.yml (1)

71-105: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

[[ -v RUSTFLAGS ]] still breaks on Bash 3.2 — unresolved from prior review.

Line 81 still uses the Bash-4.2-only -v unary test. macOS ships Bash 3.2 by default, so this guard raises conditional binary operator expected there — matching the CI failures already reported for this action. Swap to the Bash-2.02-compatible parameter-expansion check.

Also worth adding while touching this: the PR's comment history mentions adding coverage for an inherited empty RUSTFLAGS value; no such test is visible in the current test file — verify it landed.

🐛 Proposed fix
-        if [[ -v RUSTFLAGS ]]; then
+        if [[ -n ${RUSTFLAGS+x} ]]; then
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/rust-build-release/action.yml around lines 71 - 105, Replace
the Bash-4.2-only [[ -v RUSTFLAGS ]] guard in the “Export caller RUSTFLAGS” step
with a Bash-2.02-compatible parameter-expansion presence check that
distinguishes an inherited empty value from an unset variable and preserves the
existing early-exit behavior. Also verify the action’s tests include coverage
for inherited empty RUSTFLAGS, adding it if absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coverage:
- Around line 52-53: Remove the committed environment-specific .coverage
artifact containing the embedded /home/leynos workspace path. Keep .coverage
uncommitted and ensure future coverage data uses stable repository-relative
paths when regenerated; do not modify scripts/typos_rollout_check.py.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py:
- Around line 174-253: Add descriptive failure messages to every bare assertion
introduced in the RustFLAGS tests, including test_rustflags_input_declared,
test_export_rustflags_step_wiring, and the subsequent
export/delimiter/inheritance/order tests. Preserve each assertion’s existing
condition while using assert condition, "message" so failures identify the
specific manifest, script, or round-trip expectation that failed.

In @.github/actions/setup-rust/README.md:
- Line 23: Update the rustflags option description in the README table to insert
a comma before “so,” preserving the existing wording and meaning.

In @.github/actions/setup-rust/tests/test_setup_rust_manifest.py:
- Around line 380-401: Add descriptive failure messages to every bare assert in
test_rustflags_input_defaults_to_deny_warnings and
test_install_steps_forward_rustflags, including the required/default checks and
rustflags forwarding check. Preserve the existing assertions and make each
message identify the expected condition and relevant input or step_name.

---

Duplicate comments:
In @.github/actions/rust-build-release/action.yml:
- Around line 71-105: Replace the Bash-4.2-only [[ -v RUSTFLAGS ]] guard in the
“Export caller RUSTFLAGS” step with a Bash-2.02-compatible parameter-expansion
presence check that distinguishes an inherited empty value from an unset
variable and preserves the existing early-exit behavior. Also verify the
action’s tests include coverage for inherited empty RUSTFLAGS, adding it if
absent.

In @.github/actions/rust-build-release/tests/test_manifest_input_step.py:
- Around line 55-61: Update the subprocess.run invocation in the test around
_export_rustflags_run_script to pass check=False explicitly, preserving the
existing manual returncode assertions and all other subprocess options.

In @.github/actions/setup-rust/action.yml:
- Around line 41-50: Update the rustflags description in the action metadata to
insert a comma before “so” in the phrase describing leaving RUSTFLAGS unset,
without changing the documented behavior or other text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e8cd6766-c6d2-49d5-9b95-a1d79f4bebf2

📥 Commits

Reviewing files that changed from the base of the PR and between dca6131 and 42e70a8.

📒 Files selected for processing (25)
  • .coverage
  • .github/actions/linux-packages/scripts/package.py
  • .github/actions/release-to-pypi-uv/tests/_helpers.py
  • .github/actions/rust-build-release/CHANGELOG.md
  • .github/actions/rust-build-release/README.md
  • .github/actions/rust-build-release/action.yml
  • .github/actions/rust-build-release/tests/test_manifest_input_step.py
  • .github/actions/setup-rust/CHANGELOG.md
  • .github/actions/setup-rust/README.md
  • .github/actions/setup-rust/action.yml
  • .github/actions/setup-rust/tests/test_setup_rust_manifest.py
  • .rules/python-00.md
  • .rules/python-context-managers.md
  • .rules/python-exception-design-raising-handling-and-logging.md
  • .rules/python-generators.md
  • .rules/python-return.md
  • .rules/python-typing.md
  • docs/cmd-mox-users-guide.md
  • docs/execplans/2-4-5-extend-architecture-enforcement-to-orchestration-code.md
  • docs/execplans/add-mutation-testing-workflows.md
  • docs/execplans/support-cranelift-codegen.md
  • docs/local-validation-of-github-actions-with-act-and-pytest.md
  • docs/python-action-scripts.md
  • docs/scripting-standards.md
  • workflow_scripts/graphql_client.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/polythene (auto-detected)
🛑 Comments failed to post (1)
.coverage (1)

52-53: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove the environment-specific coverage path.

The database embeds /home/leynos/.../worktrees/.../scripts/typos_rollout_check.py, which leaks local workspace metadata and prevents reliable path matching in other checkouts. Keep .coverage uncommitted, or regenerate it with stable repository-relative paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.coverage around lines 52 - 53, Remove the committed environment-specific
.coverage artifact containing the embedded /home/leynos workspace path. Keep
.coverage uncommitted and ensure future coverage data uses stable
repository-relative paths when regenerated; do not modify
scripts/typos_rollout_check.py.

codescene-access[bot]

This comment was marked as outdated.

leynos and others added 10 commits July 31, 2026 02:13
`actions-rust-lang/setup-rust-toolchain` exports
`RUSTFLAGS="-D warnings"` into the job environment whenever the
variable is unset. Because an ambient `RUSTFLAGS` overrides Cargo's
`build.rustflags` configuration, consumers whose builds require
specific flags in `.cargo/config.toml` (for example netsuke's
`-Zpolonius=next`, see leynos/netsuke#465) find them silently
stripped by the setup step.

- `setup-rust` gains a `rustflags` input forwarded to all three
  nested `setup-rust-toolchain` invocations. The default preserves
  the historical `-D warnings`; the empty string leaves `RUSTFLAGS`
  unset so the project's Cargo configuration applies.
- `rust-build-release` gains a `rustflags` input exported (via a
  GITHUB_ENV heredoc, no template expansion in the script) before its
  internally pinned setup-rust step, whose nested toolchain setup
  only applies its default when `RUSTFLAGS` is unset. A pre-existing
  `RUSTFLAGS` still wins. This avoids bumping the internal
  setup-rust-v1 pin.

Manifest tests cover the new inputs, the forwarding, the export
step's env indirection, and its ordering before toolchain setup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ruff 0.16 formats Python code blocks embedded in Markdown, so CI's unpinned
`uv tool run ruff format --check` now covers the `.rules/` and `docs/` prose.
Apply that formatting and move `None` to the end of the `JsonValue` union so
the newly enforced RUF036 passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`_helpers.py` derived the action's `scripts/` directory from
`GITHUB_ACTION_PATH`, but that variable names whichever action is currently
executing. The Makefile exports it as the repository root, so under `make test`
the helper resolved `SCRIPTS_DIR` to the repository's top-level `scripts/` and
every module load failed with `FileNotFoundError`. In CI the variable points
inside `.github/actions`, where the root conftest re-pins it, which masked the
breakage.

Derive both paths from the helper's own location instead, and declare
`OctalInt._octal_width` so `ty` can resolve the attribute assigned in
`__new__`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A caller-supplied `rustflags` value containing a line equal to the fixed
`__RBR_RUSTFLAGS_EOF__` marker closed the environment-file block early, leaving
the rest of the value to be parsed as further environment-file commands. That
could fail the action with an invalid format or set unintended variables for
the setup and build steps that follow.

Derive the delimiter from 16 random bytes and confirm the value does not
contain it before writing, failing the step if no free delimiter can be found.
Cover the fragment with tests that execute it against an ordinary value, a
value carrying the old marker, and an inherited `RUSTFLAGS`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`_parse_env_file` carried both the line-dispatch loop and the heredoc
collection loop, which CodeScene flagged as a Complex Method (cc = 10). Move
the inner loop and its unterminated-heredoc check into `_parse_heredoc_value`,
which returns the body with the index past the closing delimiter. Behaviour and
the assertion messages are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`.coverage` is a coverage.py SQLite database that `make spelling` rewrites on
every run, and it embeds the absolute path of whichever machine produced it.
Nothing reads the committed copy: the ratchet uses `.coverage-baseline`, and CI
uploads `coverage.xml` from the generate-coverage action.

Untrack it and add it to the ignore list so local gate runs stop dirtying the
working tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`[[ -v NAME ]]` needs bash 4.2, but macOS runners ship bash 3.2 as /bin/bash,
so the export step would fail there for any caller that sets `rustflags`.
Use `[[ -n "${RUSTFLAGS+x}" ]]`, which is portable to bash 3.2 and keeps the
existing semantics: an inherited empty value still counts as set.

Cover that distinction with a test for an inherited empty `RUSTFLAGS`; the
`${VAR:-}` idiom used elsewhere in the repository would have overwritten it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The rustflags assertions compared parsed manifest fragments without saying what
the expectation meant, so a failure reported only the operator. Give each one a
message naming the manifest, script, or round-trip expectation, and pass
`check=False` explicitly when running the shell fragment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add the comma before "so" in the result clause of the setup-rust rustflags
description, in the manifest, the README table, and the changelog entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`test_module_globs_are_deduplicated_module_patterns` asserted that ".py" never
appears in a glob, to catch unstripped suffixes. That is too broad: a directory
segment may itself be named "py", so "src/a/py.py" correctly yields "a.py.*",
and Hypothesis eventually generated exactly that. Compare against the expected
module globs instead, which checks suffix stripping precisely.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
codescene-access[bot]

This comment was marked as outdated.

@lodyai
lodyai Bot force-pushed the add-rustflags-passthrough-inputs branch from 4b6120a to 8d3a70d Compare July 31, 2026 00:19
codescene-access[bot]

This comment was marked as outdated.

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No quality gates enabled for this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants