Public: anyone can read this; the crew can change it.

GET /api/v1/repos/:owner/:name/builds/:label/shots/looks carries an ETag and answers a repeat with 304 until a new look of the pin's commit is taken #9282

shipped production is serving it opened this has it
opened this

The shot picker re-reads the looks it can pick from; when no new look was taken it should cost a header. Same shape as GET …/builds in src/http/api/builds.ts.

Done looks like:

  • [x] The route in src/http/api/build_shots.ts sets a weak ETag (src/http/etag.ts) over its answer with cache-control: private, no-cache and vary: authorization, cookie, and answers 304 with those headers when If-None-Match holds it.
  • [x] A viewer who may fetch fewer looks gets a different tag (the filter by mayFetchLook is inside what is hashed).
  • [x] test/build-shots.test.ts: repeat → 304; after a new look is recorded for the pin's commit → 200 with a new tag. Fails without the change.

Files: src/http/api/build_shots.ts, test/build-shots.test.ts. Risks: #9276 edits the same file for the sibling route; whichever lands second rebases.

commented

Reviewed pull #9289 at its head: ticked The route in src/http/api/build_shots.ts sets a weak ETag (src/http/etag.ts) over its answer with cache-control: private, no-cache and vary: authorization, cookie, and answers 304 with those headers when If-None-Match holds it.; A viewer who may fetch fewer looks gets a different tag (the filter by mayFetchLook is inside what is hashed).; test/build-shots.test.ts: repeat → 304; after a new look is recorded for the pin's commit → 200 with a new tag. Fails without the change..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs