Skip to content

Declare explicit installer binaries and add workflow contract tests#196

Merged
leynos merged 5 commits intomainfrom
fix-whitaker-package-lints-build-y30990
Apr 12, 2026
Merged

Declare explicit installer binaries and add workflow contract tests#196
leynos merged 5 commits intomainfrom
fix-whitaker-package-lints-build-y30990

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Apr 10, 2026

Summary

  • Align installer packaging binaries with the rolling-release workflow by declaring explicit binary targets and updating tests to validate them.

Changes

  • installer/Cargo.toml
    • Declared explicit binaries to match workflow expectations:
      • whitaker-installer (path = "src/main.rs")
      • whitaker-package-lints (path = "src/bin/package_lints.rs")
      • whitaker-package-installer (path = "src/bin/package_installer_bin.rs")
  • tests/workflows/test_rolling_release_workflow.py
    • Imported package_binary_target_names(package_name) and added
      test_installer_packaging_bins_match_release_workflow_contract to ensure
      packaging bins align with the workflow contract:
      • Verifies whitaker-package-lints and whitaker-package-installer appear in the binary targets for whitaker-installer.
      • Ensures fallback names package_lints and package_installer_bin are not used.
  • tests/workflows/workflow_test_helpers.py
    • Added package_binary_target_names(package_name) to derive explicit Cargo binary target names for a workspace package via cargo metadata.
  • tests/workflows/test_workflow_test_helpers.py
    • New file containing unit tests for cargo-metadata helpers used by workflow tests.
  • docs/developers-guide.md
    • Expanded installer release helper binaries section to document explicit binary targets, why autobins = false is required, and how workflow contract tests validate these targets. Includes worked example and guidance for adding new binaries.
  • installer/tests/behaviour_docs.rs
    • Updated prebuilt-path handling to reflect workspace structure changes (new explicit binary targets and location expectations).

Why

  • Prevents build/test failures caused by mismatches between expected packaging binaries in CI/workflows and the actual Cargo targets declared in the installer crate.
  • Ensures the packaging workflow uses well-defined, workflow-facing binary targets rather than source-derived fallback names.

How to test

  • Run the workflow tests for packaging binaries and metadata resolution:
    • Ensure cargo metadata returns bin targets for the whitaker-installer package that include:
      • whitaker-installer, whitaker-package-lints, whitaker-package-installer.
    • Confirm the tests in tests/workflows/test_rolling_release_workflow.py pass with the new contract.

Additional notes

  • This change is additive and only affects build/packaging metadata and tests; runtime behavior remains unchanged.
  • No user-facing configuration changes.

📎 Task: https://www.devboxer.com/task/ade4b7ad-b1d1-40cb-9141-2e89550f891e

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e2bbb113-1829-45e4-b693-2b9039ba42ae

📥 Commits

Reviewing files that changed from the base of the PR and between 3bbc1a7 and 73aa29a.

📒 Files selected for processing (1)
  • tests/workflows/test_workflow_test_helpers.py

Summary

This pull request aligns the installer package's Cargo binary targets with the rolling-release workflow contract by declaring explicit workflow-facing binaries, centralising cargo metadata helpers, and adding tests and documentation to validate the contract.

Changes

  • installer/Cargo.toml

    • Sets autobins = false and adds explicit [[bin]] targets:
      • whitaker-installer — src/main.rs
      • whitaker-package-lints — src/bin/package_lints.rs
      • whitaker-package-installer — src/bin/package_installer_bin.rs
    • Retains existing whitaker-package-dependency-binary — src/bin/package_dependency_binary.rs
  • tests/workflows/workflow_test_helpers.py

    • Adds a centralised _cargo_metadata() to run and parse cargo metadata --no-deps and a _workspace_package_metadata(package_name) helper.
    • Refactors workspace_package_names() to use the shared helper.
    • Adds package_binary_target_names(package_name: str) -> set[str], which returns explicit binary target names by filtering targets where target["kind"] == ["bin"] (accepting only explicit binary targets).
  • tests/workflows/test_rolling_release_workflow.py

    • Adds test_installer_packaging_bins_match_release_workflow_contract to assert the installer package exposes the expected workflow binaries (whitaker-installer, whitaker-package-lints, whitaker-package-installer, whitaker-package-dependency-binary) and that legacy fallback names (package_lints, package_installer_bin) are not present. The test also explicitly asserts the primary "whitaker-installer" binary is present.
  • tests/workflows/test_workflow_test_helpers.py

    • Adds unit tests covering success and failure modes for _cargo_metadata() and _workspace_package_metadata(), with mocking for subprocess/shutil interactions and checks for error messages and invocation arguments.
  • docs/developers-guide.md

    • Documents the installer release-helper binaries, rationale for autobins = false with explicit [[bin]] stanzas, the contract-validation tests under tests/workflows/, and a worked example for adding new packaging binaries.
  • installer/tests/behaviour_docs.rs

    • Minor tweak to TOML fixture selection used by a documentation test.

