Skip to content

chore(scripts): gitignore built Go binaries - #2918

Merged
devantler merged 3 commits into
mainfrom
claude/gitignore-go-binaries-2888
Aug 3, 2026
Merged

chore(scripts): gitignore built Go binaries#2918
devantler merged 3 commits into
mainfrom
claude/gitignore-go-binaries-2888

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

Building any of the Go tools under scripts/ drops a compiled binary next to the source, and nothing in the ignore file covered it. A directory-wide git add then stages a multi-megabyte binary alongside the code without saying anything — the only thing preventing a committed binary was someone reading git status carefully. That near-miss has now happened three times while working on #2854.

What

Ignores the built binaries, at both places a build can leave them.

They are listed by name rather than matched by a general "files without an extension" rule. That rule would be self-maintaining, but it would also silently hide a legitimately extensionless file someone adds later — a worse failure than a stray binary, which git status at least still shows. The trade is one line when a new tool is added.

Fixes #2888.

Every scripts/<name>/ is a `main` package, so a build drops an executable named
after its directory: `go build ./scripts/<name>/` leaves it in the working
directory, and `go build ./...` from the root leaves one per package at the
root. Neither has an extension, so nothing in the ignore file covered them, and
a directory-wide `git add` stages a multi-megabyte Mach-O binary alongside the
source without comment.

Listed by name rather than by a glob for extensionless files. That glob would
also hide a legitimately extensionless file added later, and a silently ignored
source file is a worse failure than a binary `git status` still shows — the
rule fails in the safer direction at the cost of a line when a package is
added.

Verified across all twelve paths: with the rule none is visible to git, without
it all twelve are, and no tracked file becomes ignored.

Fixes #2888.
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@devantler: I will review the changes in #2918.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated .gitignore with documentation and rules for six named Go binaries, main, Windows .exe outputs, and .test binaries at the repository root and under scripts/*/.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add narrow .gitignore coverage for built Go binaries under scripts, meeting issue #2888 objectives.
Out of Scope Changes check ✅ Passed The changes are limited to .gitignore rules and related documentation for the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly identifies the change: adding Git ignore rules for built Go binaries under scripts.
Description check ✅ Passed The description explains why and how the pull request prevents built Go binaries from being staged.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.gitignore:
- Around line 34-38: Update the explanatory comment in .gitignore to remove the
incorrect `go build ./...` root-output claim. Document `go build
./scripts/<name>/` from the repository root for root-level output, and `go build
.` from within `scripts/<name>/` for directory-local output.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ea61a8d4-123b-4ea7-b1e6-4fbb78f55c60

📥 Commits

Reviewing files that changed from the base of the PR and between 8bb0db9 and 95065e4.

📒 Files selected for processing (1)
  • .gitignore
📜 Review details
🔇 Additional comments (1)
.gitignore (1)

40-55: LGTM!

Comment thread .gitignore Outdated
`go build ./...` over multiple main packages discards the executables rather
than writing one per package at the root, so the comment justified the root
block with a command that produces nothing. Name the two forms that actually
write output instead: `go build ./scripts/<name>/` from the root, and
`go build .` from inside the package directory.

The ignore entries themselves are unchanged and still correct.
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

CodeRabbit is not delivering at this head: the account-level review limit is reached (Review limit reached … Next review available in: 59 minutes, observed 2026-08-03T00:02:55Z on platform#2917 — it is a per-account limit, not per-PR). Advancing to Codex per lane priority rather than parking a finished change behind a provider quota.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Requesting a Codex review at the current head 7083d3e608. CodeRabbit is account-rate-limited (see the preceding marker).

@codex review

@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: 7083d3e608

ℹ️ 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 .gitignore
Comment thread .gitignore
Comment thread .gitignore Outdated
go test -c, a source-file build, and any GOOS=windows build write names the
package-name rules do not match, so the directory-wide staging hazard remained
for <name>.test, main, and every .exe variant.
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

All three Codex P2 findings fixed in 54b56962 (each reproduced first, each answered in its thread with the evidence). Requesting a CodeRabbit review at the current head.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@devantler: I will review the changes at 54b56962.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Readiness at 54b569625b3d98cc1903e767c5cd0b4aed23df04

1. Programmatically tested. 29/29 rollup entries green. The change is to .gitignore, so the proof is git's own matcher rather than a test binary:

check result
derived matrix — 6 packages × 6 output names × 2 locations, via git check-ignore 0 of 72 uncovered
ablation — remove exactly the 6 new rules (changed-lines=6, asserted) 60 of 72 uncovered — only the 12 pre-existing literal names survive
restore 0 of 72
negative control — git ls-files | git check-ignore --stdin 0 tracked files newly ignored

The predicted ablation figure (72 − 12) was stated before it was run and matched, so the rules are load-bearing rather than decorative.

2. Reviewed. CodeRabbit at this exact head — No actionable comments were generated in the recent review, reviewed range ending at 54b56962, updated 02:06:40Z after the 02:04:57Z authenticated request, no quota or service marker, zero finding sections. Codex's three P2 findings from the previous head are each fixed, answered with reproduction evidence, and resolved.

3. Tried and evaluated as a user. Not inferred from the matcher — I ran the real builds. All six forms (go build ./scripts/<name>/, go build ., go build main.go, go test -c, and the GOOS=windows variants of each) for two packages, from both the repository root and inside the package directory. The binaries were confirmed present on disk afterwards — main, main.exe, validate-concurrency-queue.exe, validate-concurrency-queue.test, validate-concurrency-queue.test.exe, and the validate-dr-signing equivalents — so the check was not vacuously passing over an empty tree. git status showed exactly one entry: the .gitignore edit itself.

Every one of those six forms produced an untracked file before this change. That is what the three findings were about, and it is now closed for all of them.

@devantler
devantler marked this pull request as ready for review August 3, 2026 02:19
@devantler
devantler added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit 8849249 Aug 3, 2026
29 checks passed
@devantler
devantler deleted the claude/gitignore-go-binaries-2888 branch August 3, 2026 02:20
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Aug 3, 2026
devantler added a commit that referenced this pull request Aug 3, 2026
The compiled bridge binary was staged by a directory-wide add on a branch
that predates the ignore rules merged in #2918. Removed here; the merge of
main that follows brings those rules in so it cannot recur on this branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

chore(scripts): gitignore built Go binaries so a directory-wide git add cannot commit one

1 participant