Skip to content

ci: reuse the build artifact instead of rebuilding the core package - #12893

Merged
michaelbromley merged 5 commits into
masterfrom
ci/reuse-build-artifact
Oct 7, 2026
Merged

michaelbromley merged 5 commits into
masterfrom
ci/reuse-build-artifact

Conversation

@michaelbromley

Copy link
Copy Markdown
Member

Follow-up from #12854: tests-legacy-naming-strategies and lint each ran a full core build, because the build job's artifact held the wrong layout.

Why the artifact could not be reused

compile writes build/compiled, which the test suites run against. package writes build/package, which the workspace packages link against via publishConfig.directory. The build job only produced the first.

The blocker was not just that they are different directories. Both scripts began by deleting the whole of build/, so running one discarded the other's output and a single job could not produce both.

The change

Each script now cleans only what it owns. gulp package removes build/package and build/browser, the two directories it writes. A new clean:compiled task removes build/compiled, and compile uses that instead of the blanket clean. The blanket gulp clean stays for when you want the lot gone.

With that, build runs compile and then package, and one artifact carries both layouts. lint and tests-legacy-naming-strategies download it instead of rebuilding.

build also has to run whenever a job that consumes the artifact runs, or those jobs would be skipped along with it, so its condition now covers the lint and legacy-naming-strategies filters too.

Two things found on the way

packages/legacy-naming-strategies/** did not match the lint filter, so changes to that package's source were never linted unless its eslint config happened to change too. Since root lint fans out to every workspace package, the filter is now just packages/**.

None of the three eslint configs ignored coverage/, which is generated and gitignored. Running the tests and then linting meant eslint reported on c8's bundled HTML report scripts. Now ignored in all three.

Verification

The published tree is unchanged: build/package was snapshotted before the change and compared file by file after, 2949 files, no additions, removals or content differences.

compile then package and package then compile both leave all three directories present, so the order does not matter. After both, build/compiled/test holds its 948 compiled specs, build/compiled/test/utils/test-setup.js is in place for the mocha file hook, build/package/index.js exists, and the workspace link still resolves.

With a build already present and no local pnpm run package, as in the new jobs, pnpm run lint and the naming-strategies suite both pass.

The job graph was checked against the filters for several change shapes, including a codemod-only change, a legacy-naming-strategies-only change and a lockfile-only change. In each case where a consumer job runs, build runs too.

Not fixed here

pnpm run lint exited 2 once during this work and once previously, with output discarded both times. I could not reproduce it: three attempts that regenerate coverage and lint immediately all exited 0, as did every package individually and the recursive run. It has never happened in CI. Noting it rather than claiming the coverage ignores above fixed it, since I have no evidence they did.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review
  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 7fbbdd9 ⚖️ Balanced

Results up to commit e988595


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@pkg-pr-new

pkg-pr-new Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
  • typeorm-sql-js-example

    npm i https://pkg.pr.new/@typeorm/codemod@12893
    
    npm i https://pkg.pr.new/typeorm@12893
    

commit: 7fbbdd9

@sonarqubecloud

Copy link
Copy Markdown

@michaelbromley
michaelbromley enabled auto-merge (squash) October 7, 2026 16:13
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying typeorm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fbbdd9
Status: ✅  Deploy successful!
Preview URL: https://36c4b87a.typeorm.pages.dev
Branch Preview URL: https://ci-reuse-build-artifact.typeorm.pages.dev

View logs

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'typeorm-legacy-naming-strategies'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@michaelbromley
michaelbromley merged commit 4ee0bf1 into master Oct 7, 2026
46 checks passed
@michaelbromley
michaelbromley deleted the ci/reuse-build-artifact branch October 7, 2026 16:19
@github-actions github-actions Bot added this to the 2.0.next milestone Oct 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants