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

.github: Add release verification job #10538

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

timflannagan
Copy link
Member

@timflannagan timflannagan commented Jan 28, 2025

Description

Add a post-release validation job that verifies that the published images & helm chart are pullable, deployable, etc. and pass the GW API conformance suite. Validated this worked in my fork: https://github.com/timflannagan/kgateway/actions/runs/13017590116/job/36310714915.

Related to #10510.
Closes #10558.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Comment on lines +148 to +172
--set controller.image.registry=${{ env.IMAGE_REGISTRY }} \
--set gateway.envoyContainer.image.registry=${{ env.IMAGE_REGISTRY }} \
--set gateway.sdsContainer.image.registry=${{ env.IMAGE_REGISTRY }} \
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, this is primarily needed to test the release workflow in forks. We could re-introduce a global.image.registry value in the kgateway values.yaml over time.

Comment on lines +133 to +156
- name: Download module dependencies
run: make mod-download
Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed as the make conformance prerequisite target runs go list -json -m sigs.k8s.io/gateway-api | jq -r '.Dir' under-the-hood and the .Dir parameter will not be present if the module dependencies haven't been pulled down first.

Copy link
Member Author

Choose a reason for hiding this comment

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

The alternative to this is moving the conformance suite in-tree, e.g. test/conformance, and syncing the various *_suite.go files when the GW API is bumped.

Comment on lines +136 to +163
- name: Setup kind cluster
run: ./ci/kind/setup-kind.sh
env:
VERSION: ${{ needs.setup.outputs.version }}
SKIP_DOCKER: "true"
CONFORMANCE: "true"
Copy link
Member Author

Choose a reason for hiding this comment

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

I could've re-used the conformance composite action, but I think that composite needs to be refactored to accept better inputs and/or be driven by a Makefile target that creates a kind cluster, optionally loads any locally built images, deploying helm charts, runs the conformance suite, etc.

kubectl wait --for=condition=available --timeout=5m deployment/kgateway -n kgateway-system

- name: Run Conformance Tests
run: make conformance
Copy link
Member Author

Choose a reason for hiding this comment

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

We may extend these checks over time too. Ideally we'd validate that our extension APIs work too once the various e2e suites are back online.

@timflannagan
Copy link
Member Author

Let's wait until #10540 merges first.

@timflannagan timflannagan force-pushed the release/validate branch 2 times, most recently from 6b909bd to 0535b4e Compare January 30, 2025 17:37
@timflannagan
Copy link
Member Author

Sorry for the force pushes. I was testing this out in my fork without creating a temp branch and pushing that to my origin like I usually do.

validate:
name: Validate release artifacts
needs: [setup, helm, goreleaser]
if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.validate }}
Copy link
Member Author

Choose a reason for hiding this comment

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

Skip main branch pushes and PR events. Only validate release artifacts when a new tag is pushed or when this workflow is triggered with a workflow_dispatch that enables the optional "validate" flag.

Comment on lines 139 to 143
- name: Print out validate inputs
run: |
set -x
echo "validate: ${{ inputs.validate }}"
echo "version: ${{ needs.setup.outputs.version }}"
Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, debug artifacts. I was trying to figure out why this job was being skipped when the validate option was enabled.

The workflow will also receive the inputs in the github.event.inputs context. The information in the inputs context and github.event.inputs context is identical except that the inputs context preserves Boolean values as Booleans instead of converting them to strings. The choice type resolves to a string and is a single selectable option.

TIL.

Comment on lines +4 to +12
inputs:
validate:
type: boolean
default: false
description: "Validate the release artifacts"
version:
type: string
required: false
description: "Override the default version (e.g. v0.0.0-manual-<git-sha>)"
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -33,13 +42,17 @@ jobs:
- name: Set the release related variables
id: set_vars
run: |
GIT_TAG=$(git describe --tags --abbrev=0 --always)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was breaking workflow_dispatch triggers as GIT_TAG returned a VERSION that isn't valid semver. Decided to mirror the main branch tag structure as the default value when the workflow_dispatch input.version option was unspecified.

@jenshu jenshu added this pull request to the merge queue Feb 5, 2025
Merged via the queue into kgateway-dev:main with commit f0d8c83 Feb 5, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add post-release validation job to release workflow
2 participants