Skip to content

CircleCI Migration - #11676

Merged
sabre1041 merged 10 commits into
helm:mainfrom
sabre1041:circleci-migration
Mar 2, 2023
Merged

sabre1041 merged 10 commits into
helm:mainfrom
sabre1041:circleci-migration

Conversation

@sabre1041

@sabre1041 sabre1041 commented Dec 27, 2022 •

Copy link
Copy Markdown
Contributor

Migrates existing workflow on CircleCI job to GitHub actions native build

Tasks:

  • Add AZURE_STORAGE_CONNECTION_STRING and AZURE_STORAGE_CONTAINER_NAME as GitHub Secrets
  • Ensure all CircleCI assets removed

Builds upon #9989

@pull-request-size pull-request-size Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 27, 2022
Comment thread .github/workflows/build-pr.yml Outdated
- name: Test build
run: make

canary-release:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we merge this PR we will have both GitHub Actions and CircleCI pushing canary builds. Should canary builds for CircleCI be disabled in this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Everything CircleCI should be removed. I can certainly add the removal of the circleci script if we would like in this PR.

Comment thread .github/workflows/build-pr.yml Outdated
Comment on lines +58 to +59
container_name: ${{ secrets.AZURE_STORAGE_CONTAINER_NAME }}
connection_string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note, these need to be populated prior to merging this PR. Could this be captured in a todo with a checkbox on the PR description. Just to make sure we don't miss it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread .github/workflows/release.yml Outdated
- name: Set Version
id: set-version
run: |
echo "VERSION=$(echo ${GITHUB_REF/refs\/tags\//})" >> $GITHUB_OUTPUT

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since this is already filtered for tags, is there a reason we aren't using the GITHUB_REF_NAME variable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,38 @@
name: release

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this PR remove the deploy from CircleCI? So that the next release does not have two systems pushing it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Everything CircleCI should be removed. I can certainly add the removal of the circleci script if we would like in this PR.

@scottrigby scottrigby left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @sabre1041 👋 I closed #11820 in favor of this one. I created that PR only because I thought you said this work had yet to be finished and I got frustrated with Circle again so just busted it out. I see now that you meant your PR just needed to be finished. Kind of good to see though that the solution is roughly the same in both PRs.

As I said in #11820 (comment):

I think there are some things in my PR that would improve yours, but your PR has good things like pinning by sha, and it was first. So let's work on it together from yours and get this in 😄

