Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: re-enable latest version checks during release #29545

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

alan-agius4
Copy link
Collaborator

This commit restores the latest version checks, which are now fixed by using the stamped versions.

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Jan 30, 2025
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Jan 30, 2025
@alan-agius4 alan-agius4 force-pushed the version-checks branch 2 times, most recently from 07aec9a to 622640b Compare January 30, 2025 11:13
// Root of the Angular CLI project.
const root = fileURLToPath(new URL('../../../', import.meta.url));
const rootRequire = createRequire(root);
const { latestVersions } = rootRequire('./dist/@schematics/angular/utility/latest-versions.js');
Copy link
Member

Choose a reason for hiding this comment

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

Is dist/ guaranteed to be existent here? Seems like an assumption that is potentially brittle. Also the createRequire is not super great :(

Copy link
Collaborator Author

@alan-agius4 alan-agius4 Jan 30, 2025

Choose a reason for hiding this comment

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

Yes, the NPM packages are always built in the dist, I did noticed that I was not reading from the release directory though which I amended.

const defaultDistPath = join(projectDir, 'dist/releases');

Regarding createRequire, I agree that using a RegExp could work. However, I lean toward this approach since it minimizes the risk of false positives or negatives.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, definitely agreed on it being better than a RegExp.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally we'd somehow pass the packages and their artifact paths to the pre=release checks, but that's not possible right now, so LGTM

This commit restores the latest version checks, which are now fixed by using the stamped versions.
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 30, 2025
@alan-agius4 alan-agius4 merged commit 2552093 into angular:main Jan 30, 2025
30 checks passed
@alan-agius4 alan-agius4 deleted the version-checks branch January 30, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants