Skip to content

fix(lint): opt in to recoverable workflow-file fixes - #1162

Merged
devantler merged 6 commits into
mainfrom
codex/lint-workflow-fixes-703
Sep 6, 2026
Merged

fix(lint): opt in to recoverable workflow-file fixes#1162
devantler merged 6 commits into
mainfrom
codex/lint-workflow-fixes-703

Conversation

@devantler

@devantler devantler commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Formatter changes to GitHub workflow files cannot be committed by the contents-only signer, leaving contributors without a usable fix. Both lint workflows now offer a default-off manual-workflow-fixes option that retains the complete patch for manual application, including when linting also reports an unfixable error. Related edits and renames stay together, ordinary fixes retain their existing route, and lint failures still block the run. Consumer rollout and flag removal are tracked in #1186.

Fixes #703

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 0.47s
✅ GO revive 2 0 0 8.36s
✅ REPOSITORY betterleaks yes no no 0.53s
✅ REPOSITORY checkov yes no no 16.83s
✅ REPOSITORY git_diff yes no no 0.02s
✅ REPOSITORY osv-scanner yes no no 0.77s
✅ REPOSITORY secretlint yes no no 0.88s
✅ REPOSITORY syft yes no no 2.09s
✅ REPOSITORY trivy yes no no 11.12s
✅ REPOSITORY trivy-sbom yes no no 0.11s
✅ REPOSITORY trufflehog yes no no 5.88s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters COPYPASTE_JSCPD,GO_REVIVE,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Validation at c7e6404: 20 real-Git patch scenarios pass across both lint workflows, including complete patch replay, additions, deletions, mixed edits, and renames. Signing, strict read-only behavior, mode handling, and credential-boundary regressions pass locally and the relevant GitHub CI jobs pass. Self-review of correctness, simplification, and the permission boundary found no remaining issue in this diff.

The local actionlint and Zizmor diagnostics were compared against the unmodified base: 3 existing actionlint compatibility diagnostics and 70 existing low-severity self-repository advisories, with no new findings. GitHub's workflow vulnerability and CodeQL checks passed.

CI finished with the macOS setup-ksail-cli job failing on generated Homebrew casks with Missing URL for Intel macOS; the aggregate required check consequently failed. Tracked in #1166 with source and job evidence. This is a deterministic tap-loading error, so it was not blindly rerun. Draft retained and external review deferred until CI is green.

Permission rationale: workflow-file writes require separate authority (GitHub documentation); this repair leaves the signer contents-only and offers a complete recoverable patch instead.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

The installer prerequisite #1167 is merged at 9661529. Updated this draft to include that exact repaired base; current head is 2556fcb.

All 20 workflow-patch fixtures pass on this updated head. The fixes also compose cleanly with the other Actions drafts. Fresh GitHub CI is running with no observed failures so far. This remains a draft until full current-head CI and a fresh substantive review pass; the old macOS failure is superseded by this new run.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Validation at 09c05cb against base 065a725:

The full current-head CI is green. Re-ran 28 real-Git patch fixtures, including binary payloads and executable mode changes alone and mixed with workflow edits. Replay clones transfer only committed objects, so the artifact must supply the complete result. Removing binary export independently from each production workflow fails with the expected patch-application error. ShellCheck, the combined three-draft CI wiring guard, and patch/trigger regressions pass. The manual artifact path was exercised by applying patches to fresh repositories and comparing resulting Git trees. Self-review found no remaining correctness, simplification, or credential-boundary finding.

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

@devantler I will perform a full review of the current pull request changes.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 56 minutes.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Team

Run ID: 34bb0c6a-a45c-4ea3-94c7-75bdfd81a92d

📥 Commits

Reviewing files that changed from the base of the PR and between d36022b and 8c2ebe9.

📒 Files selected for processing (6)
  • .github/tests/test-lint-workflow-fixes.sh
  • .github/workflows/ci.yaml
  • .github/workflows/lint.yaml
  • .github/workflows/validate-go-project.yaml
  • AGENTS.md
  • README.md

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.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Validation at 8c2ebe9 against base d36022b:

The full current-head CI is green. Re-ran 28 real-Git patch fixtures, including binary payloads and executable mode changes alone and mixed with workflow edits. Replay clones transfer only committed objects, so the artifact must supply the complete result. Removing binary export independently from each production workflow fails with the expected patch-application error. ShellCheck, the combined three-draft CI wiring guard, and patch/trigger regressions pass. The manual artifact path was exercised by applying patches to fresh repositories and comparing resulting Git trees. Self-review found no remaining correctness, simplification, or credential-boundary finding.

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