Here's what 'd like to see merged from the two:

  • Pinning by sha:
    Nice improvement overall (for everyone else, this is rec'd by GitHub actions hardening doc)
  • adding make test build from Circle config:
    Both PRs add this because it was missing, and this is clearly the logical place 👍
  • adding logic from deploy.sh to Circle config:
    • I added them both to a single release workflow, just as they were together in the script
    • You added the canary ("main" branch) release to build-pr.yml, and tagged releases to a new release.yml. But I don't think canary releases belong in the PR workflow (honestly that should just be renamed "test", but either way it is just for PRs). I also think there's value in the release to AZ logic in the same file, just so that practically when improvements are made they're done in the same place. The only difference between the two in the script is a single --overwrite flag, which I noted in my PR
  • Very minor. It's not necessary to export VERSION from a previous build step

uses: actions/setup-go@v2
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # [email protected]
with:
go-version: '1.18'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is more of a question/suggestion than a "we should do this". Curious if there would be any value in using the go-version-file input with the setup-go action. It takes the path to the go.mod file, and uses the version specified there, so when the go version is updated, it would automatically be reflected in the workflows. Link to the docs. My thinking is that it would be one less place to worry about updates/maintenance, but I'm curious to hear others' thoughts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thats a new(er) enhancement and I like that it will reduce the number of changes that need to be made when adopting new versions of go.

Thanks for calling it out!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lucasrod16 I didn't know about this feature. Very nice!

@scottrigby scottrigby Feb 21, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lucasrod16 for now, we have to revert back to specifying the version explicitly. Because it appears there was a regression (mismatch between what's actually in go.mod and the circle tests), that was introduced here

helm/go.mod

Line 3 in 017785a

go 1.17

in this commit ffa19a4 (see line https://github.com/helm/helm/pull/10912/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6) from this PR #10912. Note the commit comment:

fix circleci tests

We could revert go.mod back to 1.18 here, but that would be scope creep for this PR. Let's do that in a follow-up issue, at which point we could use the go-version-file option.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@scottrigby ahh I see, thanks for the context! That sounds good, I can write-up an issue and link this discussion for more context.

@sabre1041 apologies for the side-track here

@lucasrod16 lucasrod16 Feb 21, 2023 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@scottrigby nevermind I see that you've created a follow-up issue already. Thanks!

Comment thread .github/workflows/build-pr.yml Outdated
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # [email protected]
with:
go-version: '1.18'
go-version-file: go.mod

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #11676 (comment)

Suggested change
go-version-file: go.mod
go-version: '1.18'

Comment thread .github/workflows/build-pr.yml Outdated
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # [email protected]
with:
go-version-file: go.mod

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See above

Suggested change
go-version-file: go.mod
go-version: '1.18'

Comment thread .github/workflows/release.yml Outdated
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # [email protected]
with:
go-version-file: go.mod

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See above

Suggested change
go-version-file: go.mod
go-version: '1.18'

@scottrigby scottrigby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change back to explicitly setting Go version. See #11676 (comment) and follow-up issue #11838.

@pull-request-size pull-request-size Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 25, 2023
@pull-request-size pull-request-size Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 25, 2023
@pull-request-size pull-request-size Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 25, 2023

@scottrigby scottrigby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actions (on PRs) pass, and all actions lgtm! Our plan is to test the build/upload by both merging this PR into main and then cutting a dev tag to test the process for canary.

@sabre1041 I made one more code suggestion (wrapping up my comments above), as a minor speed/simplification improvement. Feel free to merge that suggestion, but either way adding my approval here now. Let's unblock the things 💖

Comment thread .github/workflows/release.yml Outdated
Comment on lines +28 to +35
- name: Set Version
id: set-version
run: |
echo "VERSION=$(echo ${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
- name: Build Helm Binaries
run: |
make build-cross
make dist checksum VERSION="${{ steps.set-version.outputs.VERSION }}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Forgot to add this to my PR. Unless there is a practical reason to output the tag, we can skip that and just use it here directly.

Suggested change
- name: Set Version
id: set-version
run: |
echo "VERSION=$(echo ${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
- name: Build Helm Binaries
run: |
make build-cross
make dist checksum VERSION="${{ steps.set-version.outputs.VERSION }}"
- name: Build Helm Binaries
run: |
make build-cross
make dist checksum VERSION="${{ github.ref_name }}"

@scottrigby scottrigby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also this one. Please check using another workflow name (as this wf does not yet exist to test)

Comment thread README.md Outdated
# Helm

[![CircleCI](https://circleci.com/gh/helm/helm.svg?style=shield)](https://circleci.com/gh/helm/helm)
[![Build Status](https://github.com/helm/helm/workflows/push/badge.svg?branch=main)](https://github.com/helm/helm/actions?workflow=build-pr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we want the release badge for the Readme, right? According to GH UI, I believe this is the right syntax (if no branch query is specified, the default branch - main - is assumed)

Suggested change
[![Build Status](https://github.com/helm/helm/workflows/push/badge.svg?branch=main)](https://github.com/helm/helm/actions?workflow=build-pr)
[![Build Status](https://github.com/helm/helm/workflows/release.yml/badge.svg)](https://github.com/helm/helm/actions/workflows/release.yml)

Signed-off-by: Andrew Block <[email protected]>
@scottrigby

Copy link
Copy Markdown
Member

Excellent! I think we should wait for one other maintainer to approve since you and I both have commits on this

@sabre1041

Copy link
Copy Markdown
Contributor Author

@mattfarina any chance you might be able to review once again?

Comment thread .circleci/config.yml Resolved
@sabre1041
sabre1041 merged commit 9a02cc0 into helm:main Mar 2, 2023
@scottrigby

Copy link
Copy Markdown
Member

🎉 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants