Skip to content

test(api): pin HandleRepoQR 500 arm for an over-capacity ContributeURL - #356

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-qr-oversized-url
Oct 11, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-qr-oversized-url

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds TestHandleRepoQROversizedContributeURL in pkg/api/repo_index_qr_test.go, pinning the qrcode.Encode failure arm of HandleRepoQR (pkg/api/qr.go:32-34).

ContributeURL is hub/seed-sourced and never length-checked on the way into the registry, so a hive advertising a URL past QR version-40 capacity (~2.3KB at Medium) makes the encoder fail. The test merges such a profile and asserts the public qr.png route answers with a generic JSON 500 — no image/* Content-Type, no Cache-Control (a cached 500 would pin the failure), and no leaked encoder error text.

Evidence: CI coverage artifact for main @3462741 (run 38048662798, -coverpkg=./...) shows 0 hits on that arm; 98.20% total, 72 uncovered stmts.

Closes #355


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

ContributeURL is hub/seed-sourced and never length-checked on the way into
the registry, so a hive advertising a URL past QR version-40 capacity drives
qrcode.Encode to fail. Pin that the route answers with a generic JSON 500,
no image Content-Type, no Cache-Control, and no encoder error text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 11, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 11, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit e849302 into main Oct 11, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-qr-oversized-url branch October 11, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] HandleRepoQR qrcode.Encode failure arm (qr.go:32-34) has no unit coverage

0 participants