Pre-swap isolation gate in install-release.sh misses a bare variable line and ambiguous flag spellings
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 53/100
Research direction
Start with ops/release/install-release.sh:746-779 and its call site at :1203-1217; compare the shell parsing with the worker's Python str.strip() behavior described in the issue. Then inspect ops/release/tests/test_install_release.bats:965-976, ops/release/README.md, and the changelog's Unreleased section. Done means the listed parsing cases, pre-swap behavior, documentation, and release note are covered by the acceptance criteria.
Written by the indexing model from the issue text.
Description
Problem
Before it swaps the code, ops/release/install-release.sh checks each worker env file and the EXTRA_ENV of setup.env. If a variable from ORCH_ISOLATION_REQUIRED_ENV has a value and ORCH_ENFORCE_ISOLATION is not true, the deploy aborts, because the new worker would refuse to start (ops/release/install-release.sh:746-779, used at :1203-1217).
The parser in isolation_vars_status has some edge cases:
- Bare variable line. A line without
=is skipped (ops/release/install-release.sh:752). Inpodman --env-file, a line with only a name passes that variable through from the caller's environment. A bare line with a protected name may therefore put the variable in the worker, but the gate treats it as absent. - Two spellings of the flag. The flag and the list are matched with
toupperand the last line wins (ops/release/install-release.sh:757-758). If a file has bothORCH_ENFORCE_ISOLATION=falseandorch_enforce_isolation=true, the gate passes or fails depending on line order, and it is not clear which value the worker reads. - Whitespace class. Values are trimmed with
[ \t\r](ops/release/install-release.sh:769). The worker uses Pythonstr.strip(), which also strips\fand\v. This only matters for unusual files. - Test fixtures. The bats case for an empty or commented variable (
ops/release/tests/test_install_release.bats:965-976) puts several cases into one file, so it mainly tests last-wins. There is no CRLF file case for the protected variable.
Proposed change
- Bare line: if a line without
=names a protected variable, abort with a clear error (exit code 3 path), or with a new code that says "pass-through line, value unknown". Lines without=that do not name a protected variable stay ignored. - Ambiguous flag: if
ORCH_ENFORCE_ISOLATIONorORCH_ISOLATION_REQUIRED_ENVappears with more than one spelling (different case), abort with an "ambiguous" error that names the file and the spellings, never the values. - Add
\f\vto the trim class so shell and worker agree. - Split the fixture into one bats case per situation (empty value, spaces only, commented line, last empty occurrence) and add a CRLF file case.
- Document the new abort cases in
ops/release/README.md.
Compatibility
This only adds abort cases to the pre-swap gate. It changes no API, database, env name or worker behavior. A host whose env files have no bare protected-name line and only one spelling of each flag sees no change.
A host that does have one of those lines will start to fail the gate before the swap, with the installed code untouched. The release note must tell operators to check setup.env and each env.N for bare protected-name lines and duplicate flag spellings before they upgrade.
Acceptance criteria
- Bats: a bare line with a protected name aborts before the swap and the installed code is untouched.
- Bats: a bare line with any other name does not trigger the gate.
- Bats: two spellings of
ORCH_ENFORCE_ISOLATIONin one file abort with the "ambiguous" message, in both line orders. - Bats: one case each for empty, spaces only, commented and last-empty, plus a CRLF file case.
- Error messages name the file and the variable names, never a value.
- Existing deployments whose env files have neither pattern deploy exactly as before (the current gate tests pass unchanged).
- The release note and
ops/release/README.mddescribe the new abort cases and the pre-upgrade check. - CHANGELOG entry under Unreleased.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day