fix(scripts): resolve release artifacts from fork#148
fix(scripts): resolve release artifacts from fork#148
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR implements dynamic release repository resolution for the Lumen plugin, allowing it to download binaries from a configurable or auto-detected GitHub repository instead of the hardcoded ChangesDynamic Release Repository Resolution
Sequence Diagram(s)No sequence diagram generated. The changes are primarily configuration updates, helper function additions, and test enhancements without significant new control flow across 3+ distinct components. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
scripts/test_run_windows.ps1 (1)
183-212: ⚡ Quick winAdd a Windows SSH-origin scenario.
run.bathandlesgit@github.com:andssh://git@github.com/, but this suite only exercises the HTTPS origin form. Adding at least one SSH-origin case here would keep the Windows coverage aligned withscripts/test_run.shand with the launcher behavior this PR added. As per coding guidelines, "Keep.claude-plugin/,.codex/,.cursor-plugin/,.cursor/,.opencode/,hooks/,skills/,scripts/, andpackage.jsonaligned where they represent the same Lumen distribution".🤖 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 `@scripts/test_run_windows.ps1` around lines 183 - 212, Add a Windows SSH-origin scenario by invoking Invoke-RunBatScenario with an SSH-style OriginUrl (e.g., 'git@github.com:def324/lumen.git' or 'ssh://git@github.com/def324/lumen.git'), set ExpectedRepo to 'def324/lumen' and provide a descriptive PassMessage (e.g., 'run.bat stdio derives first-install download repo from SSH origin'); place this new Invoke-RunBatScenario alongside the other cases so run.bat's SSH-origin handling is exercised on Windows, matching the coverage in scripts/test_run.sh.
🤖 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 `@scripts/run.bat`:
- Around line 28-48: The current validation for LUMEN_RELEASE_REPO allows values
like "def324/lumen.git" which later build a broken URL; update the check in the
run.bat block that handles LUMEN_RELEASE_REPO (variables REPO and REPO_OWNER) to
either reject inputs ending with ".git" or normalize by stripping a trailing
".git" from REPO before further validation and URL construction; implement this
by trimming ".git" from the REPO value (or adding an explicit error message)
immediately after setting REPO and before the regex/owner extraction so
subsequent checks (REPO_OWNER, length and dash checks) and any download URL use
the sanitized repo name.
- Line 30: The echo(!REPO!| findstr ... and echo(!CANDIDATE!| findstr ... usages
expand unquoted environment variables into the cmd pipeline and allow
metacharacter injection; replace these checks by performing the regex validation
in PowerShell (e.g., use the -match operator against $env:REPO/$env:CANDIDATE
and exit non‑zero on failure) or, if you must stay in batch, disable delayed
expansion and defensively escape/quote the variable contents before piping (or
sanitize by removing/escaping &,|,>,<,^) so that REPO and CANDIDATE are treated
as data rather than parsed commands. Ensure the change targets the validation
logic that references REPO and CANDIDATE so no unquoted expansions are piped
into findstr.
In `@scripts/run.sh`:
- Around line 27-39: The valid_release_repo function currently allows repo names
ending with .git; update it to either normalize by stripping a trailing ".git"
from the input before parsing (e.g., trim suffix from the argument inside
valid_release_repo) or change the name validation to reject names that end with
".git"; adjust the owner/name extraction (owner="${repo%%/*}" and
name="${repo#*/}") to operate on the normalized value and re-run the existing
regex checks (owner and name) against the cleaned name so LUMEN_RELEASE_REPO
values like "def324/lumen.git" become "def324/lumen" or are rejected outright.
---
Nitpick comments:
In `@scripts/test_run_windows.ps1`:
- Around line 183-212: Add a Windows SSH-origin scenario by invoking
Invoke-RunBatScenario with an SSH-style OriginUrl (e.g.,
'git@github.com:def324/lumen.git' or 'ssh://git@github.com/def324/lumen.git'),
set ExpectedRepo to 'def324/lumen' and provide a descriptive PassMessage (e.g.,
'run.bat stdio derives first-install download repo from SSH origin'); place this
new Invoke-RunBatScenario alongside the other cases so run.bat's SSH-origin
handling is exercised on Windows, matching the coverage in scripts/test_run.sh.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fc855928-cc85-4305-aa8a-14451465c64c
📒 Files selected for processing (7)
.github/workflows/ci.yml.github/workflows/release-please.yml.goreleaser.ymlscripts/run.batscripts/run.shscripts/test_run.shscripts/test_run_windows.ps1
💤 Files with no reviewable changes (1)
- .goreleaser.yml
Summary
Make Lumen launcher release downloads work from fork checkouts and keep fork workflow runs away from upstream-only publishing paths.
Test Plan
Summary by CodeRabbit
LUMEN_RELEASE_REPOenvironment variable; scripts now automatically derive release location from local Git configuration with fallback to default.