Skip to content

test(bundle): drive isTrustedImageSource's s3 bucket arm (meow.ts:156-157) through dist/index.js - #477

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-meow-s3-allowlist
Oct 15, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-meow-s3-allowlist

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds two rows to __tests__/bundle/meow.test.ts so dist/index.js is shown the provider's s3 bucket, the arm of isTrustedImageSource (src/issueComment/meow.ts:156-157) no bundle scenario reached:

  • a 200 with https://s3.us-west-2.amazonaws.com/cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg → ![cat](<url>) is posted, no ::warning::, one cat-api request;
  • a 200 with https://s3.us-west-2.amazonaws.com/other-bucket/cat.jpg → the fallback note is posted with the cat api returned an image from an unexpected host warning, one cat-api request (not retried).

Before, the only row reaching line 156 (https://evil.example/cat.jpg) failed the hostname comparison, so the bucket-prefix check was never evaluated end-to-end: coverage-e2e/lcov.info had DA:156,1 BRDA:156,19,1,0. With this change (npm run pack:coverage && npx vitest run --coverage --config vitest.e2e-coverage.config.mjs __tests__/bundle/meow.test.ts on main@d93ecb8): DA:156,3 BRDA:156,19,0,3 BRDA:156,19,1,2. Both rows also pass against the committed dist/index.js (npx vitest run __tests__/bundle/meow.test.ts, 17/17), and eslint is clean.

Files/functions claimed: __tests__/bundle/meow.test.ts only; isTrustedImageSource in src/issueComment/meow.ts. Disjoint from held PRs #467–#476 (approve*/approveReview/handleIssueComment/tide/auth/config), none of which touch meow.

Related Issue

Refs #466 (the dist/index.js e2e-coverage tracker this finding was folded into; its own task list — making FetchMergeabilityOptions.initial required and repacking dist/ — is a production-code change and needs a human, so this PR does not close it)


Filed by quality agent (hold-gated mode). Human review required.

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

@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 14, 2026 07:40
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 14, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind failing-test or /kind cleanup.

…-157) through dist/index.js

Two rows in __tests__/bundle/meow.test.ts present the provider's s3 bucket to
the bundle: an image under s3.us-west-2.amazonaws.com/cdn2.thecatapi.com/ is
rendered, and another bucket on the same host is refused with the
unexpected-host note (a row in the existing refusals table).
BRDA:156,19,1 in coverage-e2e/lcov.info goes 0 -> 2.

Refs #466

Co-authored-by: quality <quality@hive.kubestellar.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
@mrbobbytables
mrbobbytables force-pushed the quality/test-meow-s3-allowlist branch from d96b03b to f5096e1 Compare October 14, 2026 13:28
@mrbobbytables

Copy link
Copy Markdown
Member

Review: the rendered-bucket case is the new arm and stays as is. The other-bucket refusal has the exact shape of the it.each refusals table a few lines below (2xx body → warning → fallback note), so it is now a one-line row there instead of a second standalone it. Rebased on main.

@mrbobbytables mrbobbytables removed the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 15, 2026
@mrbobbytables
mrbobbytables merged commit 945813a into main Oct 15, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-meow-s3-allowlist branch October 15, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant