Skip to content

fix(release): stop slot rotation corrupting self-referential shellcheck paths#770

Merged
kojiromike merged 3 commits into
openemr:masterfrom
kojiromike:fix-769-shellcheck-scriptdir
Jun 1, 2026
Merged

fix(release): stop slot rotation corrupting self-referential shellcheck paths#770
kojiromike merged 3 commits into
openemr:masterfrom
kojiromike:fix-769-shellcheck-scriptdir

Conversation

@kojiromike
Copy link
Copy Markdown
Member

Summary

Fixes #769. The env.stub shellcheck 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 as current-slot pins, advancing current 8.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-agnostic SCRIPTDIR/env.stub form (matching the existing convention already used for devtoolsLibrary.source). SCRIPTDIR resolves to the script's own dir at lint time and contains no token for the rotator to match.
  • tools/release/versions.yml: drop the two shellcheck_source entries. After the change above the files hold no version pin, so the linter no longer flags them — no excludes: entry needed.
  • tools/release/tests/SlotRotatorTest.php: regression test seeding a *.sh with a SCRIPTDIR directive plus a genuine rotating token, asserting the directive survives rotation byte-for-byte.

Test plan

  • php bin/lint-versions.phpopenemr.sh/ssl.sh no longer flagged (the two remaining rel_branch_ref findings pre-exist on master, unrelated)
  • vendor/bin/phpunit — 175 tests green, including the new regression
  • Dry-run rotation reproducing Release rotation (auto) #760 (--current=8.1 --dry-run) no longer touches the # shellcheck source= line in either script
  • shellcheck docker/openemr/8.0.0/openemr.sh ssl.sh — clean

…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.
Copilot AI review requested due to automatic review settings June 1, 2026 17:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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.sh and ssl.sh to use # shellcheck source=SCRIPTDIR/env.stub instead of a versioned repo-relative path.
  • Remove the shellcheck_source pin entries for the 8.0.0 init scripts from tools/release/versions.yml.
  • Add a PHPUnit regression test ensuring rotation rewrites real docker_dir pins while leaving SCRIPTDIR ShellCheck 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.

Comment thread tools/release/tests/SlotRotatorTest.php Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@kojiromike kojiromike merged commit cbc6a92 into openemr:master Jun 1, 2026
15 checks passed
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.

Slot rotation corrupts self-referential paths and immutable build trees (current-slot rotation)

2 participants