Skip to content

fix(#107): add gitlint rule for forbidden type+scope combos - #119

Merged
rh-hemartin merged 2 commits into
mainfrom
agent/107-add-forbidden-type-scope-rule
Jul 13, 2026
Merged

fix(#107): add gitlint rule for forbidden type+scope combos#119
rh-hemartin merged 2 commits into
mainfrom
agent/107-add-forbidden-type-scope-rule

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Add a custom gitlint LineRule (UL1) that rejects commits using forbidden type(scope) combinations from COMMITS.md: fix(ci), feat(ci), fix(e2e), feat(e2e). Register the rule directory via extra-path in .gitlint so it runs in both the pre-commit hook and the commit-lint CI job.

Add a test script (gitlint-forbidden-type-scope-test.sh) that validates the rule rejects all four forbidden combinations (including with breaking-change markers) and accepts valid type(scope) pairs like ci(pipeline), chore(ci), fix(#123).

Note: pre-commit could not run in the sandbox (shellcheck-py install blocked by network policy, exit code 3). The post-script runs an authoritative pre-commit on the runner.


Closes #107

Post-script verification

  • Branch is not main/master (agent/107-add-forbidden-type-scope-rule)
  • Secret scan passed (gitleaks — 8fb64a25b70e4d364f6d535bb252c1bad521629d..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Add a custom gitlint LineRule (UL1) that rejects commits using
forbidden type(scope) combinations from COMMITS.md: fix(ci),
feat(ci), fix(e2e), feat(e2e). Register the rule directory via
extra-path in .gitlint so it runs in both the pre-commit hook
and the commit-lint CI job.

Add a test script (gitlint-forbidden-type-scope-test.sh) that
validates the rule rejects all four forbidden combinations
(including with breaking-change markers) and accepts valid
type(scope) pairs like ci(pipeline), chore(ci), fix(#123).

Note: pre-commit could not run in the sandbox (shellcheck-py
install blocked by network policy, exit code 3). The post-script
runs an authoritative pre-commit on the runner.

Closes #107
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 10, 2026 19:33
@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix the executable gitlint is not being installed on script-tests add it under "Install test dependencies"

@rh-hemartin rh-hemartin self-assigned this Jul 13, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ❌ Failure · Started 6:52 AM UTC · Completed 7:00 AM UTC
Commit: 2941769 · View workflow run →

@rh-hemartin
rh-hemartin force-pushed the agent/107-add-forbidden-type-scope-rule branch from 63488ea to 82e26b7 Compare July 13, 2026 07:06
The gitlint-forbidden-type-scope-test needs the gitlint executable,
which was missing from the CI install step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Hector Martinez <hemartin@redhat.com>
@rh-hemartin
rh-hemartin force-pushed the agent/107-add-forbidden-type-scope-rule branch from 82e26b7 to 1d04364 Compare July 13, 2026 07:07
@rh-hemartin
rh-hemartin added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit 6048f50 Jul 13, 2026
10 checks passed
@rh-hemartin
rh-hemartin deleted the agent/107-add-forbidden-type-scope-rule branch July 13, 2026 07:43
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 13, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 7:45 AM UTC · Completed 7:55 AM UTC
Commit: 1d04364 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

PR #119 added a custom gitlint rule (UL1) enforcing COMMITS.md forbidden type+scope combinations, closing issue #107. The code agent's implementation was functionally correct but missed updating the CI workflow to install gitlint-core as a test dependency — the sandbox pre-installed it, masking the gap. CI script-test failed. A human /fs-fix request triggered the fix agent, which correctly identified the one-line fix but could not push because modifying .github/workflows/ requires the workflows permission the GitHub App token lacks. The human manually pushed the identical fix. The post-script push error handler also misclassified the permission rejection as non-fast-forward, wasting a retry. Overall: 5 agent runs (2 triage, 2 code, 1 fix) plus significant human intervention for a 185-line change. The first code cycle (PR #110, prompt-based fix) was wasted — already tracked in issue #118.

Proposals filed

  1. Code agent should verify CI workflow installs new test dependencies it introduces — The sandbox pre-installs tools that CI may not have, causing tests to pass in-sandbox but fail in CI.
  2. Post-script push error handler should detect workflow-permission rejections distinctly — The push error grep matches 'rejected' too broadly, misclassifying permission errors as non-fast-forward and wasting a retry attempt.

Proposals filed

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.

Commit-format violations merged unaddressed despite COMMITS.md 'required change' language

1 participant