Add CI gating pipeline with docs gate policy, ruleset, and repovec-ci - #12
Conversation
….1.3 Add a comprehensive execution plan document for roadmap item 1.1.3 that outlines the current state, delivery goals, constraints, workstreams, and verification steps for implementing CI gating pipeline improvements. This includes enforcing required checks, aligning workflows to Make targets, managing branch protection, introducing a testable CI policy helper, and updating maintainer-facing documentation. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Add CI gating pipeline with docs-gate policy, ruleset, and repovec-ciThis PR introduces a versioned CI gating pipeline, implementing roadmap item 1.1.3 as detailed in the new execution plan ( Key ChangesCore Implementation
Workflow and Governance
Documentation
Progress and Remediation
Verification
WalkthroughAdd a new repovec-ci Rust crate and CLI to classify changed files and Mermaid presence, restructure CI into discrete jobs including a docs-gate job, add a versioned GitHub ruleset enforcing required checks on refs/heads/main, and add related tests, documentation and execution plans. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as "GitHub Actions"
participant CLI as "repovec-ci CLI"
participant FS as "Filesystem"
participant WF as "Workflow Jobs"
GH->>CLI: Provide changed-file list (--changed-file / stdin)
CLI->>FS: Read listed files and scan for "```mermaid"
CLI->>CLI: Compute DocsGatePlan (should_run, docs_gate_required, nixie_required, reason, matched_files, conservative_fallback_files)
CLI->>GH: Emit key=value outputs (GITHUB_OUTPUT)
GH->>WF: Publish `docs-gate` check; conditionally run markdownlint and nixie based on outputs
Poem
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideImplements a versioned CI gating model by refactoring the GitHub Actions workflow into explicit gate jobs, introducing a dedicated Rust helper crate and CLI to decide when documentation checks should run, wiring that helper into a new docs-gate job, and documenting the enforcement model alongside a versioned GitHub ruleset payload and updated maintainer/user docs. Sequence diagram for docs-gate job using repovec-ci helpersequenceDiagram
participant GH as GitHub_Actions
participant J as Job_docs_gate
participant G as Git_Repo
participant CLI as repovec_ci_cli
participant LIB as repovec_ci_lib
GH->>J: Start docs_gate job
J->>G: git diff to compute changed_files
G-->>J: changed_files list
alt have_changed_files
J->>CLI: repovec-ci --stdin (changed_files on stdin)
else no_changed_files
J->>CLI: repovec-ci (no args)
end
CLI->>LIB: evaluate_docs_gate_in(root_dir, changed_files)
LIB-->>CLI: DocsGatePlan
CLI-->>J: should_run, docs_gate_required, nixie_required, reason, matched_files
J->>J: Log decision outputs
alt docs_gate_required == true
J->>J: Install_markdownlint_cli2
J->>J: make markdownlint
alt nixie_required == true
J->>J: setup_bun
J->>J: install_nixie
J->>J: make nixie
else nixie_required == false
J->>J: Skip nixie
end
else docs_gate_required == false
J->>J: Echo "docs gates skipped"
end
J-->>GH: Job status for docs_gate
Class diagram for repovec-ci CI policy helperclassDiagram
class DocsGateReason {
<<enum>>
+MarkdownChanged
+MissingChangedFiles
+NoMarkdownChanges
+as_str() &'static str
}
class DocsGatePlan {
-matched_files : Vec~String~
-docs_gate_required : bool
-nixie_required : bool
-reason : DocsGateReason
+new(matched_files : Vec~String~, docs_gate_required : bool, nixie_required : bool, reason : DocsGateReason) DocsGatePlan
+should_run() bool
+docs_gate_required() bool
+nixie_required() bool
+reason() DocsGateReason
+matched_files() &[String]
}
class Functions_lib {
<<module>>
+evaluate_docs_gate_in(root : Dir, changed_files : IntoIterator~Item = S~) DocsGatePlan
+evaluate_docs_gate_with(changed_files : IntoIterator~Item = S~, path_contains_mermaid : FnMut &str -> bool) DocsGatePlan
-normalize_path(path : &str) Option~String~
-is_markdown_path(path : &str) bool
-path_contains_mermaid(root : Dir, path : &str) bool
}
class MainBinary {
<<binary>>
+main() void
+run() io::Result~()~
+parse_args(arguments : IntoIterator~Item = String~) io::Result~Input~
+read_paths_from_stdin() io::Result~Vec~String~~
}
class Input {
<<enum>>
+ChangedFiles(Vec~String~)
+Stdin
}
DocsGatePlan --> DocsGateReason : uses
Functions_lib --> DocsGatePlan : returns
Functions_lib --> DocsGateReason : uses
MainBinary --> Input : uses
MainBinary --> Functions_lib : calls
MainBinary --> DocsGatePlan : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…docs gate - Split monolithic CI job into stable named jobs: build, check-fmt, lint, test, docs-gate - Docs gate runs conditionally on Markdown file changes using a testable Rust helper - Add behavioural and unit tests for docs gate classification - Add GitHub ruleset definition for merge check enforcement targeting main branch - Update documentation with maintainer guidance and CI design details - Ensure local Make targets align with CI jobs for consistency - Defer live enforcement activation until workflow merges and verified on remote Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Add detailed instructions for creating, updating, and verifying GitHub rulesets related to the main CI gating pipeline. These commands ensure correct deployment and verification after workflow changes are merged on the remote default branch. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
…n docs gate - DocsGatePlan now tracks whether Mermaid validation (nixie) is required. - docs-gate CI job installs markdownlint-cli2 only when docs gate runs. - docs-gate CI job conditionally runs markdownlint if docs gate needed. - docs-gate CI job conditionally runs nixie only if Mermaid present in Markdown. - User-facing docs-guide.md added to explain docs gate and Mermaid validation flow. - Behavioural and unit tests extended to cover Mermaid validation requirements. - Documentation updated to reflect separate conditions for markdownlint and nixie. This improves the docs-gate CI workflow by avoiding nixie runs if no Mermaid diagrams changed, reducing unnecessary validation. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
- CI workflow now installs nixie if mermaid validation is required - Added dependencies camino and cap-std for UTF-8 path handling in repovec-ci - Refactored repovec-ci to use cap-std for filesystem operations - Updated docs to reflect nixie installation step in CI gating pipeline Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
- Integrate oven-sh/setup-bun@v2 GitHub Action to install Bun - Ensure Bun is set up immediately before nixie installation in docs-gate - Updated CI workflow and execution plan docs to reflect this dependency Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e39d14d215
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 148-151: The workflow currently uses oven-sh/setup-bun@v2 with
bun-version: latest which makes CI non-deterministic; change the bun-version
input to a specific pinned release (for example replace bun-version: latest with
bun-version: "1.3.12") so the setup action uses a fixed Bun release; update the
value wherever bun-version appears in the CI job that uses the setup-bun action
to ensure reproducible builds.
In `@crates/repovec-ci/src/lib.rs`:
- Around line 50-56: The two accessors should_run() and docs_gate_required()
both return self.docs_gate_required; update the docs to clarify that
should_run() is a semantic alias for external callers and that
docs_gate_required() is the canonical name: modify the docstring for
docs_gate_required() to describe its role (returns whether the documentation
gate should run) and add a brief sentence stating that should_run() is provided
as an alias for convenience/compatibility, referencing the methods should_run()
and docs_gate_required() and the underlying field self.docs_gate_required to
make the relationship explicit.
In `@docs/execplans/1-1-3-ci-gating-pipeline.md`:
- Around line 27-35: Replace the semicolon before "and enforce those checks..."
in the paragraph that lists the two layers (the sentence starting "1. align the
repository workflow...; and 2. enforce those checks...") with a comma so it
reads "1. align the repository workflow with the Make targets that define the
commit gates, and 2. enforce those checks as merge blockers..." (or
alternatively convert the items into a numbered sub-list to remove the need for
the punctuation).
- Around line 82-90: In the sentence listing enforcement options that currently
reads "manage the rule manually in the GitHub UI and document the exact required
checks; or - manage it through repository automation...", replace the semicolon
before "or" with a comma so the clause reads "...document the exact required
checks, or manage it through repository automation..." to correct the
punctuation; update the same punctuation in the parallel list item that contains
"accepted pattern for GitHub settings management" if present.
In `@docs/repovec-appliance-technical-design.md`:
- Around line 411-416: Update the paragraph describing documentation checks to
explicitly state the safe-fallback behavior: change the text around "make
markdownlint" and "make nixie" to say these checks run when the policy
classifies Markdown changes and also run as a safe fallback if the changed-file
list is missing or malformed, and note that `make markdownlint` runs for any
changed Markdown file while `make nixie` runs only for Markdown files containing
a Mermaid diagram (or when fallback mode is active).
In `@docs/users-guide.md`:
- Around line 28-34: Update the Mermaid flowchart predicates to use
Markdown-path terminology instead of generic docs-paths: change the DocsOnly
node label from "Only_docs_paths_changed?" to "Any_markdown_paths_changed?" and
the HasDocs condition in the MixedOrCode branch from
"Any_docs_or_mermaid_docs_changed?" to "Any_markdown_paths_changed?"; ensure the
classifier referenced by Classify, DocsOnly, MixedOrCode, and HasDocs is
understood to check for Markdown extensions (.md, .markdown, .mdx) so the policy
aligns with actual inputs.
🪄 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: 26bed694-180f-46ba-b0e5-a6044a2cffb8
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
.github/rulesets/main-ci-gating.json.github/workflows/ci.ymlCargo.tomlcrates/repovec-ci/Cargo.tomlcrates/repovec-ci/src/lib.rscrates/repovec-ci/src/main.rscrates/repovec-ci/tests/docs_gate_policy_bdd.rscrates/repovec-ci/tests/features/docs_gate.featuredocs/contents.mddocs/developers-guide.mddocs/execplans/1-1-3-ci-gating-pipeline.mddocs/repovec-appliance-technical-design.mddocs/roadmap.mddocs/users-guide.md
…ck handling - Docs gate now considers documentation-tooling config files (e.g., .markdownlint-cli2.jsonc) as inputs that trigger validation. - Mermaid detection enhanced to handle unreadable files conservatively, requiring nixie validation and exposing fallback files to CI. - Updated CLI to support --help and improved usage messages. - CI workflow builds repovec-ci once and invokes binary directly. - Documentation updated to reflect broader documentation input handling and fallback behavior. - Behavioral tests expanded to cover new docs tooling paths and fallback cases. This change improves accuracy and safety of documentation validation in CI, ensuring tooling config changes trigger appropriate checks and fallback detection paths are observable. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 8
♻️ Duplicate comments (1)
docs/users-guide.md (1)
29-37:⚠️ Potential issue | 🟡 MinorRename the flowchart predicates to match the implemented classifier.
Replace the
docs pathsandmermaid docslabels with terminology that covers
Markdown anywhere in the repository plus documentation-tooling inputs such as
.markdownlint-cli2.jsonc. Leave the current labels in place and README/config
changes follow the wrong branch in this user-facing explanation.🛠 Patch
- Classify --> DocsOnly{Only_docs_paths_changed?} + Classify --> DocsOnly{Only_documentation_inputs_changed?} @@ - MixedOrCode --> HasDocs{Any_docs_or_mermaid_docs_changed?} + MixedOrCode --> HasDocs{Any_documentation_inputs_changed?} @@ - RequireDocs --> CheckNixie{Mermaid_docs_changed?} + RequireDocs --> CheckNixie{Mermaid_or_conservative_path?}Triage:
[type:docstyle]Based on learnings: When a change reaches CI, the workflow must validate whether documentation validation is required and whether Mermaid diagram validation should run based on the changed-file list, documentation-tooling configuration changes, and Markdown file contents containing Mermaid diagrams.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/users-guide.md` around lines 29 - 37, Update the flowchart predicates in docs/users-guide.md to match the implemented classifier: rename the node label for DocsOnly from "Only_docs_paths_changed?" to "Only_documentation_inputs_changed?", rename the HasDocs predicate from "Any_docs_or_mermaid_docs_changed?" to "Any_documentation_inputs_changed?", and rename the CheckNixie label from "Mermaid_docs_changed?" to "Mermaid_or_conservative_path?"; make these exact string replacements for the nodes Classify -> DocsOnly, MixedOrCode -> HasDocs, and RequireDocs -> CheckNixie so the diagram terminology aligns with the code that checks Markdown and documentation-tooling inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 159-165: The "Install nixie" CI step uses a floating Git URL (uv
tool install git+https://github.com/leynos/nixie) which can change unexpectedly;
update that command to pin the dependency to an immutable ref by appending
@<tag-or-commit> (e.g., uv tool install
git+https://github.com/leynos/nixie@<commit-or-tag>) so the "Install nixie" step
always installs a reproducible version.
In `@crates/repovec-ci/src/lib.rs`:
- Around line 240-255: The current use of matched_files.iter().any(...)
short-circuits and can skip collecting later unreadable Markdown files into
conservative_fallback_files; replace the .any(...) call with an explicit full
pass (e.g., for path in matched_files.iter() { ... }) that: 1) still returns
true for nixie_required if any path_requires_nixie (set a local bool
nixie_required = false and set to true when detection.requires_nixie()), 2)
always pushes path.clone() into conservative_fallback_files when
detection.is_unknown(), and 3) preserves the existing early-return for
is_docs_tooling_config_path(path) / skip for non-markdown via
is_markdown_path(path) logic inside that loop so no unreadable Markdown is
missed.
In `@crates/repovec-ci/src/main.rs`:
- Around line 116-131: Current tests only exercise --help and invalid-flag
paths; add unit tests calling parse_args to cover the CLI branches used by the
workflow: a test for no arguments (ensure it produces the expected default Input
variant), a test for "--stdin" parsing into Input::Stdin (or equivalent), tests
for repeated "--changed-file" values (ensure multiple entries are collected into
the appropriate Input variant/field), a test for missing "--changed-file" value
that returns io::ErrorKind::InvalidInput with USAGE in the message, and a test
asserting the mutually-exclusive flags produce an error; locate and use the
parse_args function, Input enum variants, and the USAGE constant to implement
these assertions.
In `@crates/repovec-ci/tests/features/docs_gate.feature`:
- Around line 44-49: Add a new BDD Scenario to the docs_gate.feature that
mirrors the existing "Missing changed-file input runs the docs gate
conservatively" scenario but covers an unreadable Markdown file path: name it
like "Unreadable changed Markdown triggers conservative fallback", use a Given
step that marks a specific changed Markdown file as unreadable (so Mermaid
detection cannot read it), then When the docs gate policy is evaluated; assert
Then the docs gate runs, And Mermaid validation is required, And the docs gate
reason is conservative_fallback_files, and ensure the scenario verifies the
workflow publishes the list of files that caused the conservative fallback
(i.e., the unreadable file path).
In `@docs/contents.md`:
- Around line 3-29: The contents.md index is a flat list and must be reorganized
into stable, grouped sections: add an explicit top-level title "Documentation
contents" and a self-reference link at the top, then split entries into logical
groups (e.g. "Contributor guides" for Users guide and Developers guide, "Design
& Architecture" for repovec-appliance-technical-design and
complexity-antipatterns-and-refactoring-strategies, "Plans & Execution" for
Roadmap and execplans, "Reference & Style" for documentation-style-guide,
ortho-config-users-guide, testing guides, scripting-standards, etc.), reorder
entries for stable priority within each group, use inline links with short
audience-focused descriptions for each item, and ensure filenames like
users-guide.md, developers-guide.md, repovec-appliance-technical-design.md,
roadmap.md, execplans/1-1-3-ci-gating-pipeline.md, documentation-style-guide.md,
ortho-config-users-guide.md,
reliable-testing-in-rust-via-dependency-injection.md, rust-doctest-dry-guide.md,
rust-testing-with-rstest-fixtures.md, rstest-bdd-users-guide.md,
complexity-antipatterns-and-refactoring-strategies.md, and
scripting-standards.md are placed into the appropriate groups with clear
descriptions and stable ordering.
In `@docs/developers-guide.md`:
- Around line 66-72: Update the paragraph that begins "When the changed-file
list is unavailable" to explicitly state that the missing-input fallback not
only forces the documentation gate but also requires running `make nixie`
(Mermaid validation) instead of `make markdownlint`, so that both documentation
validation and Mermaid validation are performed when the changed-file list is
unavailable; reference and modify the sentence that currently contrasts "`make
nixie`" and "`make markdownlint`" to include the new wording about requiring
`make nixie`.
- Around line 29-36: Add the missing formatting step to the Markdown-change
checklist by inserting the "make fmt" invocation (e.g., make fmt 2>&1 | tee
/tmp/repovec-make-fmt.log) into the existing block that currently runs set -o
pipefail, make markdownlint and make nixie; ensure the additional set -o
pipefail is preserved around the make fmt call so the sequence becomes set -o
pipefail, make fmt ..., set -o pipefail, make markdownlint ..., set -o pipefail,
make nixie ... and update the checklist text accordingly.
In `@docs/execplans/1-1-3-ci-gating-pipeline.md`:
- Around line 43-46: Update the current-state bullet to state that docs-gate
runs markdown checks via `make markdownlint` when Markdown files change, and
runs `make nixie` when Markdown files contain Mermaid diagrams, but also
conservatively triggers both checks if documentation-tooling configuration files
change (so changes to tooling config cause both docs-gate and Mermaid validation
to run) and likewise triggers both when the changed-file list is missing or
unreadable (safe-fallback behavior). Mention that the job still publishes a
stable required check result in all cases.
---
Duplicate comments:
In `@docs/users-guide.md`:
- Around line 29-37: Update the flowchart predicates in docs/users-guide.md to
match the implemented classifier: rename the node label for DocsOnly from
"Only_docs_paths_changed?" to "Only_documentation_inputs_changed?", rename the
HasDocs predicate from "Any_docs_or_mermaid_docs_changed?" to
"Any_documentation_inputs_changed?", and rename the CheckNixie label from
"Mermaid_docs_changed?" to "Mermaid_or_conservative_path?"; make these exact
string replacements for the nodes Classify -> DocsOnly, MixedOrCode -> HasDocs,
and RequireDocs -> CheckNixie so the diagram terminology aligns with the code
that checks Markdown and documentation-tooling inputs.
🪄 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: 2847023a-46c9-4981-a1c7-ca5d31332fd4
📒 Files selected for processing (10)
.github/workflows/ci.ymlcrates/repovec-ci/src/lib.rscrates/repovec-ci/src/main.rscrates/repovec-ci/tests/docs_gate_policy_bdd.rscrates/repovec-ci/tests/features/docs_gate.featuredocs/contents.mddocs/developers-guide.mddocs/execplans/1-1-3-ci-gating-pipeline.mddocs/repovec-appliance-technical-design.mddocs/users-guide.md
- Updated GitHub Actions workflow to trigger core CI gate jobs (`build`, `check-fmt`, `lint`, `test`) on pull request updates and pushes to `main` branch only. - Removed running core CI jobs on every branch push to avoid duplicate runs. - Adjusted documentation to reflect new CI triggering strategy. - Ensures required checks remain visible during merge decisions while reducing redundant CI runs on push branches. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
- Install @mermaid-js/mermaid-cli and chrome-headless-shell in docs-gate job when required - Cache ~/.local/share/whitaker and refine Whitaker installation in lint job - Update docs to reflect these changes Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
…g config - Docs gate now treats unreadable Markdown files as requiring conservative fallback to ensure validation safety. - Documentation-tooling config changes trigger docs gate requiring both markdownlint and nixie checks. - Enhanced CLI argument parsing with better error messages and mutual exclusivity enforced between --stdin and --changed-file. - Updated GitHub Actions workflow to pin nixie tool by commit hash for stability. - Added behavioural tests covering unreadable markdown fallback scenario. - Improved documentation to reflect these policy and tooling changes. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (4)
docs/developers-guide.md (2)
66-72:⚠️ Potential issue | 🟡 MinorState that the missing-input fallback also forces
make nixie.The paragraph only describes the docs-gate half of the conservative path. The
implemented policy runs both documentation validation and Mermaid validation
when the changed-file list is unavailable or malformed.Triage:
[type:docstyle]Based on learnings: When the changed-file list is unavailable or malformed, apply safe default policy: run both documentation gate and Mermaid validation.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/developers-guide.md` around lines 66 - 72, Update the paragraph describing the conservative fallback for an unavailable or malformed changed-file list to state that the fallback runs both the documentation gate and Mermaid validation by forcing the broader target `make nixie` (not just `make markdownlint`); mention the implemented policy explicitly (changed-file list unavailable/malformed -> run both documentation validation and Mermaid validation) and reference the user-visible flow in users-guide.md for context, so readers understand that the conservative path runs `make nixie`.
29-36:⚠️ Potential issue | 🟡 MinorAdd
make fmtto the Markdown-change checklist.The documentation workflow here still omits the required formatting pass after
Markdown edits.Triage:
[type:docstyle]🛠 Patch
```sh set -o pipefail +make fmt 2>&1 | tee /tmp/repovec-make-fmt.log +set -o pipefail make markdownlint 2>&1 | tee /tmp/repovec-make-markdownlint.log set -o pipefail make nixie 2>&1 | tee /tmp/repovec-make-nixie.log</details> As per coding guidelines, "Run `make fmt` after any documentation changes to format all Markdown files and fix table markup." <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@docs/developers-guide.mdaround lines 29 - 36, Update the Markdown-change
checklist in the developers guide to include the required formatting step:
insert amake fmtinvocation (logging to /tmp/repovec-make-fmt.log) before
runningmake markdownlintandmake nixiein the checklist block so the
sequence becomes set -o pipefail → make fmt → make markdownlint → make nixie;
modify the checklist snippet in docs/developers-guide.md accordingly to ensure
every doc edit runs the formatter.</details> </blockquote></details> <details> <summary>.github/workflows/ci.yml (1)</summary><blockquote> `160-165`: _⚠️ Potential issue_ | _🟠 Major_ **Pin `nixie` to an immutable Git ref.** Install a tag or commit instead of the repository default branch. As written, the required docs gate can change or fail when `leynos/nixie` moves independently of this repository. <details> <summary>🛠 Patch</summary> ```diff - uv tool install git+https://github.com/leynos/nixie + uv tool install git+https://github.com/leynos/nixie@<tag-or-commit>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 160 - 165, The workflow step "Install nixie" currently installs the repo default branch; change the install command in that step to pin to an immutable ref by using a specific tag or commit SHA (e.g., replace the URL passed to uv tool install for leynos/nixie with git+https://github.com/leynos/nixie@<tag-or-commit-sha>) so the CI uses a fixed release; update the command in the "Install nixie" step accordingly and commit the chosen tag or SHA.docs/execplans/1-1-3-ci-gating-pipeline.md (1)
43-46:⚠️ Potential issue | 🟡 MinorDescribe the full
docs-gatepolicy in these summaries.These bullets omit the conservative paths and read as if every documentation
change runsmake nixie. Mirror the implemented behaviour:docs-gateis the
required check,make markdownlintruns for Markdown inputs, andmake nixie
also runs for Mermaid-bearing Markdown plus conservative fallback cases.Triage:
[type:docstyle]Based on learnings: Documentation-tooling configuration changes trigger both documentation gate and Mermaid validation as a conservative default; when the changed-file list is unavailable or malformed, apply safe default policy: run both documentation gate and Mermaid validation.
Also applies to: 58-61, 199-202
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/execplans/1-1-3-ci-gating-pipeline.md` around lines 43 - 46, Update the summary to fully describe the docs-gate policy: state that docs-gate is the required check, that `make markdownlint` runs when Markdown files are detected, and that `make nixie` runs only for Markdown files containing Mermaid diagrams but also in conservative fallback cases (e.g., documentation-tooling/config changes or when the changed-file list is unavailable or malformed) so both checks run by default in those scenarios; apply the same wording changes wherever the brief summaries mention `docs-gate`, `make markdownlint`, or `make nixie`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 156-159: Replace the mutable tag on the GitHub Action step that
currently uses "uses: oven-sh/setup-bun@v2" with a specific commit SHA for
oven-sh/setup-bun so the workflow is pinned; locate the step referencing
oven-sh/setup-bun and change the uses value to the corresponding full commit SHA
for the v2 release (keep the bun-version: "1.3.12" input intact) to eliminate
the supply-chain risk from a floating tag.
In `@docs/developers-guide.md`:
- Around line 14-115: The developers-guide.md needs canonical developers-guide
structure: add a brief opening paragraph stating audience and scope, insert
early links to design docs/decision records, convert major unnumbered headings
(e.g., "Local quality gates", "GitHub Actions gate set", "CI policy helper",
"Required-check enforcement") to a numbered section hierarchy (1., 2., 3., ...),
clearly separate normative rules from informative explanation within each
section, include compact interface maps or workflow diagrams for subsystem
guidance, and ensure references sync with decision records; update headings and
content in developers-guide.md (and internal subsection headings) accordingly so
the file follows the repository's canonical developers-guide format.
---
Duplicate comments:
In @.github/workflows/ci.yml:
- Around line 160-165: The workflow step "Install nixie" currently installs the
repo default branch; change the install command in that step to pin to an
immutable ref by using a specific tag or commit SHA (e.g., replace the URL
passed to uv tool install for leynos/nixie with
git+https://github.com/leynos/nixie@<tag-or-commit-sha>) so the CI uses a fixed
release; update the command in the "Install nixie" step accordingly and commit
the chosen tag or SHA.
In `@docs/developers-guide.md`:
- Around line 66-72: Update the paragraph describing the conservative fallback
for an unavailable or malformed changed-file list to state that the fallback
runs both the documentation gate and Mermaid validation by forcing the broader
target `make nixie` (not just `make markdownlint`); mention the implemented
policy explicitly (changed-file list unavailable/malformed -> run both
documentation validation and Mermaid validation) and reference the user-visible
flow in users-guide.md for context, so readers understand that the conservative
path runs `make nixie`.
- Around line 29-36: Update the Markdown-change checklist in the developers
guide to include the required formatting step: insert a `make fmt` invocation
(logging to /tmp/repovec-make-fmt.log) before running `make markdownlint` and
`make nixie` in the checklist block so the sequence becomes set -o pipefail →
make fmt → make markdownlint → make nixie; modify the checklist snippet in
docs/developers-guide.md accordingly to ensure every doc edit runs the
formatter.
In `@docs/execplans/1-1-3-ci-gating-pipeline.md`:
- Around line 43-46: Update the summary to fully describe the docs-gate policy:
state that docs-gate is the required check, that `make markdownlint` runs when
Markdown files are detected, and that `make nixie` runs only for Markdown files
containing Mermaid diagrams but also in conservative fallback cases (e.g.,
documentation-tooling/config changes or when the changed-file list is
unavailable or malformed) so both checks run by default in those scenarios;
apply the same wording changes wherever the brief summaries mention `docs-gate`,
`make markdownlint`, or `make nixie`.
🪄 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: 0c122ed9-40ac-4160-9c21-f5a76cac9bf1
📒 Files selected for processing (4)
.github/workflows/ci.ymldocs/developers-guide.mddocs/execplans/1-1-3-ci-gating-pipeline.mddocs/roadmap.md
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (1)
docs/developers-guide.md (1)
14-120: 🧹 Nitpick | 🔵 TrivialNumber the major sections.
The coding guidelines require numbered sections for long-form developers guide content. Apply a numbering scheme to the major headings: "1. Local quality gates", "2. GitHub Actions gate set", "3. CI policy helper", "4. Required-check enforcement".
Triage:
[type:docstyle]♻️ Proposed section numbering
-## Local quality gates +## 1. Local quality gates -## GitHub Actions gate set +## 2. GitHub Actions gate set -## CI policy helper +## 3. CI policy helper -## Required-check enforcement +## 4. Required-check enforcementAs per coding guidelines, "Use canonical filename docs/developers-guide.md for developers guide documentation with... numbered sections for long-form content."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/developers-guide.md` around lines 14 - 120, Prefix the four major headings with ordered section numbers as required by the style guide: change "Local quality gates" → "1. Local quality gates", "GitHub Actions gate set" → "2. GitHub Actions gate set", "CI policy helper" → "3. CI policy helper", and "Required-check enforcement" → "4. Required-check enforcement"; ensure any internal references (e.g., the link to users-guide.md or the ruleset filename/reference) remain correct after renaming the headings and update any nearby sentences that mention those headings by name if necessary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 148-151: The workflow step currently uses the mutable action
reference oven-sh/setup-bun@v2 which can change; update that step to pin the
action to the supplied commit SHA 0c5077e514 (replace oven-sh/setup-bun@v2 with
oven-sh/setup-bun@0c5077e514) while keeping the existing condition (if:
steps.docs_gate_plan.outputs.nixie_required == 'true') and bun-version: "1.3.12"
intact so the gate step is stable and supply-chain safe.
In `@crates/repovec-ci/src/lib.rs`:
- Around line 19-113: Add runnable Rustdoc examples for DocsGateReason::as_str,
each public DocsGatePlan accessor (should_run, docs_gate_required,
nixie_required, reason, matched_files, conservative_fallback_files) and the
evaluate_docs_gate_with function by adding /// examples that include "use
repovec_ci::..." imports, construct the types or call evaluate_docs_gate_with
with representative inputs, and assert expected return values/outputs; ensure
examples are real doctest code blocks (```rust ... ```) that compile and assert
values (e.g., assert_eq!(DocsGateReason::MissingChangedFiles.as_str(),
"missing-changed-files") and similar checks for DocsGatePlan accessors and
evaluate_docs_gate_with) so the docs are executable and demonstrate usage and
outcomes.
- Around line 1-413: The file exceeds the 400-line limit because the long
#[cfg(test)] mod tests is embedded in src/lib.rs; extract those tests into
separate test modules so src/lib.rs contains only policy logic (DocsGatePlan,
evaluate_docs_gate_with, path_contains_mermaid, is_markdown_path, etc.). Create
one or more test files (e.g. tests/docs_gate.rs or tests/unit/docs_gate.rs) that
import the crate (use repovec_ci::{evaluate_docs_gate_with, MermaidDetection,
DocsGateReason, DocsGatePlan}) and re-create the existing test cases (including
the rstest parameterized cases and named tests like
markdown_paths_trigger_the_docs_gate,
unreadable_markdown_requests_nixie_conservatively,
mixed_input_returns_only_markdown_matches). Remove the entire #[cfg(test)] mod
tests block from src/lib.rs after moving tests so the public API and helper
functions remain unchanged.
In `@crates/repovec-ci/src/main.rs`:
- Around line 23-55: The function run contains multiple clusters of nested
conditional logic around computing plan from Input which triggers the Whitaker
lint; extract that logic into a new helper (e.g., fn compute_plan(input: Input)
-> io::Result<Plan>) that performs the match on Input::Help /
Input::ChangedFiles / Input::Stdin and calls Dir::open_ambient_dir(".",
ambient_authority()), evaluate_docs_gate_in(&root, paths) and
read_paths_from_stdin() as needed, returning the evaluated plan (or early
handling for Help). Replace the match in run with a single call to
compute_plan(input) and keep the subsequent writeln! calls unchanged so run
becomes linear and the nested clusters are removed; reference symbols: run,
compute_plan (new), Input::Help, Input::ChangedFiles, Input::Stdin,
Dir::open_ambient_dir, evaluate_docs_gate_in, read_paths_from_stdin.
In `@crates/repovec-ci/tests/docs_gate_policy_bdd.rs`:
- Around line 97-102: The helper function plan is incorrectly marked const fn
despite never being evaluated at compile time; remove the const annotation so
the signature becomes fn plan(world: &PolicyWorld) -> &DocsGatePlan and keep the
match logic and panic! unchanged, updating the declaration from const fn
plan(...) to fn plan(...).
---
Duplicate comments:
In `@docs/developers-guide.md`:
- Around line 14-120: Prefix the four major headings with ordered section
numbers as required by the style guide: change "Local quality gates" → "1. Local
quality gates", "GitHub Actions gate set" → "2. GitHub Actions gate set", "CI
policy helper" → "3. CI policy helper", and "Required-check enforcement" → "4.
Required-check enforcement"; ensure any internal references (e.g., the link to
users-guide.md or the ruleset filename/reference) remain correct after renaming
the headings and update any nearby sentences that mention those headings by name
if necessary.
🪄 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: b3f57b0d-9932-4d0f-9b43-55eefe38d820
📒 Files selected for processing (9)
.github/workflows/ci.ymlcrates/repovec-ci/src/lib.rscrates/repovec-ci/src/main.rscrates/repovec-ci/tests/docs_gate_policy_bdd.rscrates/repovec-ci/tests/features/docs_gate.featuredocs/contents.mddocs/developers-guide.mddocs/execplans/1-1-3-ci-gating-pipeline.mddocs/users-guide.md
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai Please suggest a fix for the following lint violations and provide an AI coding agent prompt for the fix: |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
- Implemented detailed evaluation of documentation-gate policy in the repovec-ci crate - Added extensive inline documentation with examples for DocsGatePlan and DocsGateReason - Introduced unit tests covering docs-gate classification scenarios - Simplified main.rs by refactoring plan computation with compute_plan helper - Updated developers-guide.md with structured sections on local quality gates and CI policy helper - Minor workflow update to fix bun version reference This enables better CI gating based on documentation changes, enhancing repo quality and tooling. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
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 `@docs/developers-guide.md`:
- Around line 87-91: The compound sentence in the documentation lacks a comma
before "so": update the sentence "The helper emits conservative-fallback fields
so workflow logs can distinguish an actual Mermaid match from an unreadable file
that forced `make nixie` to run." by inserting a comma before "so" to read
"...conservative-fallback fields, so workflow logs can distinguish..." to
improve clarity in the developers-guide.md 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
Run ID: 771d6026-62c7-4c40-941f-43b2d664ca3b
📒 Files selected for processing (6)
.github/workflows/ci.ymlcrates/repovec-ci/src/lib.rscrates/repovec-ci/src/main.rscrates/repovec-ci/tests/docs_gate_policy_bdd.rscrates/repovec-ci/tests/docs_gate_unit.rsdocs/developers-guide.md
This comment was marked as resolved.
This comment was marked as resolved.
- Refactor main.rs to replace compute_plan with more explicit functions: print_usage, evaluate_from_paths, evaluate_from_stdin, and write_plan. - Use match on Input enum directly in run() for clearer logic. - Extract plan output logic into write_plan helper. - Update developers-guide.md with expanded, clearer public API surface docs for repovec-ci, including detailed types, enums, functions, and rationale for cap-std usage. This change improves code clarity and maintainability while enhancing documentation for consumers of the repovec-ci crate's API. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
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 `@crates/repovec-ci/src/main.rs`:
- Around line 54-64: Add insta as a dev-dependency in Cargo.toml and add
snapshot tests that lock the CLI stdout/stderr contract and write_plan
formatting/ordering: create integration tests (e.g., tests/cli_snapshots.rs)
that (1) call write_plan with deterministic DocsGatePlan fixtures to assert the
exact key=value ordering and field formatting via insta::assert_snapshot!, (2)
run the compiled binary (or main::run entry) capturing --help output, (3) run
variations for --changed-file and --stdin (including empty stdin) capturing
stdout, and (4) assert stderr and exit codes for invalid flags; ensure tests use
deterministic inputs (fixed DocsGatePlan, sorted matched_files) so snapshots are
stable.
🪄 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: 9294bbc2-f179-4792-a488-187febcae986
📒 Files selected for processing (2)
crates/repovec-ci/src/main.rsdocs/developers-guide.md
Refactor and clean up the developers-guide section for the repovec-ci crate. - Remove outdated notes about testing frameworks. - Streamline explanations of DocsGateReason, DocsGatePlan, MermaidDetection, and related functions. - Improve formatting and explanatory text regarding cap-std rationale. - Enhance binary usage description for better readability. - Rename output keys for clarity (`matched_count` to `matched_files_count`, `conservative_fallback_count` to `conservative_fallback_files_count`). Overall, improve the accuracy and clarity of the documentation to aid future contributors and users. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Added new tests using insta snapshots to verify consistent CLI help output, handling of changed files input, empty stdin input, and invalid flag errors in repovec-ci. This improves test coverage and ensures stability of CLI user experience. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
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 `@docs/developers-guide.md`:
- Around line 145-155: Update the docs to match the actual stdout keys emitted
by the repovec-ci binary: in docs/developers-guide.md replace the listed output
keys `matched_files_count` and `conservative_fallback_files_count` with the real
keys `matched_count` and `conservative_fallback_count` to mirror the contract
implemented in crates/repovec-ci/src/main.rs (the stdout `key=value` emitter in
main). Ensure the rest of the keys remain unchanged so the guide and binary
output stay in lockstep.
🪄 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: 3204d19d-3448-416c-a457-44aef1cd602e
📒 Files selected for processing (1)
docs/developers-guide.md
There was a problem hiding this comment.
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 `@crates/repovec-ci/src/main.rs`:
- Around line 8-12: The USAGE text for the CLI is incorrect for how parse_args
handles --changed-file (it accepts one path per flag, not multiple values);
update the USAGE constant so it documents repeated flags explicitly (e.g.
replace the single-flag "<path>..." form with a repeated-flag form such as
"<path> [--changed-file <path> ...]") so the usage string in USAGE matches the
behavior of parse_args and the --changed-file flag.
- Around line 59-62: Update the output key names to match the documented
$GITHUB_OUTPUT contract by changing the two keys written in the output writer:
replace "matched_count" with "matched_files_count" in the writeln! that uses
plan.matched_files().len(), and replace "conservative_fallback_count" with
"conservative_fallback_files_count" in the writeln! that uses
plan.conservative_fallback_files().len(); keep the same values
(plan.matched_files().len() and plan.conservative_fallback_files().len()) and
leave the corresponding comma-joined file lists 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
Run ID: 5a21b070-0a24-443d-96fd-c86375cd1c2b
⛔ Files ignored due to path filters (5)
Cargo.lockis excluded by!**/*.lockcrates/repovec-ci/src/snapshots/repovec_ci__tests__changed_file_docs_output.snapis excluded by!**/*.snapcrates/repovec-ci/src/snapshots/repovec_ci__tests__help_output.snapis excluded by!**/*.snapcrates/repovec-ci/src/snapshots/repovec_ci__tests__invalid_flag_error.snapis excluded by!**/*.snapcrates/repovec-ci/src/snapshots/repovec_ci__tests__stdin_empty_output.snapis excluded by!**/*.snap
📒 Files selected for processing (2)
crates/repovec-ci/Cargo.tomlcrates/repovec-ci/src/main.rs
Improved the usage message to allow multiple --changed-file flags with clearer syntax. Renamed output keys from matched_count and conservative_fallback_count to matched_files_count and conservative_fallback_files_count respectively for clearer semantics. Updated related tests, snapshots, and GitHub Actions workflow accordingly. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Replaced the setup-bun GitHub action reference from a short commit hash to a longer, more precise commit hash to ensure exact version consistency in the CI pipeline. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
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 @.github/workflows/ci.yml:
- Around line 116-126: When base_ref is absent we currently call
target/debug/repovec-ci with no args (in the else branch), which the helper
interprets as an empty changed_files list; instead, change the else branch to
signal "missing input" so the helper emits the conservative plan (require docs
gate and run Mermaid validation). Update the script so that when base_ref is
unavailable (the branch controlling changed_files and the else that currently
executes target/debug/repovec-ci >>"${GITHUB_OUTPUT}"), you invoke repovec-ci
with an explicit missing-input indicator or environment flag (e.g., a
--missing-input or a specific stdin token) so repovec-ci can detect unavailable
diff and set docs_gate_required=true; keep references to base_ref,
changed_files, target/debug/repovec-ci, and GITHUB_OUTPUT when implementing the
change.
🪄 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: 48a8b06e-8ae7-41be-90f3-d2d923afe936
⛔ Files ignored due to path filters (4)
crates/repovec-ci/src/snapshots/repovec_ci__tests__changed_file_docs_output.snapis excluded by!**/*.snapcrates/repovec-ci/src/snapshots/repovec_ci__tests__help_output.snapis excluded by!**/*.snapcrates/repovec-ci/src/snapshots/repovec_ci__tests__invalid_flag_error.snapis excluded by!**/*.snapcrates/repovec-ci/src/snapshots/repovec_ci__tests__stdin_empty_output.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
.github/workflows/ci.ymlcrates/repovec-ci/src/main.rsdocs/developers-guide.md
|
@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. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 6456
|
…dd test Changed the plan function in crates/repovec-ci/tests/docs_gate_policy_bdd.rs from a regular function returning a reference using as_ref().unwrap_or_else() to a const fn with a match statement for Option handling. This refactors the test code for clarity and const correctness. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Summary
Changes
Rationale
Design and policy
Workstreams (summary)
Gate names and structure
Verification and tests
Risks and mitigations
Definition of done
How to review
◳ Generated by DevBoxer ◰
ℹ️ Tag @devboxerhub to ask questions and address PR feedback
📎 Task: https://www.devboxer.com/task/a54195fa-ed7a-4ad8-b998-6e02f0892b54
Summary by Sourcery
Introduce a versioned CI gating model with explicit workflow jobs, a policy helper crate, and supporting documentation to govern required checks for code and documentation changes.
New Features:
Enhancements:
Documentation:
Tests: