Skip to content

Devops: push-env-key.sh script to update env configs on remote#5962

Open
j0ntz wants to merge 2 commits intodevelopfrom
jon/push-env-jack
Open

Devops: push-env-key.sh script to update env configs on remote#5962
j0ntz wants to merge 2 commits intodevelopfrom
jon/push-env-jack

Conversation

@j0ntz
Copy link
Contributor

@j0ntz j0ntz commented Feb 25, 2026

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

  • Added scripts/push-env-key.sh script that:
    • Takes a key name and optional JSON value to push to remote env.json
    • Falls back to extracting value from local env.json if not provided
    • Intelligently places keys in the correct section (section markers detected from local env structure)
    • Sorts keys alphabetically within sections
    • Uses SSH to connect to the Jenkins server and performs git operations remotely
    • Supports custom commit messages and target folders (e.g., testnet vs master)
    • Includes Python helper for proper JSON section handling

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

None

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +30 to +34
while getopts "m:f:h" opt; do
case $opt in
m) COMMIT_MSG="$OPTARG" ;;
h) usage ;;
*) usage ;;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +133 to +135
for i, (h, keys) in enumerate(sections):
if h == target_section:
keys.append(key)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@j0ntz j0ntz force-pushed the jon/push-env-jack branch from d50e103 to 4ee6d9e Compare February 26, 2026 22:53
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