Rationale

Prevent CI/workflow build and test failures by ensuring packaging workflows use explicit, workflow-facing Cargo binary targets (rather than source-derived fallback names). The changes are additive and limited to build/packaging metadata, tests and developer documentation; there are no runtime or user-facing behavioural changes.

Design context

This implements the release-workflow contract described in the execplan docs/execplans/4-3-1-release-workflow-for-whitaker-installer.md (Status: COMPLETE) and supports the rolling-release workflow defined there.

Walkthrough

Disable Cargo autobin discovery for the installer crate, declare explicit [[bin]] targets, add cargo-metadata helper functions and unit tests, add a workflow contract test verifying declared installer binaries, and document the installer helper binaries in the developer guide.

Changes

Cohort / File(s) Summary
Cargo configuration
installer/Cargo.toml
Set autobins = false and add explicit [[bin]] entries: whitaker-installer (src/main.rs), whitaker-package-lints (src/bin/package_lints.rs), whitaker-package-installer (src/bin/package_installer_bin.rs); retained whitaker-package-dependency-binary.
Workflow test helpers & unit tests
tests/workflows/workflow_test_helpers.py, tests/workflows/test_workflow_test_helpers.py
Add _cargo_metadata(), _workspace_package_metadata(), and package_binary_target_names(); refactor workspace_package_names() to reuse metadata; add unit tests exercising success and failure paths and mock subprocess/shutil interactions.
Release workflow tests
tests/workflows/test_rolling_release_workflow.py
Add test_installer_packaging_bins_match_release_workflow_contract to assert declared --bin targets (whitaker-installer, whitaker-package-lints, whitaker-package-installer, whitaker-package-dependency-binary) are present and legacy/fallback names are absent.
Docs
docs/developers-guide.md
Document installer release helper binaries, the explicit [[bin]] contract, and guidance to add new packaging helper binaries including example [[bin]] stanza and workflow/test updates.
Behaviour test fixture tweak
installer/tests/behaviour_docs.rs
Tighten TOML fixture selection to search for "/whitaker/lints/" when extracting the pre-built path block.

Sequence Diagram(s)

Possibly related PRs

Suggested reviewers

  • codescene-delta-analysis

Poem

✨ Name the bins, enumerate the chart,
Cargo now lists each scripted part.
Helpers fetch metadata, tests defend,
Contract holds steady from start to end.
🛠️ Release with clarity, build and depart.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Testing ⚠️ Warning New public function package_binary_target_names() lacks unit test coverage for error paths and filtering logic, with only indirect happy-path coverage through contract tests. Add dedicated unit tests for package_binary_target_names() covering error cases and binary-kind filtering logic, and add tests for refactored workspace_package_names() to test_workflow_test_helpers.py.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and directly summarises the main objective: declaring explicit installer binaries and adding workflow contract tests to validate them.
Description check ✅ Passed The description comprehensively relates to the changeset, detailing specific files modified, changes made, rationale, and testing guidance aligned with the implemented changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
User-Facing Documentation ✅ Passed PR modifies build/packaging metadata and testing infrastructure with no user-facing functionality or behaviour changes requiring documentation updates.
Developer Documentation ✅ Passed The pull request thoroughly documents all new or changed internal APIs, architectural boundaries, and build requirements in developers-guide.md with comprehensive docstrings and clear examples.
Module-Level Documentation ✅ Passed All code modules in the pull request include appropriate module-level documentation with comprehensive docstrings explaining purpose and key functions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-whitaker-package-lints-build-y30990

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

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 10, 2026

Reviewer's Guide

Aligns the installer crate’s explicit Cargo binary targets with the rolling-release workflow expectations and adds workflow tests/helpers to assert the packaging binaries match the workflow contract and do not rely on filename-derived fallback names.

Sequence diagram for workflow test validating installer packaging binaries

