Skip to content

feat(ng-dev/release): implement publish-ci command and tests#3774

Open
josephperrott wants to merge 1 commit into
angular:mainfrom
josephperrott:task-2.3-publish-ci-tests
Open

feat(ng-dev/release): implement publish-ci command and tests#3774
josephperrott wants to merge 1 commit into
angular:mainfrom
josephperrott:task-2.3-publish-ci-tests

Conversation

@josephperrott

Copy link
Copy Markdown
Member

This PR implements the publish-ci command for CI-driven publishing, including monorepo-style tagging support and full unit tests. Stacked on top of the staging CLI changes.

@josephperrott josephperrott requested a review from alan-agius4 June 9, 2026 15:01
@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label Jun 9, 2026
@angular-robot angular-robot Bot added the detected: feature PR contains a feature commit label Jun 9, 2026
@josephperrott josephperrott force-pushed the task-2.3-publish-ci-tests branch from 9c26aae to 2c7699f Compare June 9, 2026 15:03

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new publish-ci command and PublishCiTool to support publishing releases directly from CI, alongside a stage-only option for the existing publish command to allow staging a release and exiting early. To support these additions, the PR introduces a StageOnlySuccessError for clean exits, updates action constructors, and adds extensive test coverage. Feedback on the changes highlights a potential issue in PublishCiTool where listing tags might fail in CI environments due to shallow clones, suggesting an explicit git fetch --tags before querying tags.

let previousVersionTag: string;
if (newSemver.prerelease.length === 0 && versionAtBeforeStagingSemver.prerelease.length > 0) {
// Stable release compared to prerelease. We must find the previous stable version.
const tagsOutput = this.git.run(['tag', '-l', 'v*']).stdout.trim();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

In a CI environment, repositories are typically cloned using a shallow clone or without fetching all tags (for example, the default behavior of actions/checkout in GitHub Actions is fetch-depth: 1 and no tags).

If the tags are not fetched, git tag -l 'v*' will return an empty list or be incomplete. This will cause the tool to fail to find the previous stable version tag, throwing an error or failing during the release notes generation range check.

To ensure robustness in CI, we should explicitly fetch the tags from the remote repository before listing them.

Suggested change
const tagsOutput = this.git.run(['tag', '-l', 'v*']).stdout.trim();
this.git.run(['fetch', '--tags', this.git.getRepoGitUrl()]);
const tagsOutput = this.git.run(['tag', '-l', 'v*']).stdout.trim();
References
  1. Ensure all required git metadata (such as tags) is explicitly fetched from the remote in CI environments to prevent failures due to shallow or incomplete clones.

@josephperrott josephperrott force-pushed the task-2.3-publish-ci-tests branch 2 times, most recently from 47a4e9a to 9e264d4 Compare June 9, 2026 15:13
@josephperrott josephperrott force-pushed the task-2.3-publish-ci-tests branch from 9e264d4 to 97fc764 Compare June 9, 2026 15:17
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 detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant