Repository navigation
fix: scan the base with the CLI the project installed - #16
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 minutes. View limit details
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. |
Observability score · 64needs work 2 instrumented · 0 partial · 2 dark Fix first (2)
evlog map v0.8.0 · how the score works · what each check expects |
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.
Since
@evlog/cli0.10, the CLI's launcher hands off to an@evlog/clithe project installed. The action runsnpx -p @evlog/cli@<pin> evlog mapin the package, so once the workflow has installed dependencies, the pull request scan runs the project's CLI. The base scan runs in a fresh worktree with nonode_modules, so it always ran the pin. The comparison then used two CLI versions. A rule-set change between them makes--baselineexit 2 (MAP_BASELINE_VERSION_MISMATCH). Without one, score changes between versions show up as regressions or fixes the pull request didn't make.With the default pin (0.8.0, no hand-off) this only affects users who set
versionto 0.10 or later. After #15 pins the 1.0 line, it would affect every project that installs@evlog/cli.Fix
projectCli(incli.mjs) asks the pinned spec which version it runs in the package (evlog --version, samenpx -p, same cwd). If that's the version installed in the package, the base is scanned by running that installed binary withnode. Otherwise nothing changes: no CLI installed, or an old pin that doesn't hand off. Running the installed binary instead of@evlog/cli@<version>from npm also covers a CLI that isn't on npm, such as a pkg.pr.new build or a workspace link.Before and after
A git repo built from the
hono-appfixture with@evlog/cli@0.11.2installed, and a pull request fromfeatureintomain.version: 1.0.0-beta.2,baseline: auto. Annpxshim onPATHlogs which CLI eachnpxcall resolves to.Before (
main):After (the first line is the
--versionprobe, and the base scan no longer goes throughnpx):cliVersionof the base map frombaselineFor, same repo:Without the local install, the run is unchanged: both scans resolve to
1.0.0-beta.2.Tests
test/cli.test.mjs:projectCliwith a stubnpx. It returns the install when the spec hands off,undefinedwhen the spec runs itself (a pin without the hand-off), andundefinedwith nothing installed.test/project-cli-integration.mjs, newproject-clijob intest.yml: the scenario above, end to end throughsrc/main.mjs, asserting the base runs the project's 0.11.2 anddelta=0. It fails onmain's code:npm test: 92 pass.npm run check: clean.The README's "Which CLI runs" section now says a project's own install takes over.
ELI5
The action compares a pull request with the branch it targets. When a project installs its own copy of the evlog CLI, the pull request was checked with that copy and the target branch with a different one, which could fail the comparison or report changes nobody made. Both sides now use the same copy.