Skip to content

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

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

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

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Automated PR to fix CI after deleted actions.

Comment thread .githooks/validate-k9.sh
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 4 resolved / 4 findings

Vendors validation scripts and removes remote action pins to fix CI workflows. Address minor edge cases in the script loops, blank-line checks, and line-number reporting for empty files.

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

✅ 4 resolved
Edge Case: while-read loops skip a final line lacking a trailing newline

📄 .githooks/validate-k9.sh:122-131 📄 .githooks/validate-k9.sh:141-150 📄 .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
All the while IFS= read -r line; do ... done < "$file" loops rely on read returning success; a final line with no trailing newline sets line but read returns non-zero, so the loop body never runs for it. A K9/A2ML file whose meaningful content sits on an unterminated last line (e.g. a one-line file) can produce false errors (e.g. "Missing K9! magic number") or missed fields. Guard the last line with while IFS= read -r line || [[ -n "$line" ]]; do.

Edge Case: Reference/brace-less pedigree leaves in_pedigree stuck true

📄 .githooks/validate-k9.sh:182-196
In validate-k9.sh the pedigree end is only detected when pedigree_depth <= 0 AND the line contains } (line 236). A pedigree written as a bare reference with no braces (e.g. pedigree = component_pedigree) never sets a closing }, so in_pedigree stays true and every subsequent line in the file is scanned as if inside the pedigree block. This can cause name/version/leash/signature fields from unrelated blocks to be counted, producing false negatives. Consider also closing the block when depth reaches 0 on the opening line, or when a new top-level assignment at base indent begins.

Edge Case: Magic-number/empty-line checks ignore tabs and CRLF

📄 .githooks/validate-k9.sh:125-136
Check 1 treats a line as empty via [[ -z "${line// /}" ]], which strips only spaces (not tabs), so a tab-indented blank line becomes the "first content line" and fails the != "K9!" test. Likewise a CRLF file yields K9!\r, which also fails the exact != "K9!" comparison. Both cause spurious errors. Normalize by stripping [[:space:]] and trailing \r before comparing.

Quality: Empty file reports annotation at invalid line 0

📄 .githooks/validate-k9.sh:118-132
For an empty (or all-blank) K9 file, first_content_line_num stays 0 and report_issue "error" "$file" "$first_content_line_num" ... emits ::error file=...,line=0::, an invalid GitHub annotation line number. Default the line to 1 when no content line is found so the annotation renders correctly.

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

Comment thread .githooks/validate-k9.sh

@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 03f17d3 into main Jul 27, 2026
18 of 19 checks passed
@hyperpolymath
hyperpolymath deleted the fix-ci-actions branch July 27, 2026 22:40
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