Skip to content

Use lowercase names for cronic's variables, so that it does not change the caller's exported variables - #132

Merged
mernst merged 4 commits into
plume-lib:masterfrom
mernst:cronic-prefix
Oct 9, 2026
Merged

mernst merged 4 commits into
plume-lib:masterfrom
mernst:cronic-prefix

Conversation

@mernst

@mernst mernst commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

cronic assigned variables with common names such as DEBUG, OUT, ERR, TRACE, and RESULT. If the caller had exported a variable with one of those names, cronic changed its value, and the wrapped command saw cronic's value rather than the caller's.

This pull request gives all of cronic's variables lowercase names that start with cronic_, matching the prefix that its functions already have. By convention, exported (environment) variables are uppercase, so lowercase names do not clash with them. It also adds a test that derives the names of the variables from cronic itself and checks that the wrapped command sees the caller's exported value for each name in uppercase, both with and without the CRONIC_ prefix.

This is split out of #129, which relies on the prefixes.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: plume-lib/plume-scripts/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b7ffcf97-c535-4ad1-b74c-2f2e2d98c461
📥 Commits

Reviewing files that changed from the base of the PR and between d37c363 and 0c3b540.

📒 Files selected for processing (2)
  • cronic
  • tests/cronic-test/cronic-test.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The script renames option-state and temporary-file variables to lowercase cronic_* names. Existing option handling, command execution, stderr processing, reports, and exit status remain unchanged. A new test checks that caller-exported values reach the wrapped command unchanged.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0c3b5

The variable rename is covered against the prior uppercase-variable collision; no actionable merge-blocking risk remains in these changes.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

… it assigns

Environment variables are uppercase by convention, so lowercase names
cannot overwrite a caller's exported variable (including `CRONIC_*` ones).
The test now derives the variable names from `cronic` itself, and unsets
the exported variables after the check.
@mernst mernst changed the title Prefix cronic's variables with CRONIC_ Use lowercase names for cronic's variables, so that it does not change the caller's exported variables Oct 9, 2026
@mernst
mernst merged commit 78d062f into plume-lib:master Oct 9, 2026
7 checks passed
@mernst
mernst deleted the cronic-prefix branch October 11, 2026 20:25
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