Skip to content

feat(ci): enforce rust crate registration in codecov coverage (#155)#449

Merged
WilliamBerryiii merged 32 commits intomainfrom
feat/issue-155-rust-coverage-codecov
May 6, 2026
Merged

feat(ci): enforce rust crate registration in codecov coverage (#155)#449
WilliamBerryiii merged 32 commits intomainfrom
feat/issue-155-rust-coverage-codecov

Conversation

@WilliamBerryiii
Copy link
Copy Markdown
Member

Summary

Enforces Rust crate registration for Codecov coverage reporting (#155) by adding a validation script, CI gate, and authoring guidance.

Changes

  • New: scripts/Validate-RustCrateRegistration.ps1 — validates every Cargo.toml under src/500-application/ is registered for CI test/coverage and Codecov reporting.
  • New: scripts/tests/Validate-RustCrateRegistration.Tests.ps1 — Pester suite for the validator.
  • New: .github/workflows/validate-rust-registration.yml — CI gate running the validator on PRs.
  • New: .github/instructions/rust-crate-registration.instructions.md — authoring guidance for crate registration.
  • Update: .github/instructions/README.md — index entry for the new instructions.
  • Update: .github/workflows/rust-tests.yml — trigger on Cargo.lock changes.
  • Update: codecov.yml — align ignore patterns with the validator.
  • Update: scripts/Invoke-Pester.ps1 — default OutputPath to ./logs/pester.

Validation

  • Pester: 19 passed / 2 skipped.

Related

…eam hve-core pattern

- add .github/workflows/rust-tests.yml with 3-crate matrix using cargo-llvm-cov

- add repo-root codecov.yml registering the rust flag with carryforward

- pin codecov-action@57e3a136... (v6.0.0) and use OIDC per upstream

- ignore wasm32-wasip2 crates and target/** from coverage

- leave azure-pipelines.yml unchanged

Resolves #155

Generated by Copilot
@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner April 26, 2026 05:11
- add Validate-RustCrateRegistration.ps1 with Pester suite
- add validate-rust-registration.yml CI gate
- add rust-crate-registration.instructions.md and index link
- align codecov.yml ignores with validator
- trigger rust-tests.yml on Cargo.lock changes

🦀 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii force-pushed the feat/issue-155-rust-coverage-codecov branch from 34c10da to d35e8f0 Compare April 26, 2026 16:41
- convert rust-tests.yml to workflow_call with id-token: write for codecov OIDC
- repin Swatinem/rust-cache to v2.9.1 (fix invalid v2.9.4 SHA)
- add rust-tests reusable job to pr-validation.yml and main.yml

🔒 - Generated by Copilot
…kflow

- add pull_request and push path filters for rust crate roots
- correct matrix entries to include /services/ segment

🔒 - Generated by Copilot
- update Validate-RustCrateRegistration.ps1 default OutputPath to logs/

- update validate-rust-registration.yml artifact path to logs/rust-crate-registration-report.json

📦 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii marked this pull request as draft April 27, 2026 04:46
…nd actions/cache

- replace dtolnay/rust-toolchain with shell rustup install
- replace Swatinem/rust-cache with SHA-pinned actions/cache@v4.3.0
- replace taiki-e/install-action with cargo install cargo-llvm-cov --locked

🔒 - Generated by Copilot
- generate cyclonedx SBOM of runner filesystem with Syft v1.17.0

- scan SBOM with Grype v0.86.1 (fail-on high)

- upload SBOM artifact for 30 day retention

- document Syft in ACTIONS-SECURITY verified binaries list

🔒 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii marked this pull request as ready for review April 27, 2026 05:39
Copy link
Copy Markdown
Collaborator

@katriendg katriendg left a comment

Choose a reason for hiding this comment

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

PR Review Summary

Reviewed all 11 changed files. Found 6 review items — 2 critical, 1 high, 1 medium, 2 low.

🔴 Critical

  • RI-1: Invoke-Pester.ps1 output path change breaks artifact upload in pr-validation.yml (path mismatch: logs/pester/ vs test-results/)
  • RI-2: Grype SBOM scan (--fail-on high) blocks all Rust test execution — most likely root cause of current pipeline failures

🟡 High

  • RI-3: Rust test coverage jobs run unconditionally on every PR (no path filtering) — performance regression for all PRs

🟠 Medium

  • RI-4: Instructions reference on.pull_request.paths / on.push.paths sections that don't exist in the workflow_call-only rust-tests.yml

🟢 Low

  • RI-5: All matrix entries install ffmpeg libs even though only 503-media-capture-service needs them
  • RI-6: upload-artifact version inconsistency between validate-rust-registration.yml (v7) and rest of repo (v4)

Existing App Impact

✅ No application source code is modified — build/deploy for existing apps is unaffected
⚠️ Pester test artifacts will silently stop uploading (RI-1)
⚠️ All PRs get 3 additional heavy CI jobs regardless of content (RI-3)

Comment thread scripts/Invoke-Pester.ps1 Outdated
Comment thread .github/workflows/rust-tests.yml Outdated
Comment thread .github/workflows/pr-validation.yml
Comment thread .github/instructions/rust-crate-registration.instructions.md
Comment thread .github/workflows/rust-tests.yml Outdated
Comment thread .github/workflows/validate-rust-registration.yml
…500-application crates

- broaden Test-IsRustChangeFile regex to match all crates under src/500-application/**

- add Pester test suite (20 tests) covering positive/negative cases

🔒 - Generated by Copilot
…changes gate, bump action SHAs

🔒 - Generated by Copilot
…ator

- expand rust-tests.yml matrix to 9 src/500-application crates

- fix vuln-scan index range from [0,1,2] to [0..8]

- opt out 4 WASM cdylib crates in codecov.yml ignore

- fix Validate-RustCrateRegistration.ps1 object-form include parser

- sync rust-crate-registration.instructions.md with new matrix

🔒 - Generated by Copilot
- resolve PSUseSingularNouns and Get verb misuse for boolean predicate

- update all call sites and Pester tests

🔒 - Generated by Copilot
@WilliamBerryiii
Copy link
Copy Markdown
Member Author

Thanks for the review! All comments have been addressed and replied to. Additionally, the PowerShell Lint CI failure was fixed by renaming Get-RustHasChanges -> Test-RustHasChange (commit 005ecd1) to satisfy the PSUseSingularNouns rule. PowerShell Lint is now passing. Could you take another look when you have a moment? @katriendg

… verification

sha256sum -c reads filenames from upstream *_checksums.txt and looks for those exact names on disk. Saving tarballs as syft.tar.gz / grype.tar.gz caused (syft) or risked (grype) 'No such file or directory' verification failures. Introduce *_TARBALL variables holding canonical upstream filenames.

🔒 - Generated by Copilot
…tests

- Syft rejects absolute /path/** exclusion patterns; must start with ./, */, or **/
- replace 8 absolute exclude paths with ./ prefix relative to scan root

🛠️ - Generated by Copilot
@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@github-actions
Copy link
Copy Markdown

📚 Documentation Health Report

Generated on: 2026-04-29 03:18:07 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 44
AI Assistant Guides (Copilot) 17
Total 514

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

…y assert

- multi_trigger: classify any topic containing 'alert' as Alert

- ai-edge-inference backend test: gate available_backends assertion on onnx-runtime/candle features
@WilliamBerryiii WilliamBerryiii force-pushed the feat/issue-155-rust-coverage-codecov branch from 097b975 to 1d4cdb1 Compare April 29, 2026 05:01
Copy link
Copy Markdown
Collaborator

@katriendg katriendg left a comment

Choose a reason for hiding this comment

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

Thanks, looking good and great to have this added.

Just nit comments, and then the agent also recommends checking if the following changes are intentional:

  • src/500-application/503-media-capture-service/.../multi_trigger.rs - Alert classification was loosened from t.contains("alert") && t.contains("trigger") to just t.contains("alert"). This is a real runtime behavior change: any topic containing "alert" (e.g. alerts/state, device/alerted) now classifies as MessageType::Alert. Not a CI fix.

  • 507-ai-inference/.../topic_router.rs - Test fixture rewritten from a nested outputs: vec![ModelOutput { predictions: ... }] shape with SiteContext to a flat predictions / model_type: String shape, and an assertion swapped from site_id to model_name in a custom-route template. Tests now compile against a different InferenceResult shape. If InferenceResult was already migrated upstream, this is alignment; otherwise it's a divergence. Worth confirming the type definition matches.

Comment thread .gitignore Outdated
Comment thread codecov.yml
- wrap syft tarball and checksum fetches in 5-attempt retry with backoff

- mitigate transient GitHub releases 502s in CI

🔒 - Generated by Copilot
- add sparse checkout step to vuln-scan job to fetch .grype.yaml

- pass --config .grype.yaml to grype scan command

- ignore GHSA-rp8m-h266-53jh (grype 0.86.1 pep440 inflate bug on dpkg version)

🔒 - Generated by Copilot
Replace syft scan dir:/ (with 8 runner-path excludes) with syft scan dir:. so the SBOM only covers checked-out sources. Runner OS / toolchain CVEs are GitHub's responsibility and not gated by this workflow. Also drop a stale .gitignore entry for docs/merge-override-diagnosis.md (file is not tracked).

🔒 - Generated by Copilot
Copy link
Copy Markdown
Contributor

@auyidi1 auyidi1 left a comment

Choose a reason for hiding this comment

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

looks like some checks are failing, but I'm sure you already have a handle of that.

WilliamBerryiii and others added 3 commits May 4, 2026 11:46
Wraps both apt-get steps in coverage job in 5-attempt retry loops with exponential backoff (10s/20s/30s/40s/50s) to recover from transient azure.archive.ubuntu.com DNS resolution failures observed in run 25237983594. Mirrors the curl retry pattern introduced in 05f6a05 for the syft download.
@WilliamBerryiii WilliamBerryiii merged commit 9b33d69 into main May 6, 2026
53 checks passed
@WilliamBerryiii WilliamBerryiii deleted the feat/issue-155-rust-coverage-codecov branch May 6, 2026 04:03
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.

ci(rust-coverage): add Rust code coverage reporting

4 participants