Skip to content

Fix Yarn installs immediately after erxes package releases - #11

Merged
Amartuvshins0404 merged 1 commit into
mainfrom
fix/yarn-fresh-erxes-releases
Oct 21, 2026
Merged

Amartuvshins0404 merged 1 commit into
mainfrom
fix/yarn-fresh-erxes-releases

Conversation

@Amartuvshins0404

@Amartuvshins0404 Amartuvshins0404 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Yarn 4.18.1 quarantines npm releases for 24 hours, so the generated project could not install the newly published @erxes/*@3.3.4 packages. Preapprove only the exact first-party versions selected by the scaffold, keeping the age gate for other versions and dependencies.

Share the release constants between dependency generation and Yarn approvals. The Yarn end-to-end test forces the erxes packages into quarantine, verifies installation fails without approvals, then installs, checks and builds with the generated approvals.

Verified: 54 unit tests, typecheck, lint, Linux binary compilation, and the packed CLI platform/Yarn end-to-end test with CI=true.

Summary by Sourcery

Allow generated projects to install newly published erxes packages without disabling Yarn's dependency age gate.

Bug Fixes:

  • Allow generated projects to install the exact newly released first-party erxes packages immediately while retaining Yarn's quarantine protection for other packages and versions.

Enhancements:

  • Centralize erxes host and package release constants for reuse across dependency generation and Yarn configuration.

Tests:

  • Extend the Yarn end-to-end coverage to verify quarantined first-party releases fail without approvals and succeed with the generated approvals.

@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR fixes fresh Yarn installs after erxes releases by sharing release metadata between dependency generation and Yarn configuration, preapproving only the exact first-party versions selected by each scaffold, and adding an end-to-end quarantine test that confirms unrelated dependency age gating remains enforced.

File-Level Changes

Change Details Files
Centralize erxes host and npm release constants for reuse across scaffold dependencies and Yarn configuration.
  • Add shared release constants and package aliases.
  • Re-export constants from the existing scaffold module.
  • Use the selected package versions when generating dependencies and Yarn preapprovals.
src/releases.ts
src/scaffold.ts
src/generated.ts
Preapprove only scaffold-selected first-party package versions while retaining Yarn's age gate for all other packages.
  • Configure exact erxes package versions as Yarn preapproved packages.
  • Include the API shared package only for platform backends.
  • Keep immutable-install behavior and existing package extensions unchanged.
src/generated.ts
Extend the Yarn end-to-end test to prove quarantined releases require and honor generated approvals.
  • Force erxes packages into quarantine with a temporary 100-year age gate.
  • Verify installation fails without approvals and reports quarantine.
  • Restore generated approvals, then run peer checks, code generation, and build validation.
test/e2e.test.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ee03814-2bd6-4765-924c-7ebb1c7ea486
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/generated.ts" line_range="189" />
<code_context>
+          // These exact first-party releases are selected by the scaffold.
+          // Allow installing immediately after publication while preserving
+          // Yarn's age gate for all other packages and versions.
+          npmPreapprovedPackages: [
+            ERXES_PACKAGES["erxes-ui"].slice(4),
+            ERXES_PACKAGES["ui-modules"].slice(4),
</code_context>
<issue_to_address>
**Installs stop on older Yarn**

When a project is generated with a Yarn version that predates `npmPreapprovedPackages`, the scaffold emits `npmPreapprovedPackages` without guarding against that Yarn version, so Yarn rejects the setting during configuration loading and installation stops before resolving packages.

Only emit this setting for supported Yarn versions, or enforce a minimum Yarn version before scaffolding.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and newly generated Yarn projects will bypass the age quarantine for the listed exact erxes package releases, so a compromised or otherwise unsafe release could execute during installation before the gate would normally allow it. Reverting stops future scaffolds from adding the exception, but cannot undo installs or any secrets exposed by affected projects.

Blocking findings: src/generated.ts:189


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread src/generated.ts
// These exact first-party releases are selected by the scaffold.
// Allow installing immediately after publication while preserving
// Yarn's age gate for all other packages and versions.
npmPreapprovedPackages: [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Installs stop on older Yarn

When a project is generated with a Yarn version that predates npmPreapprovedPackages, the scaffold emits npmPreapprovedPackages without guarding against that Yarn version, so Yarn rejects the setting during configuration loading and installation stops before resolving packages.

Only emit this setting for supported Yarn versions, or enforce a minimum Yarn version before scaffolding.

Prompt for AI agents
In `src/generated.ts` at line 189:

**Installs stop on older Yarn**

When a project is generated with a Yarn version that predates `npmPreapprovedPackages`, the scaffold emits `npmPreapprovedPackages` without guarding against that Yarn version, so Yarn rejects the setting during configuration loading and installation stops before resolving packages.

Only emit this setting for supported Yarn versions, or enforce a minimum Yarn version before scaffolding.

@Amartuvshins0404
Amartuvshins0404 merged commit 9ddcc66 into main Oct 21, 2026
18 checks passed
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.

1 participant