Skip to content

feat(cargo-agent): SQLX_OFFLINE, flock, test failure hints, --changed#4

Merged
codesoda merged 3 commits into
mainfrom
feat/cargo-agent-improvements
Mar 8, 2026
Merged

feat(cargo-agent): SQLX_OFFLINE, flock, test failure hints, --changed#4
codesoda merged 3 commits into
mainfrom
feat/cargo-agent-improvements

Conversation

@codesoda
Copy link
Copy Markdown
Owner

@codesoda codesoda commented Mar 8, 2026

Summary

  • SQLX_OFFLINE defaulting: Exports SQLX_OFFLINE=true by default, respecting explicit overrides (CI sets false)
  • Workflow-level lock: Uses flock (Linux) or Perl fallback (macOS) to prevent concurrent cargo-agent runs from causing build-directory lock contention
  • Failing test extraction: Parses nextest FAIL lines, libtest FAILED lines, and failures: summary sections; prints test names and /cargo-agent test <name> re-run commands
  • test --changed flag: Uses git diff + untracked files to detect changed crates and scope tests to only those packages; falls back to full suite for workspace-level Cargo file changes

Test plan

  • bash -n syntax check passes
  • shellcheck --severity=warning passes
  • Existing scenario tests pass (tests/run-scenarios.sh cargo-agent)
  • Flock concurrency scenario test passes
  • Manual test: test --changed with dirty working tree
  • Manual test: failing test output shows re-run hints

…action, --changed flag

Port improvements from ai-barometer PR #154:
- Default SQLX_OFFLINE=true with override support
- Workflow-level flock to prevent concurrent cargo-agent runs
- extract_failing_tests() parses nextest/libtest output for re-run hints
- test --changed flag to scope tests to git-changed crates
Base automatically changed from feat/cargo-fmt-report to main March 8, 2026 08:27
@codesoda codesoda marked this pull request as ready for review March 8, 2026 08:29
Copy link
Copy Markdown

@cadence cadence Bot left a comment

Choose a reason for hiding this comment

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

Cadence Session Review

No AI session data was found for this PR's commits.

Sign up to Cadence to have your AI sessions reviewed

Copy link
Copy Markdown

@ai-barometer-staging ai-barometer-staging Bot left a comment

Choose a reason for hiding this comment

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

Cadence Session Review

No AI session data was found for this PR's commits.

Sign up to Cadence to have your AI sessions reviewed

codesoda added 2 commits March 8, 2026 18:37
Adds a cargo-agent scenario with a deliberately failing test to exercise
the extract_failing_tests output (nextest FAIL lines, re-run hints).
…agents

- Add tests/cargo-agent/flock/ scenario that holds the lockfile in a
  background process, launches cargo-agent, verifies the "waiting"
  message appears, then releases the lock and confirms completion.
- Update add-x-agent.md with workflow-level lock as step 7 (flock on
  Linux, Perl fallback on macOS) — applicable to all agents.
- Update contributing.md numbered list to include the new step.
- Broaden shellcheck scan in CI and run-scenarios.sh to cover test
  scripts under tests/.
@codesoda codesoda merged commit 870d5b7 into main Mar 8, 2026
6 checks passed
@codesoda codesoda deleted the feat/cargo-agent-improvements branch March 8, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant