Skip to content

RDoc-4100 Make CloudFront function code an update/publish a build step - #2673

Merged
poissoncorp merged 1 commit into
ravendb:mainfrom
poissoncorp:RDoc-4100-csp-write-shape
Sep 17, 2026
Merged

poissoncorp merged 1 commit into
ravendb:mainfrom
poissoncorp:RDoc-4100-csp-write-shape

Conversation

@poissoncorp

Copy link
Copy Markdown
Contributor

Issue link

https://issues.hibernatingrhinos.com/issue/RDoc-4100

Additional description

Fixes the CSP push added in #2660, which aborted the first staging deploy before writing anything: get-response-headers-policy returns {} for headers that are not configured and update-response-headers-policy refuses them, so the read shape of a policy is not a valid write shape.

Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

Fix the CSP push, which aborted the first staging deploy before writing.

get-response-headers-policy returns `{}` for headers that are not configured,
and update-response-headers-policy refuses that: once XSSProtection,
FrameOptions or ReferrerPolicy appears in the payload it requires its own
fields. The read shape is not a valid write shape, so empty objects are now
dropped before the config goes back. Stripping happens before the pre-write
snapshot and again on the post-write re-read, so both sides of every diff are
comparable and the one-field guarantee still holds.

Empty arrays are left alone, since {Quantity: 0, Items: []} is valid inbound.
The strip returns arrays comma-prefixed: unrolled, a one-element array would
collapse to a scalar and turn {Items: ["x"]} into {Items: "x"}. The guard
cannot catch that, because it compares post-strip against post-strip.

A config-sync failure no longer strands the content that phases 1 and 2 already
uploaded. The error is held and rethrown after the invalidation and the stale
asset cleanup, so the build still fails but the edge stops serving the previous
release from cache.
@poissoncorp
poissoncorp merged commit 8a7f94c into ravendb:main Sep 17, 2026
1 check 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.

1 participant