fix(release): stop slot rotation corrupting self-referential shellcheck paths#770
Merged
kojiromike merged 3 commits intoJun 1, 2026
Merged
Conversation
…ck paths (openemr#769) The env.stub shellcheck directive in the 8.0.0 init scripts used a repo-relative path carrying a version token, so rotating the current slot rewrote it to a sibling dir that never exists, breaking shellcheck CI on the auto rotation PR (openemr#760). Switch the directive to the version-agnostic SCRIPTDIR form (matching the existing convention) and drop the now-tokenless *.sh entries from the rotation registry. A SlotRotator regression test locks in that SCRIPTDIR directives survive rotation byte-for-byte.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes release slot rotation from corrupting self-referential ShellCheck source= directives in the docker/openemr/8.0.0 init scripts by switching them to a version-agnostic SCRIPTDIR/... form and removing now-unneeded registry entries, with a regression test added to prevent reintroducing the behavior.
Changes:
- Update
openemr.shandssl.shto use# shellcheck source=SCRIPTDIR/env.stubinstead of a versioned repo-relative path. - Remove the
shellcheck_sourcepin entries for the 8.0.0 init scripts fromtools/release/versions.yml. - Add a PHPUnit regression test ensuring rotation rewrites real
docker_dirpins while leavingSCRIPTDIRShellCheck directives untouched.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/release/versions.yml | Removes registry entries that caused slot rotation to rewrite non-rotating ShellCheck directives. |
| tools/release/tests/SlotRotatorTest.php | Adds a regression test covering rotation behavior around SCRIPTDIR ShellCheck directives. |
| docker/openemr/8.0.0/ssl.sh | Switches ShellCheck source= directive to a version-agnostic sibling reference. |
| docker/openemr/8.0.0/openemr.sh | Switches ShellCheck source= directive to a version-agnostic sibling reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #769. The
env.stubshellcheck directive in the 8.0.0 init scripts was written as a repo-relative path carrying a version token (# shellcheck source=docker/openemr/8.0.0/env.stub). Because the scripts were registered ascurrent-slot pins, advancingcurrent8.0.0 → 8.1.0 rewrote that directive to point at a sibling dir that never exists, breaking shellcheck CI on the auto rotation PR (#760).A
# shellcheck source=comment is a path to the script's own sibling file, not a version pin — it should never carry a rotating token.Changes
docker/openemr/8.0.0/openemr.sh,ssl.sh: use the version-agnosticSCRIPTDIR/env.stubform (matching the existing convention already used fordevtoolsLibrary.source).SCRIPTDIRresolves to the script's own dir at lint time and contains no token for the rotator to match.tools/release/versions.yml: drop the twoshellcheck_sourceentries. After the change above the files hold no version pin, so the linter no longer flags them — noexcludes:entry needed.tools/release/tests/SlotRotatorTest.php: regression test seeding a*.shwith aSCRIPTDIRdirective plus a genuine rotating token, asserting the directive survives rotation byte-for-byte.Test plan
php bin/lint-versions.php—openemr.sh/ssl.shno longer flagged (the two remainingrel_branch_reffindings pre-exist onmaster, unrelated)vendor/bin/phpunit— 175 tests green, including the new regression--current=8.1 --dry-run) no longer touches the# shellcheck source=line in either scriptshellcheck docker/openemr/8.0.0/openemr.sh ssl.sh— clean