sequenceDiagram
    actor Pytest
    participant RollingReleaseWorkflowTests as RollingReleaseWorkflowTests
    participant WorkflowTestHelpers as WorkflowTestHelpers
    participant Cargo as CargoCommand
    participant CargoMetadata as CargoMetadata

    Pytest->>RollingReleaseWorkflowTests: test_installer_packaging_bins_match_release_workflow_contract()
    RollingReleaseWorkflowTests->>WorkflowTestHelpers: package_binary_target_names(whitaker_installer)
    WorkflowTestHelpers->>Cargo: run cargo metadata for package whitaker_installer
    Cargo-->>WorkflowTestHelpers: metadata JSON
    WorkflowTestHelpers->>CargoMetadata: load_metadata()
    CargoMetadata-->>WorkflowTestHelpers: bin_targets [names]
    WorkflowTestHelpers-->>RollingReleaseWorkflowTests: list of bin target names

    RollingReleaseWorkflowTests->>RollingReleaseWorkflowTests: assert whitaker_package_lints in bin target names
    RollingReleaseWorkflowTests->>RollingReleaseWorkflowTests: assert whitaker_package_installer in bin target names
    RollingReleaseWorkflowTests->>RollingReleaseWorkflowTests: assert package_lints not in bin target names
    RollingReleaseWorkflowTests->>RollingReleaseWorkflowTests: assert package_installer_bin not in bin target names
    RollingReleaseWorkflowTests-->>Pytest: test result
Loading

Class diagram for installer crate binaries and workflow tests

classDiagram
    class InstallerCrate {
        +string name
        +bool autobins
        +list~BinTarget~ bin_targets
    }

    class BinTarget {
        +string name
        +string path
    }

    class CargoToml {
        +string path
        +InstallerCrate installer_crate
        +void load()
        +void save()
    }

    class CargoMetadata {
        +string package_name
        +list~BinTarget~ bin_targets
        +void load_metadata()
    }

    class WorkflowTestHelpers {
        +list~string~ package_binary_target_names(package_name)
    }

    class RollingReleaseWorkflowTests {
        +void test_installer_packaging_bins_match_release_workflow_contract()
    }

    InstallerCrate "1" o-- "many" BinTarget : declares
    CargoToml "1" o-- "1" InstallerCrate : configures
    CargoMetadata "1" o-- "many" BinTarget : describes
    WorkflowTestHelpers ..> CargoMetadata : uses
    RollingReleaseWorkflowTests ..> WorkflowTestHelpers : calls

    InstallerCrate : +BinTarget whitaker_installer
    InstallerCrate : +BinTarget whitaker_package_lints
    InstallerCrate : +BinTarget whitaker_package_installer

    BinTarget : +string whitaker_installer
    BinTarget : +string whitaker_package_lints
    BinTarget : +string whitaker_package_installer
Loading

Flow diagram for validating Cargo binary targets for whitaker installer

flowchart TD
    A[Start validation for package whitaker_installer] --> B[Run cargo metadata for package whitaker_installer]
    B --> C[Extract bin targets from metadata]
    C --> D{Do bin targets include
whitaker_installer,
whitaker_package_lints,
whitaker_package_installer?}
    D -- No --> E[Fail: expected workflow-facing binaries missing]
    D -- Yes --> F{Do bin targets include
fallback names
package_lints or
package_installer_bin?}
    F -- Yes --> G[Fail: fallback filename-derived binaries still present]
    F -- No --> H[Pass: installer packaging binaries match workflow contract]
    E --> I[End]
    G --> I[End]
    H --> I[End]
Loading

File-Level Changes

Change Details Files
Declare explicit installer packaging binaries in Cargo.toml and disable automatic binary discovery to align with workflow expectations.
  • Disable Cargo’s automatic binary discovery via autobins = false in the installer crate manifest.
  • Declare an explicit whitaker-installer bin target pointing at src/main.rs.
  • Declare explicit whitaker-package-lints and whitaker-package-installer bin targets pointing at their respective helper binaries.
  • Preserve existing additional bin whitaker-package-dependency-binary configuration.
installer/Cargo.toml
Add a helper to resolve binary target names for a workspace package using cargo metadata.
  • Introduce package_binary_target_names(package_name) to run cargo metadata --no-deps rooted at the repo and parse output.
  • Assert the cargo metadata invocation succeeds and provide diagnostic stderr on failure.
  • Locate the requested package in metadata by name and assert that it exists.
  • Return a set of target names filtered to those whose kind includes bin.
