Skip to content

Skip templated dependency audit on Dependabot PRs - #50

Merged
leynos merged 20 commits into
mainfrom
fix/skip-audit-for-dependabot
Jul 24, 2026
Merged

Skip templated dependency audit on Dependabot PRs#50
leynos merged 20 commits into
mainfrom
fix/skip-audit-for-dependabot

Conversation

@leynos

@leynos leynos commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Conditions the templated CI's make audit step — and its audit-only prerequisites (cargo-audit install and the Python setup for manifest extraction) — on github.actor != 'dependabot[bot]'.
  • Adds a templated weekly scheduled audit workflow (audit.yml) as the compensating control, reusing the template's existing pinned action refs.

Motivation

make audit reports advisories against the whole lockfile, so in generated projects a newly published advisory fails every open Dependabot PR regardless of its content, deadlocking Dependabot auto-merge (observed on leynos/corbusier#120, where even Dependabot's own fix for a vite advisory was blocked by unrelated advisories). The same change has been applied directly to the twelve existing estate repositories with make audit gates; this PR brings the template in line so newly generated projects inherit it. Human pull requests keep the full audit gate.

Test plan

  • actionlint clean on both templated workflow files
  • act-validation template render passes in CI

References

@sourcery-ai sourcery-ai 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.

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

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

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

  • Skip audit-only CI setup and make audit for Dependabot pull requests, while retaining the audit gate for human pull requests.
  • Add a weekly, manually triggerable scheduled audit workflow with read-only permissions, pinned actions, secure checkout, and a 30-minute timeout.
  • Add workflow contracts, snapshots, property-based tests, and regression coverage for audit workflow structure, action pinning, checkout security, and Dependabot guards.
  • Update Makefile tooling targets and centralise test dependencies.
  • Document Dependabot audit behaviour and scheduled audit coverage in the developer and user guides.

Walkthrough

Add a scheduled and manually triggered dependency audit, skip audit-only CI steps for Dependabot, add Makefile quality gates, update documentation and snapshots, and extend generated-template contract tests.

Changes

Audit and tooling integration

Layer / File(s) Summary
Add scheduled audit and CI conditions
template/.github/workflows/audit.yml, template/.github/workflows/ci.yml.jinja, template/docs/*.jinja, docs/*.md, tests/test_template/__snapshots__/*
Add weekly/manual auditing, actor-based CI conditions, documentation, and rendered workflow snapshots with stable SHA placeholders.
Add Makefile quality gates
Makefile, tests/test_helpers.py, template/docs/users-guide.md.jinja
Add formatting, linting, type-checking, and shared pytest dependency targets with contract coverage.
Validate generated workflow contracts
tests/helpers/tooling_contracts/*.py, tests/test_helpers.py, tests/test_template/test_snapshots.py, tests/test_template/test_tooling_contracts.py
Validate the audit workflow, pinned action shape, Dependabot guards, snapshot redaction, and orchestration inputs.
Refresh test helper typing and formatting
tests/helpers/*, tests/test_template/test_audit_targets.py, tests/test_template/test_compilation.py, tests/utilities.py
Update parser typing, socket annotations, assertions, and documentation-only package initialisation.

Sequence Diagram(s)

sequenceDiagram
  participant Trigger
  participant CIWorkflow
  participant AuditWorkflow
  participant CargoAudit
  participant Makefile
  Trigger->>CIWorkflow: Start pull-request CI
  CIWorkflow->>CargoAudit: Install audit tooling for non-Dependabot actors
  CIWorkflow->>Makefile: Run make audit for non-Dependabot actors
  Trigger->>AuditWorkflow: Start weekly or manual audit
  AuditWorkflow->>CargoAudit: Install cargo-audit
  AuditWorkflow->>Makefile: Run make audit
Loading

Possibly related issues

Possibly related PRs

Poem

Schedule the audit, let Monday bells ring,
Guard every workflow and quality gate string.
Dependabot skips the audit flight,
Human changes meet the audit light.
Format, lint, and type-check right.

🚥 Pre-merge checks | ✅ 20
✅ Passed checks (20 passed)
Check name Status Explanation
Title check ✅ Passed Match the main change by skipping templated dependency audit on Dependabot PRs.
Description check ✅ Passed Match the change by describing the Dependabot audit skip and weekly compensating workflow.
Docstring Coverage ✅ Passed Docstring coverage is 97.87% 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.
Testing (Overall) ✅ Passed Accept: the new contract, property, snapshot, and regression tests exercise the Dependabot audit skip and scheduled audit workflow robustly.
User-Facing Documentation ✅ Passed docs/users-guide.md lists the new Makefile targets and explains the Dependabot audit skip plus weekly/manual audit workflow, so the user-facing changes are documented.
Developer Documentation ✅ Passed docs/developers-guide.md and its template mirror document the Dependabot audit skip, weekly compensating workflow, tooling targets, and workflow-pin policy; no locale or execplan gaps found.
Module-Level Documentation ✅ Passed PASS — every touched Python module has a top-level docstring, and the new/edited ones describe purpose and relationships to helpers, contracts, and tests.
Testing (Unit And Behavioural) ✅ Passed PASS: Added rendered-project contract and snapshot tests for the new audit workflow, plus property-based unit tests for helper invariants and a regression for an unguarded audit step.
Testing (Property / Proof) ✅ Passed Hypothesis tests exercise the new invariants (_is_pinned_action, _step_mappings, credential persistence, SHA redaction) and a regression test covers the CI audit guard.
Testing (Compile-Time / Ui) ✅ Passed Pass: generated Rust projects have a cargo-check compile test, and the structured snapshot suite uses redaction plus semantic workflow contracts for the new audit.yml.
Unit Architecture ✅ Passed New Makefile targets and helper tests stay narrow, explicit, and read-only; no hidden side-effects or ambiguous dependencies were introduced.
Domain Architecture ✅ Passed Only Makefile and tests/test_helpers changed; no domain model or boundary code was touched, so domain segregation is unaffected.
Observability ✅ Passed PASS: Confine this PR to CI/workflow templates and tests; no production behaviour, metrics, tracing, or alerting surface is changed.
Security And Privacy ✅ Passed PASS: The audit workflow is least-privilege (contents: read), pins actions, disables checkout credentials, and adds no secrets or sensitive data.
Performance And Resource Use ✅ Passed New traversals are bounded: workflow scans touch small step lists, Hypothesis data has max_size/max_leaves caps, and the scheduled audit job is weekly with a 30-minute timeout.
Concurrency And State ✅ Passed Only Makefile and pure test helpers changed; no async, locking, shared mutable state, or background tasks were introduced.
Architectural Complexity And Maintainability ✅ Passed Pass: the new helpers stay local to tests, replace repeated workflow assertions, and the orchestration remains explicit with no new indirection or dependencies.
Rust Compiler Lint Integrity ✅ Passed No Rust source files changed in the PR diff, so no new lint suppressions or clone churn were introduced.
✨ 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/skip-audit-for-dependabot

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

@leynos
leynos marked this pull request as ready for review July 3, 2026 08:26

@sourcery-ai sourcery-ai 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.

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

Please try again later or upgrade to continue using Sourcery

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@template/.github/workflows/audit.yml`:
- Around line 16-36: The audit workflow job is missing an explicit execution
bound, so add a timeout guard to the `audit` job itself in the GitHub Actions
workflow. Update the `jobs.audit` definition to include a `timeout-minutes`
limit so the unattended `cargo binstall` and `make audit` steps cannot hang
until the default runner timeout. Locate the change in the `audit` job block by
its `jobs.audit` key and keep the rest of the steps unchanged.
🪄 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: 48eb5045-df77-432b-961d-b3ab6bd9192f

📥 Commits

Reviewing files that changed from the base of the PR and between 39e904a and 7361565.

📒 Files selected for processing (3)
  • template/.github/workflows/audit.yml
  • template/.github/workflows/ci.yml
  • tests/test_template/__snapshots__/test_snapshots.ambr

Comment thread template/.github/workflows/audit.yml
@leynos

leynos commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@lodyai
lodyai Bot force-pushed the fix/skip-audit-for-dependabot branch from 1ccfb25 to a111b8e Compare July 19, 2026 17:42
@leynos

leynos commented Jul 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat documentation and validation coverage as in scope).

❌ Failed checks (1 error, 4 warnings)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error CI gating is snapshot-covered, but the new scheduled audit workflow has no test oracle and could be removed without a test failure. Add a contract/snapshot test that renders and asserts .github/workflows/audit.yml, including its schedule and audit steps, so removal or drift fails.
User-Facing Documentation ⚠️ Warning New CI behaviour is undocumented: neither users guide mentions the Dependabot audit skip or the compensating weekly audit workflow. Add a users-guide note for the templated CI change: explain the Dependabot skip, the scheduled audit workflow, and why the gate now behaves differently.
Developer Documentation ⚠️ Warning The CI audit split and new weekly audit workflow are only in workflow files; docs/developers-guide.md and any ADR/execplan were not updated. Document the Dependabot audit skip and weekly audit.yml control in the developer guide, or record the decision in an ADR/execplan.
Testing (Unit And Behavioural) ⚠️ Warning Snapshot and helper tests cover ci.yml and the Makefile audit target, but the new scheduled audit workflow is untested and no end-to-end boundary checks cover it. Add a template test that asserts audit.yml renders with the scheduled/manual triggers and pinned steps, and extend workflow-level coverage for the Dependabot skip boundary.
Performance And Resource Use ⚠️ Warning audit.yml adds an unattended networked job but no timeout-minutes, leaving cargo binstall/make audit unbounded. Add a bounded job timeout (for example timeout-minutes: 15) to the scheduled audit job, and keep the Dependabot gating in CI.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== PR metadata and changed files ==='
gh pr view 50 --repo leynos/agent-template-rust --json number,headRefName,baseRefName,commits,files \
  --jq '{number, headRefName, baseRefName, commits: [.commits[].oid], files: [.files[].path]}'

echo
echo '=== Relevant repository paths ==='
fd -t f -a . | rg '(^|/)(audit\.yml|ci\.yml|test_.*template|.*snapshot.*|users-guide.*|developers-guide.*|.*adr.*|.*execplan.*)$' || true

echo
echo '=== Workflow outlines ==='
for f in template/.github/workflows/ci.yml template/.github/workflows/audit.yml; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    nl -ba "$f"
  fi
done

echo
echo '=== Template test/snapshot references to workflow rendering and audit workflow ==='
rg -n -i -C 4 \
  'audit\.yml|ci\.yml|workflow|dependabot\[bot\]|cargo-audit|make audit|schedule|workflow_dispatch' \
  tests template docs README.md 2>/dev/null || true

echo
echo '=== Candidate documentation excerpts ==='
for f in $(fd -t f -a . docs | rg '(users-guide|developers-guide|adr|execplan)'); do
  echo "--- $f ---"
  rg -n -i -C 3 'dependabot|audit|workflow|security|ci' "$f" || true
done

echo
echo '=== Existing related GitHub issues ==='
gh issue list --repo leynos/agent-template-rust --state all --limit 100 \
  --search 'Dependabot audit workflow scheduled timeout documentation snapshot' \
  --json number,title,state,url \
  --jq '.[] | "\(.state) #\(.number) \(.title) \(.url)"' || true

Length of output: 3531


The first inspection confirms that the PR now includes workflow, documentation, helper, behavioural-test, and snapshot changes, but the sandbox lacked nl and stopped before reading them. I’m rerunning the targeted checks portably.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ 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[bot]

This comment was marked as resolved.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ 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[bot]

This comment was marked as resolved.

@leynos

leynos commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@buzzybee-df12
buzzybee-df12 force-pushed the fix/skip-audit-for-dependabot branch from 3c1793b to 674c4df Compare July 21, 2026 11:47
coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@tests/helpers/tooling_contracts/workflows.py`:
- Around line 31-37: Reduce the _is_pinned_action docstring in
tests/helpers/tooling_contracts/workflows.py:31-37 to a concise single-line
summary, removing the extended rationale. Also reduce the _redact_pinned_shas
docstring in tests/test_template/test_snapshots.py:20-27 to one concise summary
line, preserving only its purpose.
🪄 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: 3705d3dc-64b0-4e3f-9626-100499bdc26f

📥 Commits

Reviewing files that changed from the base of the PR and between 674c4df and 4162b52.

📒 Files selected for processing (3)
  • tests/helpers/tooling_contracts/workflows.py
  • tests/test_template/__snapshots__/test_snapshots.ambr
  • tests/test_template/test_snapshots.py
🔗 Linked repositories identified

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

  • leynos/whitaker (auto-detected)

Comment thread tests/helpers/tooling_contracts/workflows.py Outdated
@leynos

leynos commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

leynos and others added 19 commits July 24, 2026 03:45
`make audit` reports advisories against the whole lockfile, so in
generated projects a newly published advisory fails every open
Dependabot PR regardless of its content and deadlocks auto-merge.
Condition the audit step and its audit-only prerequisites (cargo-audit
install and the Python setup for manifest extraction) on the actor not
being Dependabot, and add a templated weekly scheduled audit workflow
as the compensating control so anything that slips through surfaces
within days. Human pull requests keep the full audit gate.
The rendered ci.yml snapshot now includes the Dependabot conditions on
the audit steps.
Add an explicit timeout to the generated scheduled audit workflow so
unattended audit runs cannot hang until the GitHub runner default.

Expose parent repository format, lint, and typecheck Makefile gates so the
review-requested checks run as first-class commands. Keep those gates green by
formatting the existing Python tests and tightening the small helper typing
issues they surfaced.
Apply review feedback on the Dependabot audit-skip change:

- makefile.py: use the repository's string-annotation cast form
  (`cast("str", ...)`) for the regex match group and drop the
  constant-name `getattr` in the lazy make-parser import in favour of
  direct `.make_load` attribute access.
- workflows.py: extend the scheduled audit workflow contract to require
  least-privilege `contents: read` permissions and a checkout step that
  disables credential persistence.
- test_helpers.py: replace the untyped recursive JSON strategy lambda
  with a typed `_json_collections` helper, and add a failure message to
  the resolved-socket assertion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Break the compound `assert checkout_steps and all(...)` in the scheduled
audit workflow contract into two assertions: a presence check for the
checkout step and the existing credential-persistence check. This
satisfies Ruff PT018 while preserving both validations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make the audit workflow tests resilient to Dependabot SHA bumps and
tighten the audit contract:

- test_snapshots.py: normalize every 40-hex SHA-pinned `uses:` ref to a
  `@<sha>` placeholder before snapshot comparison, so routine dependency
  bumps no longer break the structured-file snapshot. Regenerate the
  affected snapshot.
- workflows.py: match the audit workflow's checkout and setup-python
  steps by full 40-hex SHA pattern rather than exact SHA value, mirroring
  the existing setup-rust check, and require the audit workflow triggers
  to be exactly {schedule, workflow_dispatch} and its permissions to be
  exactly {contents: read}.

The contract helpers still validate pinning by full 40-hex SHA on the raw
rendered text, so immutability is enforced without lockstep failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Reduce the _is_pinned_action and _redact_pinned_shas docstrings to
  concise single-line summaries, dropping the extended rationale.
- Document the public `make fmt` and `make typecheck` targets in both the
  parent and templated users guides, alongside the other public targets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the isinstance-based dict/list traversal guards in the workflow
and snapshot test helpers with structural pattern matching via small
typed helpers, preserving mapping and sequence semantics:

- test_snapshots.py: _redact_pinned_shas now matches dict/list/other and
  delegates per-entry redaction to a typed _redact_mapping_entry helper.
- workflows.py: add _step_mappings (match-based dict filter) and
  _disables_credential_persistence (match-based with-block check), and
  route the audit-workflow step filters through them, dropping the
  per-comprehension isinstance guards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a FIXME on _redact_pinned_shas referencing issue #72, which proposes
replacing the hand-rolled traversal with a syrupy `matcher=` as part of
the planned snapshot-testing overhaul (once AST-aware Markdown snapshots
are ready). Behaviour is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The prior inverse filter collected steps that already had the Dependabot
guard and compared their names, which proved the three audit steps were
guarded but accepted an additional unguarded "Setup Python for audit
manifest extraction" or "Audit dependencies" step, letting audit work run
on Dependabot PRs.

Filter by the three audit step names first, assert their expected order,
then require every selected step to carry the Dependabot guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the guard-first audit-step assertion with a name-first check that
collects every step matching the three audit step names as
(name, if) tuples and asserts the ordered result exactly equals the three
expected (name, guard) pairs. This fails if an audit step is duplicated
without the guard, duplicated with a different guard, omitted, reordered,
or left unguarded.

Add a focused regression test that renders a valid CI workflow, appends an
unguarded duplicate "Audit dependencies" step to build-test.steps, and
asserts the contract raises AssertionError.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The audit workflow checkout contract filtered checkout steps by
_is_pinned_action before checking credential persistence, so an
additional unpinned actions/checkout@<branch> step could persist
credentials while the required pinned checkout still satisfied the
contract.

Collect every actions/checkout@ step, require exactly one, then assert
full-SHA pinning and disabled credential persistence for it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove the None: checkout_path entry from expected_steps. The dedicated
checkout checks already require exactly one full-SHA-pinned checkout with
disabled credential persistence regardless of name, so the unnamed
constraint was redundant and would reject a compliant
`name: Checkout source` step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address the developer-documentation and property-coverage review
warnings.

Docs:
- docs/developers-guide.md: document the parent make check-fmt/fmt/lint/
  typecheck gates and their Ruff/mypy backing.
- template/docs/developers-guide.md.jinja: document the generated
  project's make check-fmt/fmt/typecheck targets (rustfmt, mdformat, and
  cargo check).

Property tests (Hypothesis):
- test_helpers.py: pinned-SHA invariant for _is_pinned_action (accepts a
  full 40-hex SHA for the exact path; rejects short/long/uppercased/branch
  refs), the step-sequence invariant for _step_mappings (keeps only
  mappings, in order), and the credential-persistence predicate spec.
- test_snapshots.py: _redact_pinned_shas strips every pinned SHA, is
  idempotent, preserves structure shape, and keeps the action path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add descriptive failure messages to the workflow-helper and snapshot
  redaction property assertions (exact/mismatched pin, non-SHA rejection,
  mapping-only ordering, credential verdict, pinned-SHA removal,
  idempotency, shape preservation, and path-preserving redaction).
- Replace the isinstance branching in _iter_uses_values and _same_shape
  with structural match statements, preserving recursion into non-uses
  mapping entries and the key, length, container-type, and leaf-type
  comparisons.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the anonymous strategy lambdas with named, privately scoped,
typed helper factories, preserving the generated values:

- test_snapshots.py: _pinned_uses_ref, _unpinned_uses_ref, and the
  recursive _workflow_children child-strategy factory.
- test_helpers.py: _with_persist_credentials for the persist-credentials
  with-block mapping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lodyai
lodyai Bot force-pushed the fix/skip-audit-for-dependabot branch from 7d40c17 to 93ef049 Compare July 24, 2026 01:46
coderabbitai[bot]

This comment was marked as resolved.

- Makefile: add a shared REQUIRE_UVX prerequisite (same actionable
  installation message as the test target) to the check-fmt, fmt, lint,
  and typecheck recipes, so a missing uvx fails with a clear message
  rather than an obscure one. The test target keeps its existing guard.
- test_helpers.py: dispatch _non_sha_refs on kind with an explicit
  match/case (branch is now its own case, not the fallback), and derive
  the "uppercased" ref by uppercasing the existing hex character at the
  chosen position (falling back to a hex letter for digits) instead of
  splicing in a literal "G".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@leynos
leynos merged commit 0bd3efd into main Jul 24, 2026
6 checks passed
@leynos
leynos deleted the fix/skip-audit-for-dependabot branch July 24, 2026 17:51
@buzzybee-df12

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
✅ 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

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/test_helpers.py (1)

1-567: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Split tests/test_helpers.py — it has blown well past the 400-logical-line cap.

The visible span alone reaches line 567, with several sizeable unshown "unchanged" gaps between hunks, so the real file is considerably larger. This PR's own additions (the 163-289 property-test block is ~127 lines by itself) push it further over budget.

Extract the new _is_pinned_action / _step_mappings / _disables_credential_persistence Hypothesis strategies and property tests (lines 163-289) into a dedicated module under tests/helpers/ (e.g. alongside tests/helpers/tooling_contracts/workflows.py, which they test directly), and consider moving the Docker-socket/act environment tests and the parent-Makefile contract test into their own files too.

♻️ Suggested decomposition
tests/
  test_helpers.py                       # keep the smaller, cohesive remainder
  test_workflow_contract_properties.py  # move lines 163-289 here
  test_docker_environment.py            # move Docker/act socket tests here

As per path instructions, "Files must not exceed 400 logical lines: Decompose large modules into subpackages."

🤖 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 `@tests/test_helpers.py` around lines 1 - 567, Split the oversized
tests/test_helpers.py into cohesive test modules, first moving the Hypothesis
strategies and property tests for _is_pinned_action, _step_mappings, and
_disables_credential_persistence into a dedicated workflow-contract properties
module under tests/. Also extract the Docker/act environment tests and parent
Makefile contract test into focused modules where appropriate, leaving
test_helpers.py below the 400-logical-line limit and preserving all existing
coverage.

Source: Path instructions

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

Outside diff comments:
In `@tests/test_helpers.py`:
- Around line 1-567: Split the oversized tests/test_helpers.py into cohesive
test modules, first moving the Hypothesis strategies and property tests for
_is_pinned_action, _step_mappings, and _disables_credential_persistence into a
dedicated workflow-contract properties module under tests/. Also extract the
Docker/act environment tests and parent Makefile contract test into focused
modules where appropriate, leaving test_helpers.py below the 400-logical-line
limit and preserving all existing coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ed000f18-b594-4125-b5ac-ea03d7e83ee6

📥 Commits

Reviewing files that changed from the base of the PR and between 00ba979 and 50b3f61.

📒 Files selected for processing (20)
  • Makefile
  • docs/developers-guide.md
  • docs/users-guide.md
  • template/.github/workflows/audit.yml
  • template/.github/workflows/ci.yml.jinja
  • template/docs/developers-guide.md.jinja
  • template/docs/users-guide.md.jinja
  • tests/__init__.py
  • tests/helpers/__init__.py
  • tests/helpers/tooling_contracts/cargo.py
  • tests/helpers/tooling_contracts/makefile.py
  • tests/helpers/tooling_contracts/orchestration.py
  • tests/helpers/tooling_contracts/workflows.py
  • tests/test_helpers.py
  • tests/test_template/__snapshots__/test_snapshots.ambr
  • tests/test_template/test_audit_targets.py
  • tests/test_template/test_compilation.py
  • tests/test_template/test_snapshots.py
  • tests/test_template/test_tooling_contracts.py
  • tests/utilities.py
🔗 Linked repositories identified

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

  • leynos/whitaker (auto-detected)
💤 Files with no reviewable changes (2)
  • tests/init.py
  • tests/helpers/init.py

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants