Skip to content

chore: add lint-workflow-size to cap workflow file growth#791

Merged
ralphbean merged 3 commits into
mainfrom
chore/lint-workflow-size
May 11, 2026
Merged

chore: add lint-workflow-size to cap workflow file growth#791
ralphbean merged 3 commits into
mainfrom
chore/lint-workflow-size

Conversation

@ralphbean
Copy link
Copy Markdown
Contributor

@ralphbean ralphbean commented May 9, 2026

Summary

  • Adds hack/lint-workflow-size, a pre-commit linter that caps workflow YAML files at 200 lines by default
  • Files over the cap need an explicit # lint-workflow-size: max-lines=N override comment, making growth intentional and reviewable
  • Covers both .fullsend agent workflows and the shim template
  • Error messages reference ADR-0005 (forge abstraction layer) and guide toward extracting logic into scripts/

Motivated while reviewing #729, where ~85 lines of inline shell were added to review.yml. The established pattern (used by fix.yml, pre-review.sh, etc.) is to keep workflow files as thin GitHub-specific glue and put testable logic in scripts/. This linter enforces that pattern going forward.

Current overrides

File Lines Cap
fix.yml 305 310
prioritize-scheduler.yml 213 220
shim-workflow.yaml 469 475

All other workflow files are under the 200-line default.

Test plan

  • make lint passes
  • pre-commit run lint-workflow-size --all-files passes
  • Verified linter catches violations (file over cap → error with actionable message)
  • Verified per-file override works

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

fullsend review is working on this — view logs

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Site preview

Preview: https://c5689582-site.fullsend-ai.workers.dev

Commit: 5dec679e97b3cc8f2b4f33d2a7bbc2172b70e7ec

@ralphbean ralphbean added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@ralphbean ralphbean force-pushed the chore/lint-workflow-size branch from 355e0f1 to 0f11b9c Compare May 11, 2026 14:09
@github-actions
Copy link
Copy Markdown

fullsend review is working on this — view logs

@fullsend-ai-review
Copy link
Copy Markdown

fullsend-ai-review Bot commented May 11, 2026

Review: #791

Head SHA: 5dec679
Timestamp: 2026-05-11T00:00:00Z
Outcome: approve

Summary

Clean, well-scoped addition of a pre-commit linter that caps workflow YAML file growth. The bash script is correct — proper error handling (set -euo pipefail), safe glob iteration, and a reviewable per-file override mechanism. The pre-commit hook configuration follows the established hack/lint-* pattern. All override caps are verified to exceed their respective file sizes on the PR branch. No security, injection, or style concerns.

Findings

Info

  • [stale-docs] PR body table — The PR description claims shim-workflow.yaml is 469 lines (cap 475), but on current main it is 528 lines and on this branch it is 529 lines (cap 535). The code is correct; only the PR body table is stale. No action required.

Footer

Outcome: approve
This review applies to SHA 5dec679e97b3cc8f2b4f33d2a7bbc2172b70e7ec. Any push to the PR head clears this review and requires a new evaluation.


Protected paths detected — this PR modifies files under one or more
protected paths. The review agent cannot approve PRs that touch these paths.
A human reviewer must approve this PR.

Protected files in this PR:

  • .pre-commit-config.yaml
Previous run

Review: #791

Head SHA: 9317f6d
Timestamp: 2026-05-11T00:00:00Z
Outcome: approve

Summary

Clean, well-scoped addition of a workflow file size linter that enforces an existing architectural pattern (workflow files as thin GitHub-specific glue, logic in scripts/). The script is correctly implemented with proper error handling (set -euo pipefail, guarded grep), follows established hack/ linter conventions, and the pre-commit integration is properly scoped. No correctness, security, or injection concerns found.

Findings

Info

  • [correctness] PR description — The "Current overrides" table in the PR body claims shim-workflow.yaml is 469 lines with cap 475, but the actual file is 528 lines and the code override is max-lines=535. The code is correct; only the description table is stale. No action required.

Footer

Outcome: approve
This review applies to SHA 9317f6daa4bdead87e60520b970c07f31ea98ecc. Any push to the PR head clears this review and requires a new evaluation.


Protected paths detected — this PR modifies files under one or more
protected paths. The review agent cannot approve PRs that touch these paths.
A human reviewer must approve this PR.

Protected files in this PR:

  • .pre-commit-config.yaml
Previous run (2)

Review: #791

Head SHA: 0f11b9c
Timestamp: 2026-05-11T00:00:00Z
Outcome: request-changes

Summary

The linter script is well-structured and the approach of capping workflow file size is sound. However, the PR branch is stale relative to main: PR #785 rewrote shim-workflow.yaml to 528 lines, but this PR sets the override cap at 475. The linter will fail immediately after merge. The override must be updated to accommodate the current file size. Additionally, the script uses grep -oP (PCRE), which is not available on macOS BSD grep — a portability concern for pre-commit hooks.

Findings

High

  • [Correctness] internal/scaffold/fullsend-repo/templates/shim-workflow.yaml — Stale override cap will break the build. The file is 528 lines on current main (after PR fix: restore automatic triage on issue open/edit #785 merged), but the override is set to max-lines=475. After merge (529 lines with the added comment), the linter will immediately fail. The PR was branched before fix: restore automatic triage on issue open/edit #785 landed.
    Remediation: Rebase onto current main and update the override to at least max-lines=535 (or whatever the post-rebase line count requires, with reasonable headroom).

Medium

  • [Correctness] hack/lint-workflow-size:42grep -oP uses Perl-Compatible Regular Expressions (PCRE), which is not supported by macOS BSD grep. While the primary dev environment appears to be Linux-based (devaipod), pre-commit hooks run on any developer machine. This will produce a silent failure (|| true swallows the error) and fall back to the default cap, masking intentional overrides on macOS.
    Remediation: Replace with a POSIX-compatible alternative, e.g.: grep -o 'max-lines=[0-9]*' "${file}" | grep -o '[0-9]*' | tail -1

Footer

Outcome: request-changes
This review applies to SHA 0f11b9c64feffab19c0fe6026d3a3bdd09430a54. Any push to the PR head clears this review and requires a new evaluation.

Copy link
Copy Markdown

@fullsend-ai-review fullsend-ai-review Bot left a comment

Choose a reason for hiding this comment

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

See the review comment for full details.

@github-actions
Copy link
Copy Markdown

fullsend fix is working on this — view logs

@github-actions
Copy link
Copy Markdown

fullsend review is working on this — view logs

ralphbean and others added 3 commits May 11, 2026 10:33
Workflow files are GitHub-specific glue. Logic that accumulates
in them binds us to GitHub Actions and can't be unit tested.
This linter caps workflow YAML files at 200 lines by default,
encouraging extraction to scripts/ (the established pattern).

Files that are already over the cap get per-file overrides via
a comment (e.g. # lint-workflow-size: max-lines=310). The cap
can be raised intentionally — the linter just makes growth
visible and reviewable.

Covers both .fullsend agent workflows and the shim template.
References ADR-0005 (forge abstraction layer).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The shim-workflow.yaml grew past the 475-line cap after concurrent
merges landed on main. Bump the override to 535 to accommodate the
current 529 lines with a small buffer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump shim-workflow.yaml max-lines from 475 to 535 (file grew to 529
  after PR #785 merged)
- Replace grep -oP (PCRE, Linux-only) with POSIX-compatible grep chain
  so the override detection works on macOS BSD grep too

Addresses both findings from fullsend-ai-review.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ralphbean ralphbean force-pushed the chore/lint-workflow-size branch from 9317f6d to 5dec679 Compare May 11, 2026 14:33
@github-actions
Copy link
Copy Markdown

fullsend review is working on this — view logs

@ralphbean ralphbean added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 85c1ea4 May 11, 2026
14 checks passed
@ralphbean ralphbean deleted the chore/lint-workflow-size branch May 11, 2026 15:02
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.

2 participants