@devantler I will perform a full review of the current pull request changes.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 39 minutes.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

cr:no-gate@8c2ebe9 — the current round's CodeRabbit invocation reply explicitly reports Review rate limited after the 16:52:52Z request. Full CI run 34046359052 succeeded at this same head; all eight workflows are terminal, with 116 successful and 86 skipped checks. The current-head 28-case patch recovery and credential/signature checks passed locally and in GitHub CI.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T16:59:22.470893Z 8c2ebe9 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c2ebe979e

ℹ️ 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".

Comment thread .github/workflows/lint.yaml
Comment thread .github/workflows/lint.yaml
@devantler devantler changed the title fix(lint): preserve workflow fixes for manual application fix(lint): opt in to recoverable workflow-file fixes Sep 6, 2026
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Validation at f31c289 against base d36022b: full current-head CI is green. Both previous Codex findings are fixed with replies and resolved threads. Manual routing and recovery now require the default-off manual-workflow-fixes option; rollout/removal is tracked in #1186. Both states are instantiated in hosted CI.

RED reproduced loss of recovery after a lint failure. GREEN covers 3,456 status/input/authority cases and rejects 12 targeted gate mutations. Both production exporters replay 56 real Git fixtures in clean clones, including binary payloads, executable-bit changes, additions, deletions, renames, and mixed fixes. Removing binary payload export fails replay. Signed-fix, credential-boundary, and Go-maintenance regressions pass. The two remaining Actions drafts also pass their combined wiring/recovery/signing contract tests. ShellCheck passes with the existing literal-expression exception; actionlint has only the same three base-version compatibility diagnostics. Zizmor reports only the existing same-repository-call advisory category, including the two added safe CI invocations. No write credential or signer permission was added. Self-review found no remaining correctness, security, or simplification finding.

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="devantler-tech/actions"
pr="1162"

echo "== PR metadata =="
gh pr view "$pr" --repo "$repo" --json number,title,baseRefOid,headRefOid,files,commits \
  --jq '{number,title,baseRefOid,headRefOid,files:[.files[].path],commits:[.commits[].oid]}'

echo
echo "== Changed-file status =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate \
  --jq '.[] | [.status, .filename, .previous_filename // ""] | `@tsv`'

echo
echo "== Pull request diff =="
gh pr diff "$pr" --repo "$repo" --patch

echo
echo "== Repository workflow and shell file map =="
fd -t f -e yml -e yaml -e sh .github . 2>/dev/null | sort | sed -n '1,300p'

echo
echo "== AST outlines for changed source candidates =="
changed_files="$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate --jq '.[].filename')"
while IFS= read -r file; do
  case "$file" in
    *.sh|*.bash|*.yml|*.yaml)
      if [ -f "$file" ]; then
        echo "--- $file ---"
        ast-grep outline "$file" --items all 2>&1 || true
      fi
      ;;
  esac
done <<< "$changed_files"

Length of output: 56767


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== lint workflow: inputs, lint job, and downstream fix consumer =="
nl -ba .github/workflows/lint.yaml | sed -n '1,210p'
rg -n -C 5 'fixes-created|fixes-artifact|apply-signed-fixes|manual-workflow-fixes|upload-artifact' \
  .github/workflows/lint.yaml .github/workflows/ci.yaml .github/workflows/validate-go-project.yaml

echo
echo "== Validate Go workflow: inputs, lint job, and signed-fix consumers =="
nl -ba .github/workflows/validate-go-project.yaml | sed -n '1,105p'
nl -ba .github/workflows/validate-go-project.yaml | sed -n '555,745p'
rg -n -C 8 'uses: .*apply-signed-fixes|fixes-created|fixes-artifact|needs\.lint' \
  .github/workflows/validate-go-project.yaml .github/workflows/ci.yaml

echo
echo "== All reusable-workflow callers and manual flag occurrences =="
rg -n -C 4 'uses:\s+\./\.github/workflows/(lint|validate-go-project)\.yaml|manual-workflow-fixes' \
  -g '*.yml' -g '*.yaml' .

echo
echo "== Recovery-gate test script =="
nl -ba .github/tests/test-lint-recovery-gates.sh | sed -n '1,180p'

echo
echo "== Patch-export test script =="
nl -ba .github/tests/test-lint-workflow-fixes.sh | sed -n '1,180p'

echo
echo "== Existing signer contract test relevant sections =="
nl -ba .github/tests/test-validate-go-signed-fixes-contract.sh | sed -n '1,180p'

