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

[release tool] Integrate release and hashrelease logic #9140

Merged
merged 21 commits into from
Sep 12, 2024

Conversation

caseydavenport
Copy link
Member

@caseydavenport caseydavenport commented Aug 16, 2024

Description

Note that this DOES change the format of our hashreleases in order to better match the structure of artifacts produced by a real release. Notably, existing hashrelease structure looks like this:

files/
  windows/
   calico-windows-<version.zip
manifests/
release-notes/
tigera-operator.tgz
metadata.yaml

The new format looks more like this:

manifests/
release-notes/
tigera-operator-<version>.tgz
calico-windows-<version>.zip
metadata.yaml
install-calico-windows.ps1
ocp.tgz
SHA256SUMS

The main differences being:

  • Some additional files, e.g., SHA256SUMS
  • No "files/windows" directory structure.
  • tigera-operator.tgz -> tigera-operator-.tgz

To handle this, there is some additional logic to copy files into the "legacy" structure so that both formats coexist. Once our CI tools are updated to use the new format, we can remove this redundancy.

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@caseydavenport caseydavenport requested a review from a team as a code owner August 16, 2024 15:19
@marvin-tigera marvin-tigera added this to the Calico v3.29.0 milestone Aug 16, 2024
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Aug 16, 2024
@caseydavenport caseydavenport changed the title WIP: Integrate release and hashrelease logic Integrate release and hashrelease logic Aug 22, 2024
@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact and removed docs-pr-required Change is not yet documented labels Aug 22, 2024
@marvin-tigera marvin-tigera removed the release-note-required Change has user-facing impact (no matter how small) label Aug 22, 2024
@caseydavenport caseydavenport force-pushed the casey-add-release branch 3 times, most recently from 383fc3f to a97a86d Compare August 27, 2024 20:31
Copy link
Contributor

@radTuti radTuti left a comment

Choose a reason for hiding this comment

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

I do not think this should change the output of hashrelease currently since that will affect testing as is

release/build/main.go Outdated Show resolved Hide resolved
release/internal/hashrelease/pinnedversion.go Outdated Show resolved Hide resolved
release/pkg/tasks/release.go Outdated Show resolved Hide resolved
release/pkg/tasks/operator.go Outdated Show resolved Hide resolved
release/pkg/tasks/hashrelease.go Outdated Show resolved Hide resolved
release/pkg/tasks/hashrelease.go Outdated Show resolved Hide resolved
release/pkg/tasks/hashrelease.go Outdated Show resolved Hide resolved
release/pkg/tasks/hashrelease.go Outdated Show resolved Hide resolved
release/Makefile Outdated Show resolved Hide resolved
release/build/main.go Outdated Show resolved Hide resolved
release/pkg/builder/commands.go Outdated Show resolved Hide resolved
// is the _next_ (currently unreleased) product version.
func IsDevVersion(ver, devTag string) bool {
v := Version(ver)
pattern := fmt.Sprintf(`^v\d+\.\d+\.\d+(-\d+\.\d+)?-%s-\d+-g[0-9a-f]{12}(-dirty)?$`, devTag)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should allow interpreting v3.15.0-12-gfd40f1838223 as a dev tag as well

Suggested change
pattern := fmt.Sprintf(`^v\d+\.\d+\.\d+(-\d+\.\d+)?-%s-\d+-g[0-9a-f]{12}(-dirty)?$`, devTag)
pattern := fmt.Sprintf(`^v\d+\.\d+\.\d+(-\d+\.\d+)?(-%s)?-\d+-g[0-9a-f]{12}(-dirty)?$`, devTag)

Copy link
Member Author

Choose a reason for hiding this comment

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

Why should this return true if the version string doesn't include the devTag? I thought the entire purpose of this function was to tell if the dev tag was present.

That said, this function is currently unused so I think it can be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, it can be removed

This function was going based on a wrong assumption that all dev tags (non-official release) has the devTag 0.dev.
That is only the case for minor version releases (i.e. vX.Y.0-0.dev-n-g????????????); patch releases go based on the last release (i.e. vX.Y.Z-n-g????????????)

release/internal/version/version.go Outdated Show resolved Hide resolved
release/internal/version/version.go Outdated Show resolved Hide resolved
release/internal/version/version.go Outdated Show resolved Hide resolved
release/pkg/builder/options.go Show resolved Hide resolved
release/internal/outputs/release.go Outdated Show resolved Hide resolved
Copy link
Contributor

@radTuti radTuti left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

// is the _next_ (currently unreleased) product version.
func IsDevVersion(ver, devTag string) bool {
v := Version(ver)
pattern := fmt.Sprintf(`^v\d+\.\d+\.\d+(-\d+\.\d+)?-%s-\d+-g[0-9a-f]{12}(-dirty)?$`, devTag)
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, it can be removed

This function was going based on a wrong assumption that all dev tags (non-official release) has the devTag 0.dev.
That is only the case for minor version releases (i.e. vX.Y.0-0.dev-n-g????????????); patch releases go based on the last release (i.e. vX.Y.Z-n-g????????????)

@caseydavenport caseydavenport merged commit e67e663 into projectcalico:master Sep 12, 2024
2 of 3 checks passed
@caseydavenport caseydavenport deleted the casey-add-release branch September 12, 2024 21:33
@radTuti radTuti changed the title Integrate release and hashrelease logic [release tool] Integrate release and hashrelease logic Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants