Skip to content

feat: implement issue #410 — [Fleet Monitor] petry-projects/ContentTwin — .github/workflows/ci.yml - #411

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-410-20260803-1023
Aug 3, 2026
Merged

feat: implement issue #410 — [Fleet Monitor] petry-projects/ContentTwin — .github/workflows/ci.yml#411
don-petry merged 2 commits into
mainfrom
dev-lead/issue-410-20260803-1023

Conversation

@don-petry

@don-petry don-petry commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

User description

Closes #410

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Verify shfmt downloads before using them in CI

What Changed

  • CI now checks the downloaded shfmt binary against a pinned checksum before installing it
  • Corrupt or incomplete downloads are retried up to three times instead of causing an immediate formatting failure
  • Added coverage to ensure checksum verification remains inside the retry process

Impact

✅ Fewer CI formatting failures from corrupt downloads
✅ Safer shfmt installation
✅ More reliable retry behavior

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • CI Improvements

    • Improved formatting-tool installation reliability by pinning the version and verifying downloads with a checksum.
    • Added automatic retries for failed downloads or verification checks.
  • Tests

    • Added coverage to ensure the CI workflow performs checksum verification correctly.

@don-petry
don-petry requested a review from a team as a code owner August 3, 2026 10:30
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codeant-ai

codeant-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 96cf9b8 Aug 03, 2026 · 10:30 10:31

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f854be3a-ea12-4b68-b203-3cdf56c42a32

📥 Commits

Reviewing files that changed from the base of the PR and between 96cf9b8 and 39caa42.

📒 Files selected for processing (1)
  • scripts/tests/ci-workflow.bats
📝 Walkthrough

Walkthrough

The CI workflow now downloads a pinned shfmt version to a temporary path, verifies its SHA256 checksum during retries, and installs it after verification. A Bats test checks the checksum configuration and validation order.

Changes

shfmt download verification

Layer / File(s) Summary
Verified shfmt installation and workflow validation
.github/workflows/ci.yml, scripts/tests/ci-workflow.bats
The workflow verifies the pinned shfmt download with sha256sum -c during each retry before installation. The Bats test checks the checksum variable and validation placement.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: donpetry-bot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies issue #410 and the affected CI workflow, and it is related to the pull request changes.
Linked Issues check ✅ Passed The changes improve CI workflow reliability by verifying and retrying the shfmt download, addressing the degraded workflow objective in [#410].
Out of Scope Changes check ✅ Passed The changes are limited to shfmt installation hardening and its CI test, which are within the scope of [#410].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 dev-lead/issue-410-20260803-1023

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 3, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds a new BATS test to verify that the shfmt installation step in the CI workflow pins a checksum and performs verification inside the retry loop. The reviewer suggested refactoring the inline Python script to avoid redundant function calls and add defensive checks to ensure each step is a dictionary before accessing its properties.

Comment thread scripts/tests/ci-workflow.bats Outdated
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #411
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-03T11:01:43Z

@don-petry

Copy link
Copy Markdown
Contributor Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-08-03T11:01:43Z

@don-petry
don-petry enabled auto-merge (squash) August 3, 2026 10:31

@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 `@scripts/tests/ci-workflow.bats`:
- Around line 150-155: Strengthen the assertions around the retry-loop script in
the install verification test by requiring the shfmt installation command to
appear after `sha256sum -c` and within the checksum-success `if` branch.
Preserve the existing checks that validation occurs inside the retry loop, using
the `script` and `body` assertions to verify both ordering and successful-path
containment.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4cdeeea6-0078-4faa-a7e6-952ffe5fddad

📥 Commits

Reviewing files that changed from the base of the PR and between a24f254 and 96cf9b8.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • scripts/tests/ci-workflow.bats

Comment thread scripts/tests/ci-workflow.bats
@don-petry
don-petry disabled auto-merge August 3, 2026 10:35
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 3, 2026 10:39
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge August 3, 2026 10:39
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 3, 2026 10:41

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 39caa42fbc30ed832f03b4edac106a6814290b9b
Review mode: triage-approved (single reviewer)

Summary

Hardens the shfmt installation step in .github/workflows/ci.yml: pins the version via env var, downloads to a temp path, verifies the binary against a pinned SHA256 checksum inside the existing 3-attempt retry loop, and only installs on successful verification. Adds a Bats test asserting the checksum is pinned, verification precedes installation, installation stays in the success branch, and verification runs inside the retry loop. The pinned checksum was independently verified against the official mvdan/sh v3.10.0 sha256sums.txt release asset — it matches exactly.

Linked issue analysis

Closes #410 (Fleet Monitor: ci.yml DEGRADED, 50% failure rate). The issue flags CI formatting failures from the shfmt download; this PR makes truncated/corrupt HTTP-200 downloads (which curl exits 0 on) fail checksum verification and retry instead of hard-failing the job. Substantively addresses the issue.

Findings

No blocking findings.

  • Checksum 1f57a384d59542f8fac5f503da1f3ea44242f46dff969569e80b524d64b71dbc matches the official shfmt v3.10.0 linux_amd64 checksum (verified against the upstream release sha256sums.txt).
  • Security posture is improved: download moved out of /usr/local/bin until verified, install -m 0755 replaces bare chmod, --proto '=https' retained.
  • Both prior review threads (gemini-code-assist, CodeRabbit) are resolved; the CodeRabbit suggestion to assert checksum-before-install ordering was addressed in commit 39caa42.
  • Secret-scanning MCP tool unavailable in this environment; gitleaks CI check passed and the only hex string in the diff is a public release checksum, not a secret.

CI status

All checks green: CI (Lint, Format, Test, Secret scan/gitleaks), CodeQL (actions), SonarCloud Quality Gate passed (0 new issues, 0 hotspots), AgentShield, CodeRabbit, Graphite AI Reviews. Dependency-audit sub-jobs skipped (no matching ecosystems). No failures or pending checks.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 438dc98 into main Aug 3, 2026
23 checks passed
@don-petry
don-petry deleted the dev-lead/issue-410-20260803-1023 branch August 3, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet Monitor] petry-projects/ContentTwin — .github/workflows/ci.yml

2 participants