Devops: push-env-key.sh script to update env configs on remote#5962
Devops: push-env-key.sh script to update env configs on remote#5962
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 607ed93e08
ℹ️ 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".
| while getopts "m:f:h" opt; do | ||
| case $opt in | ||
| m) COMMIT_MSG="$OPTARG" ;; | ||
| h) usage ;; | ||
| *) usage ;; |
There was a problem hiding this comment.
Handle
-f option in argument parser
The script advertises -f FOLDER and includes f in getopts, but the case statement never handles f, so any invocation with -f falls into * and exits via usage. This means users cannot target non-default remote folders (like testnet) even though that is documented as a primary workflow.
Useful? React with 👍 / 👎.
| for i, (h, keys) in enumerate(sections): | ||
| if h == target_section: | ||
| keys.append(key) |
There was a problem hiding this comment.
Insert unknown keys into the intended final section
If a key is not found in local env.json, target_section stays None, and this insertion check matches the first synthetic section whose header is also None; that places the new key at the top of the file instead of the last section. In the “new key” path, this contradicts the script’s own warning and can misplace config entries.
Useful? React with 👍 / 👎.
d50e103 to
4ee6d9e
Compare
Context
Asana: "Devops - push-env-key.sh" (P2). This script enables automated management of env configs on the remote Jenkins server by reading local
env.json, determining the appropriate section for a key, and pushing updates via SSH.Changes
scripts/push-env-key.shscript that:env.jsonenv.jsonif not providedCHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
None
Requirements
If you have made any visual changes to the GUI. Make sure you have: