Skip to content

ci: vendor validation scripts and remove remote action pins - #52

Merged
hyperpolymath merged 1 commit into
mainfrom
fix-ci-actions
Jul 27, 2026
Merged

ci: vendor validation scripts and remove remote action pins#52
hyperpolymath merged 1 commit into
mainfrom
fix-ci-actions

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Automated PR to fix CI after deleted actions.


Summary by Gitar

  • CI Workflows:
    • Vendored A2ML and K9 validation scripts into .githooks/
    • Replaced remote action pins with local script executions in dogfood-gate.yml

This will update automatically on new commits.

Comment thread .githooks/validate-k9.sh
Comment thread .githooks/validate-k9.sh
@gitar-bot

gitar-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Vendors validation scripts locally and updates the CI workflow to execute them directly, though line parsing currently breaks on CRLF and annotations emit with line=0 for early issues.

Auto-approved: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria.

✅ 2 resolved
Edge Case: Line parsing breaks on CRLF and missing trailing newline

📄 .githooks/validate-k9.sh:122-131 📄 .githooks/validate-k9.sh:133 📄 .githooks/validate-k9.sh:169-183 📄 .githooks/validate-a2ml.sh:102-111 📄 .githooks/validate-a2ml.sh:128-142 📄 .githooks/validate-a2ml.sh:239-253 📄 .githooks/validate-a2ml.sh:270-280
Both validators parse files with while IFS= read -r line. Two edge cases can produce spurious failures: (1) A file with CRLF (\r
) endings leaves a trailing carriage return on each line, so the K9 magic-number check [[ "$first_content_line" != "K9!" ]] sees K9!\r and reports a false 'Missing K9! magic number' error; the same affects normalise_level and field regexes. (2) read does not return the final line if the file lacks a trailing newline, so a closing } or a name/version field on the last line is dropped, causing false 'missing field' errors. Consider stripping \r (e.g. line="${line%$'\r'}") inside the loops and using while IFS= read -r line || [[ -n "$line" ]] to capture a newline-less final line.

Quality: Annotations emitted with line=0 for empty/first-line issues

📄 .githooks/validate-k9.sh:118-132
In validate-k9.sh, if a file is empty (or begins with only blank lines), first_content_line_num stays 0 and the magic-number error is annotated with line=0. GitHub Actions treats line numbers as 1-based, so line=0 annotations are dropped/not surfaced on the file. Default such cases to line 1 (as other checks already do) so the annotation is displayed.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot gitar-bot 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.

Gitar has auto-approved this PR (configure)

@hyperpolymath
hyperpolymath merged commit 26a7f51 into main Jul 27, 2026
20 of 23 checks passed
@hyperpolymath
hyperpolymath deleted the fix-ci-actions branch July 27, 2026 22:36
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.

1 participant