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

ci: publish prerelease versions #2548

Merged
merged 2 commits into from
Nov 11, 2022
Merged

ci: publish prerelease versions #2548

merged 2 commits into from
Nov 11, 2022

Conversation

btaillon-coveo
Copy link
Contributor

@btaillon-coveo btaillon-coveo commented Nov 10, 2022

https://coveord.atlassian.net/browse/KIT-2114

In theory, this PR should cause the following to happen:

  • Any commit on a branch titled prerelease/** should execute the same CI as the master branch
    • Commit bumps on this branch will instead bump packages with Lerna's default -pre.# suffix (see conventional-prerelease).
    • Jenkins will skip updating the alpha NPM tag for any commit that isn't on the master branch.
    • The deployment pipeline will disable package_rollout for any commit that isn't on the master branch, which will prevent it from ever reaching stg and prd (which are responsible for publishing to the staging CDN, publishing to the prod CDN, updating the NPM beta tag and updating the NPM latest tag).

@btaillon-coveo btaillon-coveo requested a review from a team as a code owner November 10, 2022 13:45
@btaillon-coveo btaillon-coveo requested review from olamothe and ThibodeauJF and removed request for a team November 10, 2022 13:45
@@ -190,7 +190,8 @@
"no_endpoint": true
},
"package_rollout": {
"only_consider_changesets_after": "b244fe702d8e96d016a52715e92c8131acfde3ba"
"only_consider_changesets_after": "b244fe702d8e96d016a52715e92c8131acfde3ba",
"disabled": $[STOP_AT_DEV]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The quotation marks are missing here, and it's on purpose. This will be replaced by the variable directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you don't like the syntax error here, I can convert the file to YAML.

@@ -3,6 +3,7 @@ on:
push:
branches:
- master
- 'prerelease/**'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +1 to +5
def parseSemanticVersion(String version) {
def semanticVersionRegex = /^(((([0-9]+)\.[0-9]+)\.[0-9]+)(?:\-.+)?)$/
def (_, prerelease, patch, minor, major) = (version =~ semanticVersionRegex)[0]
return [major, minor, patch, prerelease]
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested this in a repl.

Try executing the following in https://www.jdoodle.com/execute-groovy-online/:

def parseSemanticVersion(String version) {
  def semanticVersionRegex = /^(((([0-9]+)\.[0-9]+)\.[0-9]+)(?:\-.+)?)$/
  def (_, prerelease, patch, minor, major) = (version =~ semanticVersionRegex)[0]
  return [major, minor, patch, prerelease]
}

def printVersion(String version) {
  def (major, minor, patch, prerelease) = parseSemanticVersion(version)
  println "== ${version} =="
  println "Major: ${major}"
  println "Minor: ${minor}"
  println "Patch: ${patch}"
  println "Prerelease: ${prerelease}"
}

printVersion("123.456.789-pre.1")
print "\n"
printVersion("123.456.789")

const masterCommitHash = await getHeadCommitHash();

if (buildCommitHash !== masterCommitHash) {
if ((await getHowManyCommitsBehind()) !== 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the condition here since we now execute this script on more branches than just master.

@github-actions
Copy link

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 214.6 214.6 0
search 310.9 310.9 0
insight 255.5 255.5 0
product-listing 228.1 228.1 0
product-recommendation 212.3 212.3 0
recommendation 212.2 212.2 0

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

Successfully merging this pull request may close these issues.

2 participants