Skip to content

feat: Logging installed pnpm version#245

Open
djmurphy32 wants to merge 3 commits intopnpm:masterfrom
djmurphy32:output-version
Open

feat: Logging installed pnpm version#245
djmurphy32 wants to merge 3 commits intopnpm:masterfrom
djmurphy32:output-version

Conversation

@djmurphy32
Copy link
Copy Markdown

@djmurphy32 djmurphy32 commented May 3, 2026

This resolves #238

Summary by CodeRabbit

  • New Features
    • Installer now logs "Installed pnpm version: …" for clearer feedback after setup.
    • When a target version is specified, the installer reports that version; otherwise it reports the computed bootstrap version.
    • Generated package metadata during bootstrap is produced more consistently.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

📝 Walkthrough

Walkthrough

Bootstrap package.json creation now uses object constants for the embedded pnpm / @pnpm/exe packages, writes them via JSON.stringify, computes the bootstrap version from lockfile/standalone mode, and logs the installed pnpm version with @actions/core.info (preferring targetVersion when provided).

Changes

Bootstrap Package JSON Refactor & Version Logging

Layer / File(s) Summary
Imports
src/install-pnpm/run.ts
info added to @actions/core imports for logging.
Data Shape
src/install-pnpm/run.ts
Introduce object constants BOOTSTRAP_PNPM_PACKAGE and BOOTSTRAP_EXE_PACKAGE (object-typed package.json contents) instead of pre-stringified JSON.
Core Implementation
src/install-pnpm/run.ts
Select the appropriate bootstrap package object based on standalone/lockfile mode; derive bootstrappedVersion from that selection.
IO / Wiring
src/install-pnpm/run.ts
Write bootstrap package.json using JSON.stringify(packageJson) rather than writing a pre-serialized string.
Logging
src/install-pnpm/run.ts
After optional pnpm self-update, call info to log Installed pnpm version: ${targetVersion ?? bootstrappedVersion}.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through JSON, tidy and spry,
Objects bloom where strings used to lie,
A version's whispered, soft and bright,
Target or bootstrap — all set right. 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check ✅ Passed The title 'feat: Logging installed pnpm version' accurately describes the main change: adding logging for the installed pnpm version using improved version tracking and @actions/core info logging.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@src/install-pnpm/run.ts`:
- Around line 29-30: The code computes installedVersion up front (const
installedVersion = standalone ? BOOTSTRAP_EXE_PACKAGE.dependencies['@pnpm/exe']
: BOOTSTRAP_PNPM_PACKAGE.dependencies.pnpm) but later may perform a self-update
to targetVersion and still logs the original installedVersion; update the logic
so the logged version is determined after any self-update: either set a new
variable (e.g., loggedVersion) to targetVersion when the self-update path (the
code that uses targetVersion) runs, or recompute/read the actual installed
package version from the written package.json/installed metadata before logging;
adjust uses in run.ts to reference this post-update value instead of the
original installedVersion.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c34c81ae-ba17-47fe-b9aa-00426ad1e855

📥 Commits

Reviewing files that changed from the base of the PR and between 8912a91 and e710aca.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (1)
  • src/install-pnpm/run.ts

Comment thread src/install-pnpm/run.ts Outdated
@djmurphy32 djmurphy32 changed the title fix: Logging installed pnpm versions fix: Logging installed pnpm version May 3, 2026
@djmurphy32 djmurphy32 changed the title fix: Logging installed pnpm version feat: Logging installed pnpm version May 4, 2026
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.

action-setup should print the version of pnpm that it picked

1 participant