Skip to content

build: ensure angular version placeholder is up-to-date when staging release #17465

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

Merged

Conversation

devversion
Copy link
Member

@devversion devversion commented Oct 22, 2019

Ensures that the Angular version placeholder is properly updated when
staging the release. We perform this as part of the staging script,
since changes between staging and publishing are not expected
and this is enforced by the publish script.

Additionally, the rules are very strict. If something ever changes
due to unknown reasons, the peer dependency checks needs to be
disabled manually / or updated.

…release

Ensures that the Angular version placeholder is properly updated when
staging the release. We perform this as part of the staging script,
since changes between staging and publishing are *not* expected
and this is enforced by the publish script.

Additionally, the rules are very strict. If something ever changes
due to unknown reasons, the peer dependency checks needs to be
disabled manually / or updated.
@devversion devversion requested a review from a team as a code owner October 22, 2019 12:43
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 22, 2019
@devversion devversion changed the title build: ensure angular version placeholder is up-to-date when staging … build: ensure angular version placeholder is up-to-date when staging release Oct 22, 2019
}

const configFileContent = readFileSync(bzlConfigPath, 'utf8');
const matches = configFileContent.match(/ANGULAR_PACKAGE_VERSION = ["']([^"']+)/);
Copy link
Member Author

Choose a reason for hiding this comment

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

I do not know of a better way to get the version placeholder from the Bazel .bzl file.

Copy link
Member

Choose a reason for hiding this comment

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

You could make a nodejs_binary that takes in the version placeholder as an argument and writes it to stdout or a genrule that outputs the placeholder to a file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's what we are doing for the rollup globals check (the genrule). Though it would complicate things if a file needs to be built by Bazel whenever the staging script runs. i.e. would we just spawn a process to build it?

The nodejs binary one is more interesting, but unfortunately it would complicate things too. If you remember, we used Bazel initially for the release scripts, but the scripts ran in the Bazel bin directory..

Copy link
Member

Choose a reason for hiding this comment

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

For the genrule, yeah, that's what I had in mind (spawn a child process).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that would work. I don't mind much either. Happy to do the genrule if you slightly prefer it more than the other options. I'm somehow preferring the current one since we basically just need static analysis and actually building seems unnecessary. It's a more robust idea though.

@devversion devversion added pr: merge safe target: patch This PR is targeted for the next patch release labels Oct 22, 2019
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

I don't feel super strongly about the bzl thing

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 22, 2019
@mmalerba mmalerba merged commit d3235c9 into angular:master Oct 23, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants