Repository navigation
validation: print each tool's usage on -h and flag errors; anchor binary ignores - #85
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes correctly implement the described CLI and ignore behavior without introducing unresolved issues.
Review effort: Balanced
Findings: None
What changed in this PR
Updates validator CLI help output and correctly scopes ignored binaries.
Changes:
- Routes help and flag errors through each validator’s custom usage text.
- Anchors ignore rules for validator binaries without hiding source directories.
| File | Description |
|---|---|
validation/cmd/key-validator/main.go |
Registers custom flag usage. |
validation/cmd/auction-validator/main.go |
Registers custom flag usage. |
.gitignore |
Adds precise validator binary patterns. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
nickpell
added a commit
to cloudx-io/openarbiter
that referenced
this pull request
Oct 8, 2026
…binary (#48) ## Summary - **Key-token comments.** The doc comments on `HandleKeyRequest` (`enclave/handlers.go`) and `GenerateKeyAttestation` (`enclave/attestation.go`) said the host echoes the key-attestation token into a later arbitration request. `EnclaveArbitrationRequest` has only `Type`, `RequestID`, `Bids` and `Timestamp`, and it has never had a token field. #11 kept `auction_token` in the attested user_data and on the unsigned envelope to preserve the existing wire shape. The comments now say the token is kept for wire compatibility and that no arbitration request carries it back. Each comment keeps its line count, so no code line moves. - **`.gitignore`.** `go build ./validation/cmd/validate-arbitration` writes its binary to the working directory, and only `/bin/` was ignored. `.gitignore` now ignores `/validate-arbitration` (built from the repo root) and `/validation/cmd/validate-arbitration/validate-arbitration` (built inside the package directory). This uses the same anchored form and `# compiled commands` heading as cloudx-io/openauction's `.gitignore` (cloudx-io/openauction#85), so the source directory itself is not ignored. ## Pre-merge checklist - [x] Build passes: `go build ./...` and `go vet ./...` - [x] Lint passes: `mise run //:lint` reports 0 issues; `mise run //:tidy` leaves no changes - [x] Tests pass: Go workflow `test` job green on this branch (run 37850777297) - [x] `go build ./validation/cmd/validate-arbitration` from the repo root, and `go build` inside the package directory: `git status --porcelain` lists no untracked file, and `git check-ignore -v` matches each binary to its new line. `git check-ignore` matches neither `validation/cmd/validate-arbitration/` nor a new file in it. - [x] Enclave code unchanged: `cmd/enclave-server` built with the `docker.yml` flags plus `-trimpath -buildvcs=false` has the same SHA-256 on `origin/main` and on this branch - [x] Diff contains no unintended changes: `.gitignore` and the two comments only ## Post-deploy/apply verification - [ ] The Go, Docker Build and EIF build runs on `main` for the merge commit are green, including `update-pcrs`. PCR0 and PCR2 change with every commit on `main`, as they did for the `.gitignore`-only #38; the enclave code itself is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
key-validatorandauction-validatoreach have their ownshowUsage()text, but neither setsflag.Usage.-hand an unknown flag therefore print Go's defaultUsage of <path>:flag list instead of the tool's usage text. Both tools now setflag.Usage = showUsagebeforeflag.Parse(), so-h,-help,--helpand flag errors all print the tool's own usage. The exit codes stay theflag.ExitOnErrorones: 0 for-h, 2 for a flag error. The tools' own exit-code table already defines 2 as invalid input..gitignore, the unanchoredkey-validatorpattern also matched the source directoryvalidation/cmd/key-validator/, sogit addrefused new files there without-f.go buildwrites the binary to the directory it runs from. The pattern now names only the binary in the two usual build directories: the repo root (go build ./validation/cmd/key-validator) and the package directory (go buildrun inside it).auction-validatorgets the same anchored pair, because before this change its built binary was not ignored at all.Notes for reviewers
key-validatorignore line came from use type definitions to represent different attestation encodings #13, under the# compiled commandscomment. It was meant for the compiled binary, and the anchored patterns keep that intent.auction-validator'sshowUsage(). This PR adds one line next toflag.Parse()and does not touchshowUsage(), so no textual overlap is expected.showUsage()prints to stdout. The existing missing-input path has the same split: usage on stdout, error on stderr.Pre-merge checklist
go build ./...andgo vet ./...)mise run //:lint: 0 issues;mise run //:tidyleaves no changes)go test ./...)-h,-helpand--helpprint the tool's usage text and exit 0.-bogusprintsflag provided but not defined: -boguson stderr, then the usage text, and exits 2. Before this change,-hand-bogusprinted Go's default flag list.git check-ignore -vmatches/key-validator,/validation/cmd/key-validator/key-validator,/auction-validatorand/validation/cmd/auction-validator/auction-validator. It reports no match forvalidation/cmd/key-validator/,validation/cmd/auction-validator/, or a new file in either directory. After building both tools from the repo root and from each package directory,git status --porcelain --ignoredlists the four binaries as ignored and the new files as untracked.go list -deps ./enclave/...is identical before and after.gitignoreand the twomain.gofiles onlyPost-deploy/apply verification
mainfor the merge commit are green, includingupdate-pcrs(the enclave binary does not depend on these commands) (merge commit 71d22d5: Go run 37010543876, Docker Build runs 37010595113 and 37011352515, Build EIF run 37011024303 all success; PCR commit e19b206 on main)