Skip to content

ci: publish prerelease versions#2548

Merged
btaillon-coveo merged 2 commits intoKIT-2017from
KIT-2114
Nov 11, 2022
Merged

ci: publish prerelease versions#2548
btaillon-coveo merged 2 commits intoKIT-2017from
KIT-2114

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 review from a team, ThibodeauJF and olamothe and removed request for a team November 10, 2022 13:45
"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.

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