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

fix: Add new release pipeline with production template #1262

Merged
merged 5 commits into from
Mar 27, 2024

Conversation

v-viyada
Copy link
Contributor

Details

Added new yml file for production release using production template and EnableSemanticRelease variable. Also moved the common code between CI and release pipeline to common template.

The new release pipeline will be added mseng ADO as it requires access to key vault for getting github and npm publish tokens.
To create pipeline in mseng ADO, yaml file should be available in main branch so I will create and test the new release pipeline after merging this PR.

Motivation
Context

Pull request checklist

  • PR title respects Conventional Commits (starts with fix:, feat:, etc, and is suitable for user-facing release notes)
  • PR contains no breaking changes, OR description of both PR and final merge commit starts with BREAKING CHANGE:
  • [n/a] (if applicable) Addresses issue: #0000
  • [n/a] Added relevant unit tests for your changes
  • Ran yarn precheckin
  • [n/a] Verified code coverage for the changes made

@v-viyada v-viyada marked this pull request as ready for review March 26, 2024 23:51
@v-viyada v-viyada requested a review from a team as a code owner March 26, 2024 23:51
parameters:
- name: enableSemanticRelease
type: boolean
default: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this pipeline run on every commit (and we manually enable enableSemanticRelease when we want to release), or will this pipeline be manually triggered (and enableSemanticRelease defaults to true via the pipeline variables) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This pipeline will be CI disabled and will be triggered manually when we want to release. The default value is set to false for accidental manual trigger. So to do the release we manually trigger the pipeline and set the value to true.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that the official template would detect a blocking issue that the unofficial pipeline would not detect? If that answer is yes, then we should not release until after all official checks have completed. To my mind, the simplest answer is to decouple release from CI, which could take multiple forms:

  1. CI enable the official build with release disabled. To release, we manually trigger the CI build at a validated SHA and with the release flag turned on
  2. Move the publishing into a separate pipeline that consumes artifacts from the pipeline that uses the official template. The official template pipeline could be triggered either manually or on CI (I'd lean toward CI but it's not fully required)
  3. It might be possible to move the release step into a job that runs only after the official pipeline completes successfully. This would require support from the templates and may or may not be something they would want to encourage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, official template runs extra sdl tools and can detect blocking issue which unofficial would not detect. I think we can go with option 1.

  1. We can go with this option to keep CI enabled and manually trigger the build with release flag turned on. We do not require any further code change for this and enable the CI at pipeline level.
  2. The release task do not consume any artifacts generated in CI pipeline. We are using semantic-release which takes care of everything. For release, we have to just run yarn semantic-release command. So creating separate release will not work well here.
  3. We can try this but the release job will never run until we set the release flag to true manually. It does not make much difference between this and point#1 to me but this will require code changes and testing.

@v-viyada
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines failed to run 1 pipeline(s).

@v-viyada v-viyada requested a review from DaveTryon March 27, 2024 18:40
Copy link
Contributor

@DaveTryon DaveTryon left a comment

Choose a reason for hiding this comment

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

Looks good on the assumption that we enable CI triggers for the official template (with enableSemanticRelease set to false), then we manually trigger the same pipeline (with enableSemanticRelease set to true) to trigger the release at a validated SHA

@v-viyada v-viyada merged commit ef42d54 into main Mar 27, 2024
4 checks passed
@ada-cat
Copy link
Collaborator

ada-cat commented Mar 28, 2024

🎉 This PR is included in version 2.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants