Skip to content

replace outdated scripts with scripts delegating to distribution/scripts - #3133

Merged
predic8 merged 6 commits into
masterfrom
update-old-scripts
Aug 11, 2026
Merged

replace outdated scripts with scripts delegating to distribution/scripts#3133
predic8 merged 6 commits into
masterfrom
update-old-scripts

Conversation

@christiangoerdes

@christiangoerdes christiangoerdes commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Improvements
    • Launchers now automatically locate the Membrane installation from nested directories.
    • Startup is handled consistently through the shared Membrane runner.
    • Command-line arguments and exit statuses are preserved.
    • Access-logging examples automatically apply their Log4j2 configuration.
    • Missing installations now produce a clear error.
    • OpenAPI JWT authentication examples continue supporting proxy configuration and custom Java options.

@membrane-ci-server

Copy link
Copy Markdown

This pull request needs "/ok-to-test" from an authorized committer.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 108091ed-69ae-4141-a0f8-fdb4f4832740

📥 Commits

Reviewing files that changed from the base of the PR and between 175ba64 and 1be85f8.

📒 Files selected for processing (1)
  • distribution/examples/logging/access/membrane.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • distribution/examples/logging/access/membrane.sh

📝 Walkthrough

Walkthrough

The launchers search upward for the Membrane root, set MEMBRANE_HOME and MEMBRANE_CALLER_DIR, and delegate startup to shared runners. The access logging launchers also configure JAVA_OPTS for Log4j2.

Changes

Launcher delegation

Layer / File(s) Summary
Unix launcher delegation
distribution/examples/logging/access/membrane.sh, distribution/examples/openapi/jwt-auth/membrane.sh
The scripts replace direct Java startup with parent-directory root discovery and delegation to scripts/run-membrane.sh. The access example configures JAVA_OPTS for Log4j2.
Windows launcher delegation
distribution/examples/logging/access/membrane.cmd, distribution/examples/openapi/jwt-auth/membrane.cmd, distribution/router/membrane.cmd
The scripts search for the Membrane root, set launcher environment variables, forward arguments to run-membrane.cmd, preserve its exit code, and report missing roots with status 1.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: predic8

Poem

I search each parent path for the Membrane root,
Then pass every argument to the runner.
Caller and home variables take their place,
Log4j2 guides the access logs,
A rabbit approves the tidy launch.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes replacing outdated scripts with scripts that delegate execution to distribution/scripts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-old-scripts

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.

@christiangoerdes

Copy link
Copy Markdown
Collaborator Author

/ok-to-test

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
distribution/router/membrane.cmd (1)

9-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

The root-discovery block is duplicated across all five launchers. Each launcher repeats the same upward search for LICENSE.txt plus the runner script, the same two environment variable exports, and the same error message. A change to the discovery rule, for example adding a marker file or supporting a pre-set MEMBRANE_HOME, requires five edits. The five copies will drift.

Consider extracting the discovery step into one shared script per platform, for example distribution/scripts/find-membrane-home.cmd and distribution/scripts/find-membrane-home.sh. A launcher cannot source a shared script before it locates the root, so keep a minimal bootstrap in each launcher and place the rest in the shared script.

  • distribution/router/membrane.cmd#L9-L20: replace the inline :search_up block with a call to the shared discovery script.
  • distribution/examples/logging/access/membrane.cmd#L9-L16: replace the inline :search_up block with the same shared call.
  • distribution/examples/openapi/jwt-auth/membrane.cmd#L2-L24: replace the inline :search_up block with the same shared call.
  • distribution/examples/logging/access/membrane.sh#L7-L15: replace the inline while loop with a call to the shared Unix discovery script.
  • distribution/examples/openapi/jwt-auth/membrane.sh#L10-L18: replace the inline while loop with the same shared call.

This is a maintainability improvement, not a defect. You can defer it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@distribution/router/membrane.cmd` around lines 9 - 20, The launcher scripts
duplicate root-discovery and environment setup logic; centralize it in shared
distribution/scripts/find-membrane-home.cmd and find-membrane-home.sh scripts.
In distribution/router/membrane.cmd lines 9-20,
distribution/examples/logging/access/membrane.cmd lines 9-16, and
distribution/examples/openapi/jwt-auth/membrane.cmd lines 2-24, retain only
minimal bootstrap logic and call the shared Windows discovery script. In
distribution/examples/logging/access/membrane.sh lines 7-15 and
distribution/examples/openapi/jwt-auth/membrane.sh lines 10-18, replace the
inline while loops with the shared Unix discovery script, preserving runner
invocation and existing environment exports.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@distribution/examples/logging/access/membrane.cmd`:
- Line 7: Update the JAVA_OPTS assignment in membrane.cmd to quote the complete
-Dlog4j.configurationFile value, including the %SCRIPT_DIR%\log4j2_access.xml
path, so spaces in the installation directory remain intact during the later
Java invocation.

In `@distribution/examples/logging/access/membrane.sh`:
- Around line 7-15: Add tests for the root-discovery logic in
distribution/examples/logging/access/membrane.sh lines 7-15,
distribution/examples/openapi/jwt-auth/membrane.sh lines 10-18,
distribution/examples/logging/access/membrane.cmd lines 9-16,
distribution/examples/openapi/jwt-auth/membrane.cmd lines 2-24, and
distribution/router/membrane.cmd lines 9-20. Cover roots at the script directory
and several levels above, a LICENSE.txt-only directory, no root with exit status
1, and Windows install paths containing spaces; assert the discovered
MEMBRANE_HOME and exit codes, including the JAVA_OPTS behavior for the
logging/access Windows launcher.

---

Nitpick comments:
In `@distribution/router/membrane.cmd`:
- Around line 9-20: The launcher scripts duplicate root-discovery and
environment setup logic; centralize it in shared
distribution/scripts/find-membrane-home.cmd and find-membrane-home.sh scripts.
In distribution/router/membrane.cmd lines 9-20,
distribution/examples/logging/access/membrane.cmd lines 9-16, and
distribution/examples/openapi/jwt-auth/membrane.cmd lines 2-24, retain only
minimal bootstrap logic and call the shared Windows discovery script. In
distribution/examples/logging/access/membrane.sh lines 7-15 and
distribution/examples/openapi/jwt-auth/membrane.sh lines 10-18, replace the
inline while loops with the shared Unix discovery script, preserving runner
invocation and existing environment exports.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d3613be7-bd82-4017-b46b-d97b44eda4f8

📥 Commits

Reviewing files that changed from the base of the PR and between 82a1313 and 56c5607.

📒 Files selected for processing (5)
  • distribution/examples/logging/access/membrane.cmd
  • distribution/examples/logging/access/membrane.sh
  • distribution/examples/openapi/jwt-auth/membrane.cmd
  • distribution/examples/openapi/jwt-auth/membrane.sh
  • distribution/router/membrane.cmd

Comment thread distribution/examples/logging/access/membrane.cmd Outdated
Comment thread distribution/examples/logging/access/membrane.sh
@predic8 predic8 added this to the 7.5.0 milestone Aug 11, 2026
Comment thread distribution/examples/logging/access/membrane.cmd Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@distribution/examples/logging/access/membrane.sh`:
- Around line 4-5: Update the JAVA_OPTS setup in the membrane.sh example to
avoid word-splitting log4j2_access.xml paths when SCRIPT_DIR contains spaces.
Use the documented MEMBRANE_HOME-relative configuration path, or modify the
shared runner invoked by start_router.sh to preserve argument boundaries while
keeping the existing Java options behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f00ad2f5-12bd-4946-8b42-30e64010f426

📥 Commits

Reviewing files that changed from the base of the PR and between 255138e and 175ba64.

📒 Files selected for processing (5)
  • distribution/examples/logging/access/membrane.cmd
  • distribution/examples/logging/access/membrane.sh
  • distribution/examples/openapi/jwt-auth/membrane.cmd
  • distribution/examples/openapi/jwt-auth/membrane.sh
  • distribution/router/membrane.cmd
🚧 Files skipped from review as they are similar to previous changes (3)
  • distribution/examples/logging/access/membrane.cmd
  • distribution/examples/openapi/jwt-auth/membrane.cmd
  • distribution/router/membrane.cmd

Comment thread distribution/examples/logging/access/membrane.sh Outdated
@predic8
predic8 merged commit e9d127f into master Aug 11, 2026
5 of 6 checks passed
@predic8
predic8 deleted the update-old-scripts branch August 11, 2026 12:33
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.

membrane.cmd ignores JAVA_OPTS, so JVM options cannot be set on Windows

3 participants