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

feat(rel): add steps to update main with latest versions #600

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/helm_lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
uses: azure/setup-helm@v3
with:
version: v3.9.1
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: '3.13'
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you 🙏🏽
This had been bothering me

- uses: azure/[email protected]
id: install
- name: Set up chart-testing
Expand Down
111 changes: 111 additions & 0 deletions release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,114 @@ promoteToPublic:
echo "Build created, see:"
echo $body | jq .web_url
fi

- name: "update main with latest version"
cmd: |
set -eu
branch="promote/release-{{version}}-update-main"
echo "Checking out origin/main"
git fetch origin main
git switch main
echo "Creating branch origin/${branch}"
git switch -c "${branch}"
Comment on lines +568 to +571
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not following something here. We pull main, switch to main, and then switch to another release-branch, and then perform the changes we'd already performed on the previous release branch, in the promote to public step.

What's the expected flow here? We close the other (internal) branch PR that gets generated and merge this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

The earlier step is just assigning the name right? The git switch main part is also confusing to me though. In all these deploy repos we're now cutting releases from a release branch, so this likely needs to be whatever the base branch sg release <>

Otherwise this just looks like making sure things are up to date with main 🤔

Copy link
Contributor Author

@jdpleiness jdpleiness Dec 16, 2024

Choose a reason for hiding this comment

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

So the idea here is to update main with the latest version of Sourcegraph. So to do that we:

  • checkout main
  • create a new PR off main with the updated version and tags we need via these steps:
    • create a new branch
    • make the changes
    • commit the changes
    • open the PR

We don't really need to do anything with the other release PRs. They are similar, but not really related. The idea here is to keep them separated and intentionally create a PR for the changes we want made to main.

This will create a new PR that we just then have to merge.

Unless I'm missing something here 😆

We close the other (internal) branch PR that gets generated and merge this one?

Yup, really those should be auto-closed in the future in my opinion, as they are really just placeholders for steps in our release process.


- name: sg ops:sourcegraph
cmd: |
set -eu
registry=index.docker.io/sourcegraph
sg ops update-images \
-t {{inputs.server.tag}} \
-k helm \
--registry "${registry}" \
--docker-username $DOCKER_USERNAME \
--docker-password $DOCKER_PASSWORD \
charts/sourcegraph/

- name: sg ops:dind
cmd: |
set -eu
registry=index.docker.io/sourcegraph
sg ops update-images \
-t {{inputs.server.tag}} \
-k helm \
--registry "${registry}" \
--docker-username $DOCKER_USERNAME \
--docker-password $DOCKER_PASSWORD \
charts/sourcegraph-executor/dind/

- name: sg ops:k8s
cmd: |
set -eu
registry=index.docker.io/sourcegraph
sg ops update-images \
-t {{inputs.server.tag}} \
-k helm \
--registry "${registry}" \
--docker-username $DOCKER_USERNAME \
--docker-password $DOCKER_PASSWORD \
charts/sourcegraph-executor/k8s/

- name: sg ops:migrator
cmd: |
set -eu
registry=index.docker.io/sourcegraph
sg ops update-images \
-t {{inputs.server.tag}} \
-k helm \
--registry "${registry}" \
--docker-username $DOCKER_USERNAME \
--docker-password $DOCKER_PASSWORD \
charts/sourcegraph-migrator/

- name: sg ops:appliance
cmd: |
set -eu
registry=index.docker.io/sourcegraph
sg ops update-images \
-t {{inputs.server.tag}} \
-k helm \
--registry "${registry}" \
--docker-username $DOCKER_USERNAME \
--docker-password $DOCKER_PASSWORD \
charts/sourcegraph-appliance/

- name: "chart:version"
cmd: |
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/examples/subchart/Chart.yaml
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml

- name: "chart:appVersion"
cmd: |
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml

- name: "update helm docs"
cmd: ./scripts/helm-docs.sh

- name: "git:commit"
cmd: |
set -eu
branch="promote/release-{{version}}-update-main"

git commit -am "prep update main: {{version}}" -m 'update main with latest release'
git push origin "${branch}"

- name: "github:pr"
cmd: |
set -eu
internal_branch="promote/release-{{version}}-update-main"
gh pr create \
--fill \
--draft \
--base "$internal_branch" \
--title "Update main: build {{version}}" \
--body "Test plan: automated release PR, CI will perform additional checks"
echo "🚢 Please check the associated CI build to ensure the process completed".

Loading