Repository navigation
feat: add --secrets-file to cf previews deploy - #537
Draft
edmundhung wants to merge 2 commits into
Draft
edmundhung wants to merge 2 commits into
edmundhung wants to merge 2 commits into
Conversation
commit: |
Contributor
|
LGTM |
Contributor
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 286.7 ms | 12.0 ms | 277.5 ms | 321.5 ms |
| base | 284.1 ms | 4.0 ms | 280.1 ms | 293.6 ms |
Δ (PR vs base): ↑ +2.5 ms (+0.9%)
Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
--secrets-filetocf previews deploy. It accepts the same JSON or.envfile format ascf deploy --secrets-file. Right now cf has no way to give a Preview its secrets: they have to be set in the dashboard or withwrangler preview secret put.The flag is passed to
previewBuildOutput(). That function parses the file the same waycf deploydoes and uploads each entry as a secret on the Preview deployment. The help text reuses thecf deploydescription, reworded for a Preview deployment. Typed metadata, the generated command catalogs, tests, and a minor changeset are included.Dependencies
Depends on cloudflare/workers-sdk#16751, which adds
secretsFileto thepreviewBuildOutput()arguments. Until that ships,@cloudflare/deploy-helpersis pinned to the PR's pkg.pr.new build, and its sibling dependencies are overridden to the released versions cf already uses, the same approach as #163. Swap the pin and overrides for the released version before merging.