Skip to content

added render_pi_env.sh#155

Merged
chipp merged 1 commit into
mainfrom
pi-env-script
May 16, 2026
Merged

added render_pi_env.sh#155
chipp merged 1 commit into
mainfrom
pi-env-script

Conversation

@chipp
Copy link
Copy Markdown
Owner

@chipp chipp commented May 16, 2026

No description provided.

@chipp chipp merged commit 5190389 into main May 16, 2026
9 checks passed
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new script, scripts/render_pi_env.sh, which automates the generation of environment files for the elisa, elisheba, and isabel services by fetching secrets from 1Password. The reviewer suggested improving the script's maintainability by extracting hardcoded configuration values into variables and optimizing performance by using op inject to batch secret retrieval instead of making multiple individual calls to op read.

Comment thread scripts/render_pi_env.sh
Comment on lines +4 to +5
output_dir="${1:-build/pi-env}"
op_account="UKDQEQIPJVEARKGQPBMCLFP5MQ"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding environment-specific values like the MQTT address and device IPs directly in the heredocs makes the script harder to maintain. It is recommended to define these as variables at the top of the script.

Suggested change
output_dir="${1:-build/pi-env}"
op_account="UKDQEQIPJVEARKGQPBMCLFP5MQ"
output_dir="${1:-build/pi-env}"
op_account="UKDQEQIPJVEARKGQPBMCLFP5MQ"
mqtt_address="mqtts://lisa.chipp.dev:8880"
roborock_ip="10.0.1.150"

Comment thread scripts/render_pi_env.sh
Comment on lines +12 to +16
read_secret() {
local ref="$1"

op read --account "$op_account" "$ref"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Calling op read multiple times is inefficient because each invocation starts a new process and performs authentication. A more performant and idiomatic approach is to use op inject with templates (e.g., cat <<EOF | op inject ...), which allows fetching all secrets in a single batch operation.

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