echo
echo "== Action upload configuration references =="
rg -n -C 4 'actions/upload-artifact@|path:|if-no-files-found|retention-days' \
  .github/workflows/lint.yaml .github/workflows/validate-go-project.yaml

Length of output: 1931


🏁 Script executed:

#!/bin/bash
set -euo pipefail

numbered() {
  awk -v start="$2" -v end="$3" 'NR >= start && NR <= end { printf "%6d  %s\n", NR, $0 }' "$1"
}

echo "== lint workflow: inputs, lint job, and downstream fix consumer =="
numbered .github/workflows/lint.yaml 1 210
rg -n -C 5 'fixes-created|fixes-artifact|apply-signed-fixes|manual-workflow-fixes|upload-artifact' \
  .github/workflows/lint.yaml .github/workflows/ci.yaml .github/workflows/validate-go-project.yaml || true

echo
echo "== Validate Go workflow: inputs, lint job, and signed-fix consumers =="
numbered .github/workflows/validate-go-project.yaml 1 105
numbered .github/workflows/validate-go-project.yaml 555 745
rg -n -C 8 'uses: .*apply-signed-fixes|fixes-created|fixes-artifact|needs\.lint' \
  .github/workflows/validate-go-project.yaml .github/workflows/ci.yaml || true

echo
echo "== All reusable-workflow callers and manual flag occurrences =="
rg -n -C 4 'uses:\s+\./\.github/workflows/(lint|validate-go-project)\.yaml|manual-workflow-fixes' \
  -g '*.yml' -g '*.yaml' . || true

echo
echo "== Recovery-gate test script =="
numbered .github/tests/test-lint-recovery-gates.sh 1 180

echo
echo "== Patch-export test script =="
numbered .github/tests/test-lint-workflow-fixes.sh 1 180

echo
echo "== Existing signer contract test relevant sections =="
numbered .github/tests/test-validate-go-signed-fixes-contract.sh 1 180

echo
echo "== Action upload configuration references =="
rg -n -C 4 'actions/upload-artifact@|path:|if-no-files-found|retention-days' \
  .github/workflows/lint.yaml .github/workflows/validate-go-project.yaml || true

Length of output: 148633


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="devantler-tech/actions"
pr="1162"
base="d36022bf2f4e01d16e8f8b540231e9338252bc1d"

echo "== Current PR check status =="
gh pr checks "$pr" --repo "$repo" --required=false || true

echo
echo "== Workflow YAML parse results =="
for file in .github/workflows/ci.yaml .github/workflows/lint.yaml .github/workflows/validate-go-project.yaml; do
  printf '%s: ' "$file"
  yq -e '.' "$file" >/dev/null
  echo "valid"
done

echo
echo "== Diff whitespace check =="
git diff --check "$base"...HEAD

echo
echo "== Head and base verification =="
printf 'HEAD: '
git rev-parse HEAD
printf 'Merge base: '
git merge-base "$base" HEAD

echo
echo "== Changed-file modes =="
git diff --summary "$base"...HEAD

Length of output: 33066


@devantler Full review complete. I found no blocking issue.

I verified the workflow recovery gates, artifact routing, signer boundary, and regression coverage. The exporters retain complete binary patches. Opted-in workflow-file patches do not reach the automatic signer. Failed lint runs can upload an opted-in recovery patch. Cancelled runs do not recover patches.

CI - Required Checks passed at f31c2895e3fca0ae3447c2bb44fe6de2f44ddb2c. The dedicated manual-workflow-fixes jobs and the recovery contract checks also passed.

You are interacting with an AI system.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Ready at f31c289 against base d36022b: all 120 applicable checks passed (99 intentional skips). CodeRabbit completed a substantive full review of this exact head in #1162 (comment), with no blocking issue or actionable finding. Both earlier Codex findings have concrete fixes, regression coverage, replies, and resolved threads.

User-path validation replayed all 56 complete patch fixtures in clean clones. The 3,456 status/authority cases, 12 gate mutations, both hosted flag-state calls, and existing signing/credential regressions passed. Full CI: https://github.com/devantler-tech/actions/actions/runs/34048298168 . The recovery option remains default-off with consumer rollout/removal tracked in #1186. Self-review is complete. Promoting for final merge preflight.

@devantler
devantler marked this pull request as ready for review September 6, 2026 17:31
@devantler
devantler merged commit d775642 into main Sep 6, 2026
222 checks passed
@devantler
devantler deleted the codex/lint-workflow-fixes-703 branch September 6, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

MegaLinter auto-fix push fails whenever it reformats a workflow file, and only once the gate is green

1 participant