Skip to content

fix: remove truncated (e.g.) example from hash-type schema description#87

Merged
dmcilvaney merged 4 commits intomainfrom
copilot/fix-hash-type-description
Apr 9, 2026
Merged

fix: remove truncated (e.g.) example from hash-type schema description#87
dmcilvaney merged 4 commits intomainfrom
copilot/fix-hash-type-description

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

The hash-type field in the generated JSON schema produced a truncated description: "Hash algorithm used for the hash value (e.g.".

The jsonschema struct tag uses commas as key=value separators. The description (e.g., SHA256, SHA512) contained commas, causing the parser to treat SHA256 and SHA512) as separate invalid entries and truncating the description at the first inner comma.

Changes

  • internal/projectconfig/component.go: Removed (e.g., SHA256, SHA512) from the HashType field's jsonschema description — the valid values are already expressed via enum=SHA256,enum=SHA512 in the same tag.
  • scenario/__snapshots__/TestSnapshots_config_generate-schema_stdout_1.snap: Updated snapshot to reflect the corrected description.
  • scenario/__snapshots__/TestSnapshotsContainer_config_generate-schema_stdout_1.snap: Updated snapshot to reflect the corrected description.

Before:

jsonschema:"...,description=Hash algorithm used for the hash value (e.g., SHA256, SHA512)"
// Generated: "description": "Hash algorithm used for the hash value (e.g."

After:

jsonschema:"...,description=Hash algorithm used for the hash value"
// Generated: "description": "Hash algorithm used for the hash value"

Copilot AI requested review from Copilot and removed request for Copilot April 9, 2026 06:55
Copilot AI linked an issue Apr 9, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot April 9, 2026 07:09
Copilot AI changed the title [WIP] Fix incomplete description for hash-type in generated schema fix: remove truncated (e.g.) example from hash-type schema description Apr 9, 2026
Copilot AI requested a review from christopherco April 9, 2026 07:11
@reubeno reubeno marked this pull request as ready for review April 9, 2026 15:25
Copilot AI review requested due to automatic review settings April 9, 2026 15:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a truncated JSON schema description for the hash-type field by removing comma-containing example text from the jsonschema struct tag (since the tag parser treats commas as option separators). This improves the generated schema output for TOML config validation without changing the actual allowed values (still enforced via enum).

Changes:

  • Remove the (e.g., SHA256, SHA512) example from the HashType field’s jsonschema description to avoid truncation.
  • Rely on the existing enum=SHA256,enum=SHA512 entries in the same tag to convey valid values.

@dmcilvaney
Copy link
Copy Markdown
Contributor

@copilot Update the scenarios, and ensure they work after.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build103337162/b649/sourceproviders.test /tmp/go-build103337162/b649/sourceproviders.test -test.testlogfile=/tmp/go-build103337162/b649/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build103337162/b580/vet.cfg ternal/app/azlde-errorsas ternal/app/azlde-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 ter-statement ux-amd64/pkg/too-buildtags o_.o�� .4.11/ratelimite-errorsas .4.11/ratelimite-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet -pthread nal/utils/qemu -fmessage-length/tmp/go-build103337162/b606/_pkg_.a ux-amd64/pkg/too-trimpath (dns block)
  • invalid-domain.there.is.no.such.resource
    • Triggering command: /tmp/go-build103337162/b642/rpmprovider.test /tmp/go-build103337162/b642/rpmprovider.test -test.testlogfile=/tmp/go-build103337162/b642/testlog.txt -test.paniconexit0 -test.timeout=10m0s go1.25.6 -c=4 -nolocalimports -importcfg /tmp/go-build103337162/b573/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/thejerf/slogassert@v0.3.4/assertions.go _vi4MaLkzvcg -qui�� hellquote@v0.0.0-errorsas hellquote@v0.0.0-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet 337162/b114/ nal/utils/cloudi-atomic ead ux-amd64/pkg/too-buildtags (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested review from Copilot and dmcilvaney and removed request for Copilot April 9, 2026 21:49
@dmcilvaney dmcilvaney merged commit d08fdc0 into main Apr 9, 2026
16 checks passed
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.

[Copilot] hash-type in generated schema has an incomplete description

5 participants