ci: automate safe-settings deployment - #17
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Bootstrap drops optional secret keys
- The bootstrap script now reuses an existing WEBHOOK_PROXY_URL from the current Kubernetes Secret when .env omits or leaves it empty, preventing apply from dropping that key.
Or push these changes by commenting:
@cursor push 984b12483c
Preview (984b12483c)
diff --git a/script/bootstrap-k8s-secret b/script/bootstrap-k8s-secret
--- a/script/bootstrap-k8s-secret
+++ b/script/bootstrap-k8s-secret
@@ -36,8 +36,21 @@
--from-file="WEBHOOK_SECRET=${secret_dir}/WEBHOOK_SECRET"
)
-if [[ -n "${WEBHOOK_PROXY_URL:-}" ]]; then
- printf '%s' "${WEBHOOK_PROXY_URL}" > "${secret_dir}/WEBHOOK_PROXY_URL"
+existing_webhook_proxy_url=""
+if [[ -z "${WEBHOOK_PROXY_URL:-}" ]]; then
+ encoded_webhook_proxy_url="$(
+ kubectl get secret "${secret_name}" \
+ --namespace "${namespace}" \
+ --output "jsonpath={.data.WEBHOOK_PROXY_URL}" 2>/dev/null || true
+ )"
+ if [[ -n "${encoded_webhook_proxy_url}" ]]; then
+ existing_webhook_proxy_url="$(printf '%s' "${encoded_webhook_proxy_url}" | base64 --decode)"
+ fi
+fi
+
+webhook_proxy_url="${WEBHOOK_PROXY_URL:-${existing_webhook_proxy_url}}"
+if [[ -n "${webhook_proxy_url}" ]]; then
+ printf '%s' "${webhook_proxy_url}" > "${secret_dir}/WEBHOOK_PROXY_URL"
secret_args+=(--from-file="WEBHOOK_PROXY_URL=${secret_dir}/WEBHOOK_PROXY_URL")
fiYou can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 3a9aab4. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 821519221f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| deploy: | ||
| name: Deploy production | ||
| if: ${{ vars.SAFE_SETTINGS_DEPLOY_ENABLED == 'true' }} |
There was a problem hiding this comment.
Restrict manual deployments to main-enterprise
When this workflow is manually dispatched from a feature branch or tag, the push branch filter does not apply and this condition only checks the repository variable, so the selected ref is checked out, built, and deployed to production. The local gh workflow run --help explicitly documents --ref as accepting a “Branch or tag name,” making it possible to bypass main-enterprise review and branch protection; add a github.ref == 'refs/heads/main-enterprise' guard to the deploy job.
Useful? React with 👍 / 👎.


Summary
safe-settings/app-envDeployment security
safe-settings-deployer@hacktron-462816.iam.gserviceaccount.com, not the broadly privileged infrastructure runnerHacktronAI/safe-settingssafe-settingsArtifact Registry repositoryroles/container.clusterViewerfor cluster discovery; Kubernetes writes are controlled separatelysafe-settingsnamespace and cannot read Secrets--atomic,--wait, immutable image tags, and bounded historySAFE_SETTINGS_DEPLOY_ENABLED == true; it is currentlyfalseProvisioned prerequisites
safe-settingsnamespace with scoped deployer Role/RoleBindingsafe-settings/app-envwithAPP_ID,PRIVATE_KEY,WEBHOOK_SECRET, andWEBHOOK_PROXY_URLWebhook and cutover state
default/safe-settingsdeployment is healthy and currently consumes GitHub events through SmeeValidation
npm run test:unit:ci: 16 suites passed, 137 tests passedsafe-settingsyes; read Secrets no; modifydefaultno