Skip to content

Add the ETSI config test that .gitignore swallowed - #160

Merged
leifj merged 1 commit into
mainfrom
fix/gitignore-swallows-cmd-gt
Sep 4, 2026
Merged

leifj merged 1 commit into
mainfrom
fix/gitignore-swallows-cmd-gt

Conversation

@leifj

@leifj leifj commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

What

#159 described a test asserting that every ETSI field is carried into the registry config. The test was written and passing locally, and it is not in the repository.

.gitignore's third line was an unanchored gt:

output
gt          # matches the built binary AND the cmd/gt directory
gt-test
go-trust

Git patterns without a slash match at any depth, so gt excludes cmd/gt/ wholesale. main.go still showed changes because it was already tracked, but git add -A skipped the new test file without a word and the commit looked complete.

This anchors the binary patterns to the repository root and adds the missing test. Reverting #159's mapping fails it on all five fields it restored:

TSLURLs = [], want [https://registrar.example.org/tsl.xml]
FollowRefs was not carried across
MaxRefDepth = 0, want 4
AllowNetworkAccess was not carried across
UserAgent = "", want "test-agent/1.0"

cmd/gt/etsi_config_test.go was the only file being hidden — checked with git status --ignored.

Same shape as the bug it tests

#159 fixed a mapping that dropped fields into their zero values, producing silence rather than an error. This is that one level up: an ignored file produces no diagnostic either, so the commit, the PR diff and the merge all looked right.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DWj5aAxqWjEm5ESCX4P1hk

#159 described a test asserting every ETSI field is carried into the
registry config. The test was written and passing locally, and it is not
in the repository: .gitignore's third line was an unanchored `gt`, which
matches the cmd/gt *directory* as well as the built binary, so `git add
-A` skipped the new file without a word and the commit looked complete.

Anchors those patterns to the repository root so cmd/gt is tracked
normally, and adds the missing test. Reverting #159's mapping fails it on
all five fields it restored.

The same shape as the bug #159 fixed, one level up: a dropped thing
produces silence rather than an error, so nothing looks wrong until
something downstream is missing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DWj5aAxqWjEm5ESCX4P1hk
Copilot AI lite review requested due to automatic review settings September 4, 2026 20:37

Copilot AI 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.

🟢 Approval recommended

The change is low-risk and directly addresses the stated issue by fixing the ignore pattern and adding focused tests that validate the intended ETSI config mapping behavior.

Pull request overview

This PR prevents cmd/gt/ from being accidentally ignored by Git and adds the previously-missing ETSI config mapping tests that ensure all ETSI fields are carried into the ETSI TSL registry configuration.

Changes:

  • Anchor previously-unanchored .gitignore binary patterns (e.g., gt) to the repository root to avoid ignoring cmd/gt/.
  • Add cmd/gt/etsi_config_test.go to assert ETSI config-to-registry mapping carries every configured field, covers name/description defaults, and validates unparseable fetch_timeout handling.
File summaries
File Description
cmd/gt/etsi_config_test.go Adds regression tests for etsiTSLConfig to ensure all ETSI config fields are mapped and defaulting/timeout parsing behave as intended.
.gitignore Anchors binary/output ignore patterns to repo root to prevent silently ignoring the cmd/gt/ directory tree.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@leifj
leifj merged commit a88760b into main Sep 4, 2026
16 checks passed
@leifj
leifj deleted the fix/gitignore-swallows-cmd-gt branch September 4, 2026 20:52
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.

2 participants