Skip to content

chore: lowercase non-exported shell variables#3513

Merged
mkoura merged 1 commit into
masterfrom
shell_vars_casing
Jun 25, 2026
Merged

chore: lowercase non-exported shell variables#3513
mkoura merged 1 commit into
masterfrom
shell_vars_casing

Conversation

@mkoura

@mkoura mkoura commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Reserve uppercase for exported and environment variables; rename internal/computed globals to lowercase across the shell scripts to match the convention already used for function-local variables.

Promote fixed-value constants to readonly uppercase: the GHC and Cabal version pins in install-node.sh and the TRUE/FALSE display symbols in check_dev_env.sh.

Copilot AI left a comment

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.

Pull request overview

This PR standardizes shell-script variable naming by reserving uppercase for exported/environment variables and shifting internal/computed globals to lowercase, aligning global naming with the convention already used for function-local variables.

Changes:

  • Renamed non-exported global variables to lowercase across multiple shell scripts (scripts/, runner/, templates, and testnet helpers).
  • Promoted fixed-value constants to readonly uppercase (e.g., GHC/Cabal pins; TRUE/FALSE display symbols).
  • Added early assertions for required environment variables (e.g., WORKDIR, REPODIR) in sourced runner helpers to fail fast when misconfigured.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testnets_bootstrap_template/postgres-setup.sh Lowercase internal path/db name variables while keeping PG* env exports.
testnets_bootstrap_template/faucet_setup.sh Lowercase internal address variable used for faucet funding/query.
scripts/update_node_bins.sh Lowercase internal repo/build/bin directory variables passed to build/link helper.
scripts/test_rollbacks.sh Lowercase computed repo top dir used to run regression script.
scripts/test_node_reconnect.sh Lowercase computed repo top dir used to run regression script.
scripts/test_node_ipc_shutdown.sh Lowercase internal bootstrap dir variable for running IPC shutdown test.
scripts/test_block_production.sh Lowercase computed repo top dir used to run regression script.
scripts/setup_test_env.sh Lowercase internal cwd/repodir variables while preserving exported WORKDIR.
scripts/restart_dev_cluster.sh Lowercase internal top dir and cluster state path variables.
scripts/reinstall_editable.sh Lowercase internal top dir/repo path variables while preserving behavior.
scripts/postgres-start.sh Lowercase internal argument/state variables and update usage/error messages accordingly.
scripts/postgres-start-nix.sh Lowercase internal script_dir variable used to exec postgres-start.sh.
scripts/deploy_doc.sh Lowercase internal top dir/doc source directory variables.
scripts/check_dev_env.sh Promote TRUE/FALSE symbols to readonly uppercase; lowercase internal status variables.
scripts/build_and_link_node_bins.sh Lowercase internal repo/build/bin directory variables and related messaging.
scripts/analyze_failures.sh Lowercase internal run_dir/script_dir/repo_root variables; keep {RUN_DIR} placeholder substitution.
runner/source_dbsync.sh Add required WORKDIR/REPODIR assertions; lowercase internal tar filename variable.
runner/source_cardano_node.sh Add required WORKDIR assertion in functions that depend on it.
runner/source_cardano_cli.sh Add required WORKDIR assertion in functions that depend on it.
runner/setup_venv.sh Lowercase internal top dir/reqs-installed tracking variables; keep cleanup/unset behavior.
runner/runc.sh Lowercase non-exported globals (container selection/mount arrays), keep readonly exported REPO_DIR.
runner/run_tests.sh Lowercase computed argv arrays; make CLEANUP/RUN_SKIPS readonly after initialization.
runner/regression.sh Make REPODIR readonly; lowercase lock/monitor PID variables while preserving semantics.
runner/node_upgrade_pytest.sh Lowercase internal state/config variables; make STEP1_BIN readonly; update paths accordingly.
cardano_node_tests/cluster_scripts/testnets/dbsync_block_no.sh Lowercase internal socket/state/db variables used for dbsync block query.
cabal_build_tests/run.sh Lowercase distro/tag variables used for container build/run.
cabal_build_tests/install-node.sh Make version pins readonly; lowercase internal computed version/hash variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/test_node_ipc_shutdown.sh Outdated
Reserve uppercase for exported and environment variables; rename
internal/computed globals to lowercase across the shell scripts to
match the convention already used for function-local variables.

Promote fixed-value constants to readonly uppercase: the GHC and
Cabal version pins in install-node.sh and the TRUE/FALSE display
symbols in check_dev_env.sh.
@mkoura mkoura force-pushed the shell_vars_casing branch from cff432c to dfd0b76 Compare June 25, 2026 13:03
@mkoura mkoura merged commit 2b1c629 into master Jun 25, 2026
1 check passed
@mkoura mkoura deleted the shell_vars_casing branch June 25, 2026 13:15
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.

2 participants