From de262c046f28d259cbcce512300f943f4f10d05e Mon Sep 17 00:00:00 2001 From: Dustin Row Date: Fri, 14 Aug 2026 09:08:07 -0700 Subject: [PATCH] ROSAENG-65404: remove COPR from release automation and repo osdctl's release process doesn't rely on Fedora COPR (releases have always been tag + make release, publishing GitHub release assets only), and backplane-tools installs osdctl straight from GitHub release tarballs, not an RPM. Testing the new release-on-version-bump workflow surfaced that the existing COPR_URL webhook is dead (404), and since nothing actually consumes the COPR build, drop it entirely instead of fixing a webhook nobody needs: - remove the COPR trigger step from release-on-version-bump.yaml - delete trigger_copr.yaml (fired on manual tag pushes) - delete hack/copr.sh and the checked-in hack/osdctl.spec - update README/Makefile references --- .../workflows/release-on-version-bump.yaml | 36 ++---- .github/workflows/release.yaml | 3 - .github/workflows/trigger_copr.yaml | 29 ----- Makefile | 4 +- README.md | 23 ++-- cmd/upgrade_test.go | 1 - hack/copr.sh | 117 ------------------ hack/osdctl.spec | 85 ------------- pkg/utils/version.go | 6 +- pkg/utils/version_test.go | 2 - 10 files changed, 21 insertions(+), 285 deletions(-) delete mode 100644 .github/workflows/trigger_copr.yaml delete mode 100644 hack/copr.sh delete mode 100644 hack/osdctl.spec diff --git a/.github/workflows/release-on-version-bump.yaml b/.github/workflows/release-on-version-bump.yaml index 91aedbbda..2afa5b12c 100644 --- a/.github/workflows/release-on-version-bump.yaml +++ b/.github/workflows/release-on-version-bump.yaml @@ -1,15 +1,14 @@ # Cut a release when a VERSION bump lands on master. # # A maintainer opens a PR bumping the VERSION file (e.g. 0.62.0 -> 0.63.0). Once -# it's approved and merged, this workflow tags v, publishes the GitHub -# release with goreleaser, and kicks the Fedora COPR build. It all runs with the -# built-in GITHUB_TOKEN plus the already-present COPR_URL secret, so there are no -# extra secrets or admin setup required. +# it's approved and merged, this workflow tags v and publishes the +# GitHub release with goreleaser. It all runs with the built-in GITHUB_TOKEN, so +# there are no extra secrets or admin setup required. # -# The tag, release, and COPR call are done inline here (rather than letting a tag -# push trigger release.yaml / trigger_copr.yaml) because GitHub deliberately does -# not re-trigger workflows for refs pushed by GITHUB_TOKEN. Pushing a v* tag by -# hand still triggers release.yaml and trigger_copr.yaml the normal way. +# The tag and release are done inline here (rather than letting a tag push +# trigger release.yaml) because GitHub deliberately does not re-trigger +# workflows for refs pushed by GITHUB_TOKEN. Pushing a v* tag by hand still +# triggers release.yaml the normal way. name: release-on-version-bump on: @@ -42,14 +41,14 @@ jobs: version="$(head -n1 VERSION)" if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "VERSION '${version}' must be MAJOR.MINOR.PATCH (e.g. 0.63.0)." >&2 - echo "Prerelease/build suffixes are not supported (they break the COPR tag contract)." >&2 + echo "Prerelease/build suffixes are not supported." >&2 exit 1 fi tag="v${version}" if remote_sha="$(git ls-remote --exit-code origin "refs/tags/${tag}" | cut -f1)"; then # A tag can exist because a prior run tagged it but failed before - # goreleaser/COPR completed. Only treat it as "already released" if - # it points at the commit we're releasing; otherwise this is a + # goreleaser completed. Only treat it as "already released" if it + # points at the commit we're releasing; otherwise this is a # conflicting tag and we shouldn't silently skip the release. if [[ "$remote_sha" == "$(git rev-parse HEAD)" ]]; then echo "Tag ${tag} already exists at HEAD, nothing to release." @@ -90,18 +89,3 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Trigger COPR build - if: steps.version.outputs.skip == 'false' - env: - COPR_URL: ${{ secrets.COPR_URL }} - TAG: ${{ steps.version.outputs.tag }} - run: | - set -euo pipefail - # --fail + --show-error so an HTTP 4xx/5xx from the webhook fails the - # job instead of silently reporting a successful release. - curl --fail --show-error --connect-timeout 10 --max-time 60 --request POST \ - --header "Content-Type: application/json" \ - --header "Accept: application/json" \ - --data "{\"ref_type\": \"tag\", \"ref\": \"${TAG}\"}" \ - --url "$COPR_URL" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e2f20aed3..399a5d543 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,9 +4,6 @@ # with the built-in GITHUB_TOKEN, so no personal token is needed. Tags are # normally created by release-on-version-bump.yaml (on a VERSION bump), but # pushing a `v*` tag by hand still works as a fallback. -# -# The existing trigger_copr.yaml workflow also fires on this same tag push, so -# the Fedora COPR build keeps working with no change. name: release on: diff --git a/.github/workflows/trigger_copr.yaml b/.github/workflows/trigger_copr.yaml deleted file mode 100644 index d5d094488..000000000 --- a/.github/workflows/trigger_copr.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Create a project release automatically on tag creation - -name: trigger_copr_on_tag - -on: - push: - tags: - - "*" # triggers only if push new tag version, like `0.8.4` - -jobs: - build: - name: trigger_copr_on_tag - runs-on: ubuntu-latest - permissions: - repository-projects: write - - steps: - - name: Trigger COPR build - run: | - curl --request POST \ - --header "Content-Type: application/json" \ - --header "Accept: application/json" \ - --data "{ - \"ref_type\": \"tag\", - \"ref\": \"${GITHUB_REF#refs/tags/}\" - }" \ - --url "$COPR_URL" - env: - COPR_URL: ${{ secrets.COPR_URL }} diff --git a/Makefile b/Makefile index 58839db76..6e47edd55 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,8 @@ build: ## Compile osdctl goreleaser build --clean --snapshot --single-target=${SINGLE_TARGET} # Preferred way to cut a release: bump the VERSION file on a branch and open a PR. -# Once merged to master, GitHub Actions tags vX.Y.Z and publishes the release -# (and triggers the Fedora COPR build). See README "Creating a release". +# Once merged to master, GitHub Actions tags vX.Y.Z and publishes the release. +# See README "Creating a release". .PHONY: new-release new-release: ## Bump VERSION for a new release (RELEASE_VERSION=x.y.z), then open a PR @if [ -z "$(RELEASE_VERSION)" ]; then \ diff --git a/README.md b/README.md index 57af9b2f4..1bb9c236b 100644 --- a/README.md +++ b/README.md @@ -62,26 +62,17 @@ Releases are automated. Any maintainer can cut a release by opening a PR that bu You can edit `VERSION` directly, or run `make new-release RELEASE_VERSION=0.63.0` to bump it for you. 2. Get it reviewed and merged to `master` the usual way (`/lgtm`, `/approve`). -3. On merge, the `release-on-version-bump` workflow tags `vX.Y.Z`, publishes the - GitHub release with `goreleaser`, and kicks the Fedora COPR build. +3. On merge, the `release-on-version-bump` workflow tags `vX.Y.Z` and publishes the + GitHub release with `goreleaser`. -No secrets or admin setup are required: the workflow uses the built-in `GITHUB_TOKEN` -and the `COPR_URL` secret that already powers `trigger_copr_on_tag`. The tag, release, -and COPR call are done inline in one job because GitHub doesn't re-trigger workflows -for tags pushed by `GITHUB_TOKEN`. - -#### For Fedora - -Fedora releases are built in a COPR repository via a [custom -webhook](https://docs.pagure.org/copr.copr/user_documentation.html#custom-webhook) and the `hack/copr.sh` script as -build method. The automated flow above calls this webhook as part of the release job. -Pushing a `vX.Y.Z` tag by hand instead triggers the `trigger_copr_on_tag` workflow, -which calls the same webhook. +No secrets or admin setup are required: the workflow uses the built-in `GITHUB_TOKEN`. +The tag and release are done inline in one job because GitHub doesn't re-trigger +workflows for tags pushed by `GITHUB_TOKEN`. #### Manually (fallback) -Pushing a `vX.Y.Z` tag directly still works and triggers the same `release` and COPR -workflows. Push it to the remote that points at `openshift/osdctl` (this is `upstream` +Pushing a `vX.Y.Z` tag directly still works and triggers the same `release` workflow. +Push it to the remote that points at `openshift/osdctl` (this is `upstream` if you cloned a fork, or `origin` if you cloned `openshift/osdctl` directly), using the same remote for both commands: diff --git a/cmd/upgrade_test.go b/cmd/upgrade_test.go index 80c415037..ed6b18be0 100644 --- a/cmd/upgrade_test.go +++ b/cmd/upgrade_test.go @@ -15,7 +15,6 @@ func TestUpgradeRefusesWhenManaged(t *testing.T) { wantSubstring string wantErr bool }{ - {"copr", "copr", "dnf upgrade osdctl", false}, {"homebrew", "homebrew", "brew upgrade osdctl", false}, {"unknown", "unknown", "unknown install method", true}, } diff --git a/hack/copr.sh b/hack/copr.sh deleted file mode 100644 index 2af9c29b8..000000000 --- a/hack/copr.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env sh - -# Check that the event payload exists: -if [[ ! -f hook_payload ]]; then - echo "Event payload file 'hook_payload' doesn't exist" - exit 1 -fi - -# Check that the event is the creation of a tag: -ref_type=$(cat hook_payload | jq -r .ref_type) -if [[ "${ref_type}" != "tag" ]]; then - echo "Expected reference type 'tag' but got '${ref_type}'" - exit 1 -fi - -# Check that the tag is well formed: -ref=$(cat hook_payload | jq -r .ref) -if [[ ! "${ref}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Reference '${ref}' isn't well formed" - exit 1 -fi - -# Set the version to use: -version="${ref:1}" - -# Generate the .spec file: -cat > osdctl.spec.in <<"." -# Generated by go2rpm 1.15.0 -%bcond check 1 -%bcond bootstrap 0 - -%if %{with bootstrap} -%global debug_package %{nil} -%endif - -%if %{with bootstrap} -%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ -%endif - -# https://github.com/openshift/osdctl -%global goipath github.com/openshift/osdctl - -%global common_description %{expand: -CLI for the OSD utilities.} -Version: @version@ - -# REMOVE BEFORE SUBMITTING THIS FOR REVIEW -# --- -# New Fedora packages should use %%gometa -f, which makes the package -# ExclusiveArch to %%golang_arches_future and thus excludes the package from -# %%ix86. If the new package is needed as a dependency for another package, -# please consider removing that package from %%ix86 in the same way, instead of -# building more go packages for i686. If your package is not a leaf package, -# you'll need to coordinate the removal of the package's dependents first. -# --- -# REMOVE BEFORE SUBMITTING THIS FOR REVIEW -%gometa -L -f - -%global golicenses LICENSE -%global godocs README.md - -BuildRequires: git -Name: osdctl -Release: %autorelease -Summary: CLI for the OSD utilities -License: Apache-2.0 -URL: %{gourl} -Source: %{gosource} - - -%description %{common_description} - -%gopkg - -%prep -%goprep -A - -%if %{without bootstrap} -%generate_buildrequires -# %go_generate_buildrequires -%endif - -%if %{without bootstrap} -%define gomodulesmode GO111MODULE=on -%build -export GO_LDFLAGS='-X "github.com/openshift/osdctl/pkg/utils.Version=@version@" -X "github.com/openshift/osdctl/pkg/utils.InstallMethod=copr"' -%gobuild -o %{gobuilddir}/bin/osdctl %{goipath} -%endif - -%install -%gopkginstall -%if %{without bootstrap} -install -m 0755 -vd %{buildroot}%{_bindir} -install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ -%endif - -%if %{without bootstrap} -%if %{with check} -%endif -%endif - -%if %{without bootstrap} -%files -%license LICENSE -%doc README.md -%{_bindir}/osdctl -%endif - -%gopkgfiles - -%changelog -%autochangelog -. -sed \ - -e "s/@version@/${version}/g" \ - < osdctl.spec.in \ - > osdctl.spec diff --git a/hack/osdctl.spec b/hack/osdctl.spec deleted file mode 100644 index df47e535d..000000000 --- a/hack/osdctl.spec +++ /dev/null @@ -1,85 +0,0 @@ -# Generated by go2rpm 1.15.0 -%bcond check 1 -%bcond bootstrap 0 - -%if %{with bootstrap} -%global debug_package %{nil} -%endif - -%if %{with bootstrap} -%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ -%endif - -# https://github.com/openshift/osdctl -%global goipath github.com/openshift/osdctl - -%global common_description %{expand: -CLI for the OSD utilities.} -Version: @version@ - -# REMOVE BEFORE SUBMITTING THIS FOR REVIEW -# --- -# New Fedora packages should use %%gometa -f, which makes the package -# ExclusiveArch to %%golang_arches_future and thus excludes the package from -# %%ix86. If the new package is needed as a dependency for another package, -# please consider removing that package from %%ix86 in the same way, instead of -# building more go packages for i686. If your package is not a leaf package, -# you'll need to coordinate the removal of the package's dependents first. -# --- -# REMOVE BEFORE SUBMITTING THIS FOR REVIEW -%gometa -L -f - -%global golicenses LICENSE -%global godocs README.md - -BuildRequires: git -Name: osdctl -Release: %autorelease -Summary: CLI for the OSD utilities -License: Apache-2.0 -URL: %{gourl} -Source: %{gosource} - - -%description %{common_description} - -%gopkg - -%prep -%goprep -A - -%if %{without bootstrap} -%generate_buildrequires -# %go_generate_buildrequires -%endif - -%if %{without bootstrap} -%define gomodulesmode GO111MODULE=on -%build -export GO_LDFLAGS='-X "github.com/openshift/osdctl/pkg/utils.Version=@version@" -X "github.com/openshift/osdctl/pkg/utils.InstallMethod=copr"' -%gobuild -o %{gobuilddir}/bin/osdctl %{goipath} -%endif - -%install -%gopkginstall -%if %{without bootstrap} -install -m 0755 -vd %{buildroot}%{_bindir} -install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ -%endif - -%if %{without bootstrap} -%if %{with check} -%endif -%endif - -%if %{without bootstrap} -%files -%license LICENSE -%doc README.md -%{_bindir}/osdctl -%endif - -%gopkgfiles - -%changelog -%autochangelog diff --git a/pkg/utils/version.go b/pkg/utils/version.go index 120ec33c0..452e1f265 100644 --- a/pkg/utils/version.go +++ b/pkg/utils/version.go @@ -27,12 +27,12 @@ var ( // InstallMethod is set at build time via -X ldflags when osdctl is // built by a package manager. Empty string (default) means the binary // was built from source or via GoReleaser (GitHub releases). - // Known values: "copr", "homebrew". + // Known values: "homebrew". InstallMethod string ) // IsManagedInstall reports whether osdctl was installed via a package -// manager (e.g. COPR/RPM, Homebrew) rather than from a GitHub release. +// manager (e.g. Homebrew) rather than from a GitHub release. func IsManagedInstall() bool { return InstallMethod != "" } @@ -43,8 +43,6 @@ func UpgradeInstruction() (string, error) { switch InstallMethod { case "": return "", nil - case "copr": - return "dnf upgrade osdctl", nil case "homebrew": return "brew upgrade osdctl", nil default: diff --git a/pkg/utils/version_test.go b/pkg/utils/version_test.go index 50c75a971..a8a7a2312 100644 --- a/pkg/utils/version_test.go +++ b/pkg/utils/version_test.go @@ -9,7 +9,6 @@ func TestIsManagedInstall(t *testing.T) { want bool }{ {"empty (GitHub release)", "", false}, - {"copr", "copr", true}, {"homebrew", "homebrew", true}, } for _, tt := range tests { @@ -31,7 +30,6 @@ func TestUpgradeInstruction(t *testing.T) { want string wantErr bool }{ - {"copr", "copr", "dnf upgrade osdctl", false}, {"homebrew", "homebrew", "brew upgrade osdctl", false}, {"empty", "", "", false}, {"unknown", "unknown", "", true},