From 1fc83d3618f3ee120d8654c5c30a24af9137d4b5 Mon Sep 17 00:00:00 2001 From: Mario Loriedo Date: Wed, 31 Mar 2021 13:02:33 +0200 Subject: [PATCH 1/2] Updates after renaming master branch to main Signed-off-by: Mario Loriedo --- .github/workflows/ci.yaml | 6 ++-- .../workflows/release-typescript-models.yaml | 2 +- docs/proposals/registry/registry-structure.md | 2 +- docs/proposals/versioning-and-release.md | 4 +-- make-release.sh | 28 +++++++++---------- samples/devfiles/sample-devfile.yaml | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d15d6089b..ea9267406 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,11 +1,11 @@ name: CI -# Triggers the workflow on push or pull request events but only for the master branch +# Triggers the workflow on push or pull request events but only for the main branch on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: build-and-validate: diff --git a/.github/workflows/release-typescript-models.yaml b/.github/workflows/release-typescript-models.yaml index fe83e5044..bd92e14da 100644 --- a/.github/workflows/release-typescript-models.yaml +++ b/.github/workflows/release-typescript-models.yaml @@ -4,7 +4,7 @@ name: types on: push: - branches: [ master ] + branches: [ main ] jobs: release-typescript-models: diff --git a/docs/proposals/registry/registry-structure.md b/docs/proposals/registry/registry-structure.md index adfbaa52e..32c3f415b 100644 --- a/docs/proposals/registry/registry-structure.md +++ b/docs/proposals/registry/registry-structure.md @@ -1,7 +1,7 @@ # Devfile Registry Structure This document outlines the structure of a Devfile Registry Repository that’s used as the basis for an OCI Devfile Registry, hosted on Kubernetes. It also outlines how individual files in each stack will get pushed up to the OCI registry. -This design proposal is a follow up to [Devfile Registry Packaging](https://github.com/devfile/api/blob/master/docs/proposals/registry/devfile-packaging.md) and I recommend reading that first. +This design proposal is a follow up to [Devfile Registry Packaging](https://github.com/devfile/api/blob/main/docs/proposals/registry/devfile-packaging.md) and I recommend reading that first. ## As-is Today Currently, the top-level structure of a devfile registry’s repository is unwritten, but it usually consists of a **devfiles** or **stacks** folder, and any associated files specific to that registry diff --git a/docs/proposals/versioning-and-release.md b/docs/proposals/versioning-and-release.md index a2681a8f2..7cbf7fda6 100644 --- a/docs/proposals/versioning-and-release.md +++ b/docs/proposals/versioning-and-release.md @@ -14,7 +14,7 @@ The Devfile Kubernetes API (defined in https://github.com/devfile/api/) is the s **How to Update?** - 1) Add a new folder for the version in the [devfile/api](https://github.com/devfile/api/) repository under [pkg/apis/workspaces](https://github.com/devfile/api/tree/master/pkg/apis/workspaces). For example `pkg/apis/workspaces/v1` if bumping the K8S API version to `v1`. + 1) Add a new folder for the version in the [devfile/api](https://github.com/devfile/api/) repository under [pkg/apis/workspaces](https://github.com/devfile/api/tree/main/pkg/apis/workspaces). For example `pkg/apis/workspaces/v1` if bumping the K8S API version to `v1`. 2) Add a schema and version in the CRD manifests 3) Go through the JSON schema update process outlined below to update the JSON schema version. 4) Update the devworkspace operator and devfile library to consume the Go structs in the new K8S API version, as needed. @@ -74,7 +74,7 @@ The following steps outline the steps done to release a new version of the Devfi v) A PR is opened to merge these changes into the release branch - vi) The schema version on the master branch is bumped and a PR is opened, provided the schema version passed in is **not** older than the master branch schema version. + vi) The schema version on the main branch is bumped and a PR is opened, provided the schema version passed in is **not** older than the main branch schema version. 5) Once the release PR is approved and merged, the release engineer creates a new release on GitHub based off the release branch that was just created and includes the generated `devfile.json` as a release artifact. - The tag `v{major}.{minor}.{bugfix}`, where the `{major}.{minor}.{bugfix}` corresponds to the devfile schema version, is used to enable the new version of the API to be pulled in as a Go module. diff --git a/make-release.sh b/make-release.sh index 1fa7d44e0..0b449b3ac 100755 --- a/make-release.sh +++ b/make-release.sh @@ -67,9 +67,9 @@ checkoutToReleaseBranch() { echo "[INFO] $BRANCH exists." resetChanges $BRANCH else - echo "[INFO] $BRANCH does not exist. Will create a new one from master." - resetChanges master - git push origin master:$BRANCH + echo "[INFO] $BRANCH does not exist. Will create a new one from main." + resetChanges main + git push origin main:$BRANCH fi git checkout -B $SCHEMA_VERSION } @@ -106,8 +106,8 @@ bumpVersion() { SCHEMA_VERSION=$MAJOR.$((MINOR+1)).0-alpha } -updateVersionOnMaster() { - # Checkout to a PR branch based on master to make our changes in +updateVersionOnMain() { + # Checkout to a PR branch based on main to make our changes in git checkout -b $SCHEMA_VERSION # Set the schema version to the new version (with -alpha appended) and build the schemas @@ -116,7 +116,7 @@ updateVersionOnMaster() { commitChanges "chore(post-release): bump schema version to ${SCHEMA_VERSION}" } -compareMasterVersion() { +comparemainVersion() { # Parse the version passed in. IFS='.' read -a semver <<< "$SCHEMA_VERSION" MAJOR=${semver[0]} @@ -147,17 +147,17 @@ run() { createReleaseBranch createPR "Release version ${SCHEMA_VERSION}" - # If needed, bump the schema version in master and open a PR against master - # Switch back to the master branch - BRANCH=master + # If needed, bump the schema version in main and open a PR against main + # Switch back to the main branch + BRANCH=main resetChanges $BRANCH - if compareMasterVersion; then - echo "[INFO] Updating schema version on master to ${SCHEMA_VERSION}" + if comparemainVersion; then + echo "[INFO] Updating schema version on main to ${SCHEMA_VERSION}" bumpVersion - updateVersionOnMaster - createPR "Bump schema version on master to ${SCHEMA_VERSION}" + updateVersionOnMain + createPR "Bump schema version on main to ${SCHEMA_VERSION}" else - echo "[WARN] The passed in schema version ${SCHEMA_VERSION} is less than the current version on master, so not updating the master branch version" + echo "[WARN] The passed in schema version ${SCHEMA_VERSION} is less than the current version on main, so not updating the main branch version" exit fi } diff --git a/samples/devfiles/sample-devfile.yaml b/samples/devfiles/sample-devfile.yaml index d0aac5348..a18fc9984 100644 --- a/samples/devfiles/sample-devfile.yaml +++ b/samples/devfiles/sample-devfile.yaml @@ -8,7 +8,7 @@ projects: remotes: origin: "https://github.com/devfile/api" checkoutFrom: - revision: "master" + revision: "main" remote: origin components: - name: editor From 9f88c7dc4e8b5c1489b6281c1f374d36eeaa5baf Mon Sep 17 00:00:00 2001 From: Mario Loriedo Date: Wed, 31 Mar 2021 15:01:43 +0200 Subject: [PATCH 2/2] Apply @sleshenko suggestions from code review Co-authored-by: Serhii Leshchenko --- make-release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make-release.sh b/make-release.sh index 0b449b3ac..5a32aa3f7 100755 --- a/make-release.sh +++ b/make-release.sh @@ -116,7 +116,7 @@ updateVersionOnMain() { commitChanges "chore(post-release): bump schema version to ${SCHEMA_VERSION}" } -comparemainVersion() { +compareMainVersion() { # Parse the version passed in. IFS='.' read -a semver <<< "$SCHEMA_VERSION" MAJOR=${semver[0]} @@ -151,7 +151,7 @@ run() { # Switch back to the main branch BRANCH=main resetChanges $BRANCH - if comparemainVersion; then + if compareMainVersion; then echo "[INFO] Updating schema version on main to ${SCHEMA_VERSION}" bumpVersion updateVersionOnMain