Fix GitHub Actions pipeline failures across CI, docs, and release workflows#12
Conversation
…n links Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses CI/documentation workflow failures by making report color support detection CI-aware, ensuring minimal-versions tooling dependencies are installed, and tightening test isolation around config discovery. It also updates documentation link-check configuration and adds a contributing guide, alongside broad rustfmt formatting changes.
Changes:
- Update ANSI color support detection to treat
GITHUB_ACTIONS/CIas color-capable environments. - Fix CI minimal-versions job by installing
cargo-hackin addition tocargo-minimal-versions. - Make
test_check_commanduse an explicit generated config instead of relying on ambientguardian.yamldiscovery. - Adjust markdown link-check ignores and add
CONTRIBUTING.md; apply rustfmt across touched Rust modules.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/report/mod.rs |
CI-aware ANSI color support detection; formatting-only changes elsewhere. |
src/main.rs |
Test now writes and uses an explicit temp config; formatting in command dispatch/logging. |
src/config/mod.rs |
Formatting updates; minor iterator/regex builder formatting changes. |
src/analyzer/mod.rs |
Formatting updates around rule wiring and parallel analysis loop. |
src/analyzer/rust.rs |
Formatting updates in type checks and test-only self-validation helpers. |
src/lib.rs |
Formatting updates around validator construction/await chains and cache logic. |
src/domain/violations.rs |
Formatting updates in report/error constructors and a test assertion. |
src/patterns/mod.rs |
Formatting updates across pattern engine message construction and visitors. |
src/patterns/path_filter.rs |
Formatting updates in pattern structs, directory walking, and test helper. |
src/cache/mod.rs |
Formatting updates in cache metadata default implementation. |
.github/workflows/ci.yml |
Install cargo-hack for minimal-versions job. |
.github/mlc_config.json |
Add ignore patterns for crates.io URLs and CONTRIBUTING.md. |
CONTRIBUTING.md |
New contributor guide referenced by docs. |
| // Check if colors are explicitly disabled | ||
| if std::env::var("NO_COLOR").is_ok() { | ||
| return false; | ||
| } | ||
|
|
||
| // GitHub Actions and other CI systems support ANSI colors | ||
| if std::env::var("GITHUB_ACTIONS").is_ok() || std::env::var("CI").is_ok() { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
supports_ansi_colors() treats NO_COLOR as “no ANSI support”, but validate_capabilities() will then hard-fail when use_colors is true (the default). That makes the tool error out in environments where NO_COLOR is set, instead of simply disabling colors as the variable intends. Consider honoring NO_COLOR by forcing use_colors = false (or skipping the capability error when NO_COLOR is present), so NO_COLOR never causes an otherwise-valid run to fail.
| }, | ||
| { | ||
| "pattern": "^CONTRIBUTING\\.md$" |
There was a problem hiding this comment.
Now that CONTRIBUTING.md is added to the repo and linked from the README, ignoring CONTRIBUTING.md here defeats the purpose of the link check (a future broken/renamed file link would no longer be caught). Prefer removing this ignore entry and letting the checker validate the relative link.
| }, | |
| { | |
| "pattern": "^CONTRIBUTING\\.md$" |
| - name: Install minimal-versions | ||
| run: cargo install cargo-minimal-versions | ||
| run: | | ||
| cargo install cargo-minimal-versions | ||
| cargo install cargo-hack | ||
|
|
There was a problem hiding this comment.
For CI stability/reproducibility, cargo install steps should generally use --locked (and optionally --force to avoid failures if the tool is already installed on the runner). Without --locked, upstream dependency changes can break installs and cause intermittent pipeline failures.
CI, documentation, and minimal-versions jobs were failing due to ANSI color detection, missing dependencies, test configuration, and dead link checking issues.
Changes
Color support detection for CI environments
Updated
supports_ansi_colors()insrc/report/mod.rsto recognizeGITHUB_ACTIONSandCIenvironment variables:Previously failed when
CARGO_TERM_COLOR=alwayswas set butTERMwas unset or "dumb" in CI.Minimal-versions job dependencies
Added
cargo install cargo-hackto.github/workflows/ci.yml- required bycargo-minimal-versionsbut not installed.Test configuration isolation
Modified
test_check_commandinsrc/main.rsto create explicit test config instead of relying on ambientguardian.yamldiscovery, which has exclusions that break test assertions.Documentation link checking
.github/mlc_config.jsonfor unpublished crates.io URLsCONTRIBUTING.mdreferenced in READMECode formatting
Applied
rustfmtacross codebase.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.