tests/workflows/workflow_test_helpers.py
Enforce via workflow tests that installer packaging binaries match the rolling-release workflow contract and do not use fallback bin names.
  • Import package_binary_target_names into the rolling release workflow tests.
  • Add test_installer_packaging_bins_match_release_workflow_contract to fetch bin targets for whitaker-installer.
  • Assert that whitaker-package-lints and whitaker-package-installer are present as bin targets for the installer package.
  • Assert that fallback names package_lints and package_installer_bin are absent, ensuring only workflow-facing bin names are used.
tests/workflows/test_rolling_release_workflow.py

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-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos marked this pull request as ready for review April 10, 2026 01:59
sourcery-ai[bot]

This comment was marked as resolved.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 10, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

✅ Actions performed

Review triggered.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/workflows/test_rolling_release_workflow.py`:
- Around line 69-93: The test
test_installer_packaging_bins_match_release_workflow_contract is missing an
assertion for the dependency packaging binary used by the workflows; update that
test (which calls package_binary_target_names("whitaker-installer")) to include
assert "whitaker-package-dependency-binary" in binary_targets with a clear
failure message (e.g., stating that release and rolling-release workflows build
--bin whitaker-package-dependency-binary but the installer package does not
declare it) so the test covers both release and rolling-release workflow
contracts.

In `@tests/workflows/workflow_test_helpers.py`:
- Around line 46-53: The docstring on the private helper function
_cargo_metadata is currently multi-line with a Returns section; replace it with
a single-line summary docstring: change the block docstring for _cargo_metadata
to a one-line string describing its purpose (e.g., "Return parsed workspace
metadata from `cargo metadata --no-deps`.") so the function follows the
private-function docstring guideline and numpy style expectations.
- Around line 54-55: The test helper _cargo_metadata currently calls "cargo" by
name and suppresses S607; resolve the cargo executable with
shutil.which("cargo"), assert it's found (e.g., assert cargo_executable is not
None), remove the S607 noqa, and pass the resolved cargo_executable into
subprocess.run (replacing ["cargo", ...] with [cargo_executable, ...]) while
keeping the existing cwd, capture_output, text, timeout, and check settings.
🪄 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

Run ID: f029fb6e-c470-4c03-8942-4f6083ec47b4

📥 Commits

Reviewing files that changed from the base of the PR and between d96a169 and 2cd3982.

📒 Files selected for processing (3)
  • installer/Cargo.toml
  • tests/workflows/test_rolling_release_workflow.py
  • tests/workflows/workflow_test_helpers.py

codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 11, 2026

@coderabbitai Have the following now been resolved?

Annul any requirements that violate the en-GB-oxendict spelling (-ize / -yse / -our) conventions (for example a request to replace "normalize" with "normalise" or "artefact" with "artifact"), or where the requirement unnecessarily increases cyclomatic complexity.

Please address the comments from this code review:

## Overall Comments
- The new `package_binary_target_names` helper duplicates the `cargo metadata` invocation logic from `workspace_package_names`; consider factoring out a shared internal function to run and parse `cargo metadata` so the subprocess handling and error reporting stay consistent and easier to maintain.
- In `package_binary_target_names`, you filter targets with `if "bin" in target["kind"]`; tightening this to explicitly check for binary kinds (e.g. `== ["bin"]` or membership in a set of allowed kinds) would make the helper more robust against other target kinds appearing in the metadata.

## Individual Comments

### Comment 1
<location path="tests/workflows/test_rolling_release_workflow.py" line_range="73" />
<code_context>
+def test_installer_packaging_bins_match_release_workflow_contract() -> None:
</code_context>
<issue_to_address>
**suggestion (testing):** Also assert the main `whitaker-installer` binary target is present to fully validate the contract

This test only asserts the two helper binaries and the absence of the fallback names, but never verifies that the primary `whitaker-installer` target is present in `binary_targets`. Please add an assertion such as `assert "whitaker-installer" in binary_targets` so the test fully enforces the contract described in the PR and catches regressions where the main binary is renamed or removed.

```suggestion
    assert "whitaker-installer" in binary_targets, (
        "installer package must expose primary whitaker-installer binary target "
        "to satisfy release workflow contract"
    )
    assert "whitaker-package-lints" in binary_targets, (
```
</issue_to_address>

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
cat tests/workflows/workflow_test_helpers.py
echo "---FILE SEPARATOR---"
cat tests/workflows/test_rolling_release_workflow.py

Length of output: 24628


@leynos: Yes, all three points are resolved. Here is the status of each:

Overall Comment 1 — shared _cargo_metadata() helper
Resolved. A private _cargo_metadata() function now centralises the cargo metadata --no-deps subprocess invocation and JSON parsing. Both workspace_package_names() and package_binary_target_names() (via the intermediate _workspace_package_metadata()) delegate to it.

Overall Comment 2 — exact equality check for binary kind
Resolved. The filter in package_binary_target_names now reads:

target.get("kind") == ["bin"]

This correctly rejects any target whose kind list contains additional entries or whose sole entry is not "bin".

Individual Comment 1 — assert whitaker-installer is present
Resolved. The test now opens with:

assert "whitaker-installer" in binary_targets, (
    "installer package must expose primary whitaker-installer binary target "
    "to satisfy release workflow contract"
)

—before asserting the two packaging helpers and the two negative cases.

None of the three requirements warranted annulment: no en-GB-oxendict spelling conflicts are present (the code already uses "artefact"), and none of the changes increase cyclomatic complexity.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

✅ Actions performed

Review triggered.

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.

leynos and others added 3 commits April 11, 2026 16:05
- Added package_binary_target_names helper to query Cargo bin targets
- Added test_installer_packaging_bins_match_release_workflow_contract to ensure
  workflow build targets match installer Cargo.toml declared bins
- Updated installer/Cargo.toml to declare specific binary targets

This ensures the CI workflow's built binaries align with Cargo package declarations.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
…r test

Refactor multiple test helper functions to create dedicated helpers for
accessing cargo metadata and package-specific metadata, reducing duplication
and improving clarity in test code.

Add an assertion in test_rolling_release_workflow ensuring the
'whitaker-installer' binary target is present, enforcing release workflow contract.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
…h assertion

- Added assertion for 'whitaker-package-dependency-binary' in rolling release workflow test to ensure installer package declares this binary.
- Updated _cargo_metadata helper to resolve 'cargo' executable path explicitly and assert presence, improving test reliability.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos force-pushed the fix-whitaker-package-lints-build-y30990 branch from df6ba77 to 2ddb956 Compare April 11, 2026 15:05
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

✅ Actions performed

Review triggered.

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 added the Roadmap label Apr 11, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/workflows/workflow_test_helpers.py`:
- Around line 51-52: Update the inline suppression on the subprocess.run call
(the `completed = subprocess.run(...)` line) to replace the free-form `# noqa:
S603  # FIXME: uses trusted test-only tool` with a repository-compliant `# noqa:
S603  # FIXME: <TICKET-URL or ID> - uses trusted test-only tool`, i.e., add a
real ticket link or ID after `FIXME:` so the narrow disable includes a
justification plus a traceable ticket reference.
🪄 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

Run ID: f325dfab-c2c5-4bb8-ae86-a631cf2bc971

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd3982 and 2ddb956.

📒 Files selected for processing (3)
  • installer/Cargo.toml
  • tests/workflows/test_rolling_release_workflow.py
  • tests/workflows/workflow_test_helpers.py

* docs(installer,workflows): add detailed docs and tests for installer binaries workflow contract

- Add extensive documentation in developers-guide.md on installer release-helper binaries, explaining explicit binary target declarations.
- Introduce Python unit tests for workflow test helpers validating Cargo metadata resolution and workflow contract adherence.
- Update small rust test and add comments to clarify maintainer guidance for adding installer packaging binaries.
- Add no functional changes, focus on improving maintainability and preventing workflow breakage through testing and documentation.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>

* test(workflows): parametrize tests for workspace package metadata helper

- Combined two separate tests into one parametrized test to check invalid metadata.
- Added test cases for non-list packages and missing workspace package.
- Improved test readability and reduced code duplication.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>

* refactor(tests): update test helpers to use patch.object and enhance mocks

- Replace patch() with patch.object() for mocking shutil.which and subprocess.run
- Simplify TOML metadata test to use more general path matching
- Improve workspace package metadata tests for better error handling
- Streamline patch context usage and reduce nested with statements
- Enhance test reliability and maintainability by refining mocks and asserts

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>

---------

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 11, 2026

@coderabbitai Have the following now been resolved?

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Testing ⚠️ Warning New functionality lacks adequate unit test coverage for private helper functions and contains non-compliant FIXME comment missing required ticket link. Add dedicated unit tests for _cargo_metadata() and _workspace_package_metadata() covering error paths and edge cases. Update FIXME at line 51 to include ticket link per repository policy.
Developer Documentation ⚠️ Warning Pull request introduces new internal APIs and build requirements without documentation in docs/developers-guide.md, creating maintenance burden for future developers. Document new APIs and build requirements in docs/developers-guide.md with subsections explaining autobins configuration, validation purpose, and worked examples for binary target additions.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== workflow_test_helpers.py ==="
cat tests/workflows/workflow_test_helpers.py

echo ""
echo "=== test_rolling_release_workflow.py ==="
cat tests/workflows/test_rolling_release_workflow.py

echo ""
echo "=== docs/developers-guide.md (if it exists) ==="
fd -i "developers-guide" --type f | xargs cat 2>/dev/null || echo "FILE NOT FOUND"

echo ""
echo "=== Any test files for workflow_test_helpers ==="
fd -i "test_workflow_test_helpers" --type f | xargs cat 2>/dev/null || echo "NO DEDICATED TEST FILE FOUND"

echo ""
echo "=== Search for FIXME in workflow_test_helpers.py ==="
rg -n "FIXME" tests/workflows/workflow_test_helpers.py || echo "NO FIXME FOUND"

Length of output: 59549


@leynos: Yes, both warnings are now resolved.

Testing ⚠️ — Resolved

A dedicated test file tests/workflows/test_workflow_test_helpers.py exists with two test classes:

  • TestCargoMetadata covers: cargo absent from PATH, subprocess non-zero exit (with stderr surfaced), non-mapping JSON output (parametrised for list and string shapes), and a successful call that also asserts the exact subprocess.run invocation.
  • TestWorkspacePackageMetadata covers: non-list packages value, a missing package name, and malformed/non-dict entries being skipped before the matching package is returned.

All three FIXME comments in workflow_test_helpers.py (lines 51, 338, and 362) carry the required ticket link: https://github.com/leynos/whitaker/issues/101.

Developer Documentation ⚠️ — Resolved

docs/developers-guide.md now contains a dedicated "Installer release helper binaries" section with:

  • An explanation of why autobins = false is required and what fallback names it prevents.
  • A full enumeration of all four current explicit [[bin]] targets.
  • A description of which tests enforce the contract and what they assert.
  • A worked example showing the exact steps and Cargo.toml stanza for adding a new packaging binary, including guidance to extend the contract test before relying on the new target in release automation.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/workflows/test_workflow_test_helpers.py`:
- Line 89: Replace bare asserts that compare types with message-bearing
assertions in tests/workflows/test_workflow_test_helpers.py: for the assertion
using type(parsed).__name__ == expected_type_name, change it to include an
explanatory message (e.g., assert type(parsed).__name__ == expected_type_name,
f"parsed type {type(parsed).__name__} != expected {expected_type_name}"). Do the
same for the other bare asserts referenced (the ones comparing parsed/expected
values at the other locations), ensuring each assert uses the involved variable
names (parsed, expected_type_name, etc.) in the message so CI failures are
diagnostic.
- Line 140: Update the parameter type annotation on the test helper signature
that currently reads "self, return_value: dict, expected_match: str" to use a
precise modern-style mapping type: change "return_value: dict" to "return_value:
dict[str, object]"; keep the parameter name and the rest of the signature
unchanged so the test contract remains explicit.
🪄 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

Run ID: 58151fed-1f5b-4259-ab3d-f0e53350f80f

📥 Commits

Reviewing files that changed from the base of the PR and between 2ddb956 and 3bbc1a7.

📒 Files selected for processing (4)
  • docs/developers-guide.md
  • installer/tests/behaviour_docs.rs
  • tests/workflows/test_workflow_test_helpers.py
  • tests/workflows/workflow_test_helpers.py

…pers

Enhanced assertions in tests/workflows/test_workflow_test_helpers.py by adding informative failure messages to aid debugging when test assertions fail.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@leynos leynos changed the title Align installer packaging binaries with workflow for whitaker lints Declare explicit installer binaries and add workflow contract tests Apr 11, 2026
@leynos leynos merged commit 157704b into main Apr 12, 2026
5 checks passed
@leynos leynos deleted the fix-whitaker-package-lints-build-y30990 branch April 12, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant