Repository navigation
Read the devlanes version from the project's lockfile when version is not set - #4
Conversation
Mira PR WalkthroughWhen Confidence: 3/5 ◉◉◉○○ Likely fine, limited visibility
1 file reviewed · 1 unresolved thread
|
There was a problem hiding this comment.
Mira Review Summary
The new lockfile e2e job in .github/workflows/ci.yml (line 339) is missing from the CI passed gate's needs, so its failure would not block merging. Adding it to that list would make the job a required check.
Key Issues
| Issue | Location | |
|---|---|---|
| 🔴 | The new lockfile e2e job is not listed in the CI passed gate's needs, so its failure would not block merging. |
.github/workflows/ci.yml:339 |
Closes #3.
With
versionempty (the new default), the action reads the devlanes version from the project's lockfile, else from an exact version inpackage.json, else uses 0.7.0. The newversion-sourceoutput and a log line say which:input, the file's path relative to the workspace, ordefault.Changes
src/detect.ts: one pure parser per format (pnpmLock,npmLock,yarnLock,bunLock,pythonLockfor uv and poetry,packageJson),fromPep440, the folder walk (pinnedVersion, with injectedexists/readFile/warn) andresolveVersionfor the precedence.src/inputs.ts:version('')returns'', whichmain.tstakes as "detect".releasePatternis exported so a detected version goes through the same format and minimum checks as an explicit one.src/main.ts: resolves the version before installing and setsversion-source.post.tsis unchanged.action.yml:versiondefaults to"", newversion-sourceoutput.version-sourceunder "Choosing the devlanes version", plus the inputs and outputs tables.lockfilejob overtest/fixtures/lockfile-pnpmandtest/fixtures/lockfile-uv(both generated by pnpm and uv, pinning 0.7.0) runscommand: installwithoutversionand checksversionandversion-source. The other jobs keepversion: ${{ env.DEVLANES_TEST_VERSION }}; this repo's rootpnpm-lock.yamlandpackage.jsonname no devlanes, so they still get 0.7.0, and a unit test guards that.Decisions
smol-toml1.9.1 (BSD-3-Clause, no dependencies) instead of a line reader, so a brokenuv.lockorpoetry.lockgets the "cannot be parsed" warning instead of silently not matching. It adds about 20 kB todist/main.js.packageManagerDependencies) as a document before the project's, as this repo's lockfile does, so the parser reads every document.yaml.parsewould have thrown on those.<folder>/node_modules/devlanes) of the working directory first, then those of the folders above it up to the lockfile's, since Node resolvesdevlanesfrom parent folders too. npm's own copy in a workspace covers a version that conflicts with the hoisted one.package.jsonlast. A nearer folder's exactpackage.jsontherefore beats a lockfile further up.package.json,version-sourceis the file's path relative to the workspace, the same as for lockfiles (package.jsonat the root,apps/web/package.jsonin a subfolder).link:../devlanesor a PEP 440.dev1) gets a warning and the search goes on, the same as a file that cannot be parsed. Only a release older than 0.7.0 fails the step.rcN/aN/bNmap to-rc.N/-alpha.N/-beta.N, andrc0maps to a bare-rc, matchingpep440inpackaging/pypi/build.py.pnpm addrewrote the rootpnpm-lock.yamlin pnpm's own style, andpnpm lint-fix(Biome) put it back in the committed style, so the lockfile diff is just the new dependency.Verification
pnpm lint-ci,pnpm test-types,pnpm test(75 tests) andpnpm buildpass locally, anddist/is rebuilt.dist/main.jsagainst a workspace whoseuv.lockpins 0.6.1. It fails withuv.lock pins devlanes 0.6.1, which is too old for this action; use 0.7.0 or later or set version.lockfilejob, which need CI.Releasing v0.2.0 and moving
v0are left to the maintainer.