feat: implement secret caching for "bp dev" command#14884
feat: implement secret caching for "bp dev" command#14884JustinBordage merged 12 commits intomasterfrom
Conversation
franklevasseur
left a comment
There was a problem hiding this comment.
I think secrets should remain scoped to the project
packages/cli/src/config.ts
Outdated
| type: 'string', | ||
| description: 'The tunnel ID to use. The ID will be generated if not specified', | ||
| }, | ||
| noSecretsSaved: { |
There was a problem hiding this comment.
nitpick: I don't really like this name, but I don't have a suggestion and I have no strong opinion
There was a problem hiding this comment.
I would have to agree, though I had a hard time thinking of a name that wasn't too verbose.
An alternative name I thought of was "noSecretCaching", though, I didn't use it initially since it could imply that it wouldn't save secrets nor would it read secrets that were already written.
I'll try to brainstorm some other names and then perhaps we can revisit this when you do the follow up review to fix the fixes I make for the issues you raised.
There was a problem hiding this comment.
I prefer noSecretCaching
packages/cli/src/config.ts
Outdated
| type: 'string', | ||
| description: 'The tunnel ID to use. The ID will be generated if not specified', | ||
| }, | ||
| noSecretsSaved: { |
There was a problem hiding this comment.
I prefer noSecretCaching
|
Just finished QA testing it following the changes made in commit 5a48527 |
There was a problem hiding this comment.
Pull request overview
This PR implements secret caching for the "bp dev" command to avoid prompting users for integration secrets on every invocation. It stores secrets in the project cache and allows users to opt-out via a new --noSecretCaching flag.
Changes:
- Added a
noSecretCachingconfiguration option to the dev command schema - Extended
ProjectCachetype to include asecretsfield for storing secret key-value pairs - Implemented cache read/write operations for secrets with prefix handling
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/config.ts | Adds noSecretCaching boolean flag to dev command schema |
| packages/cli/src/command-implementations/project-command.ts | Extends ProjectCache type with secrets field |
| packages/cli/src/command-implementations/dev-command.ts | Implements secret caching logic with read/write methods and prefix handling |
| packages/cli/src/code-generation/integration-implementation/integration-secret.ts | Adds stripSecretEnvVariablePrefix helper function |
| packages/cli/package.json | Bumps version from 5.4.2 to 5.5.0 |
| packages/cli/e2e/tests/dev-bot.ts | Updates test to use noSecretCaching: true flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/cli/src/code-generation/integration-implementation/integration-secret.ts
Show resolved
Hide resolved
90bfbd5
Resolves SH-387