From f4fd55bc39439d62be83e8c44f33a368ed3314d3 Mon Sep 17 00:00:00 2001 From: Matheus Pimenta Date: Fri, 6 Feb 2026 15:20:21 +0000 Subject: [PATCH 1/2] apis/event: introduce key for commits Signed-off-by: Matheus Pimenta --- apis/event/v1beta1/event.go | 7 +++++-- apis/event/v1beta1/metadata.go | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apis/event/v1beta1/event.go b/apis/event/v1beta1/event.go index 350c54277..ced17b166 100644 --- a/apis/event/v1beta1/event.go +++ b/apis/event/v1beta1/event.go @@ -92,9 +92,12 @@ func (in *Event) HasMetadata(key string, val string) bool { return false } -// GetRevision looks up for the MetaOriginRevisionKey and MetaRevisionKey -// keys in the Metadata and returns the first it finds. +// GetRevision looks up for the keys in Metadata that may contain +// the revision of the object that this event is about. func (in *Event) GetRevision() (string, bool) { + if r, ok := in.Metadata[MetaCommitKey]; ok { + return r, true + } if r, ok := in.Metadata[MetaOriginRevisionKey]; ok { return r, true } diff --git a/apis/event/v1beta1/metadata.go b/apis/event/v1beta1/metadata.go index 434b0136c..98282fd5f 100644 --- a/apis/event/v1beta1/metadata.go +++ b/apis/event/v1beta1/metadata.go @@ -34,6 +34,8 @@ const ( // base64-encoded set of configurations. This is useful for example for // rate limiting the events. MetaTokenKey string = "token" + // MetaCommitKey is the key used to hold the Git commit hash. + MetaCommitKey string = "commit" // MetaCommitStatusKey is the key used to signal a Git commit status event. MetaCommitStatusKey string = "commit_status" // MetaCommitStatusUpdateValue is the value of MetaCommitStatusKey From 2ef53fa8e725294d1161cdb00674d7787feb11c0 Mon Sep 17 00:00:00 2001 From: Matheus Pimenta Date: Fri, 6 Feb 2026 15:21:00 +0000 Subject: [PATCH 2/2] Prepare for release Signed-off-by: Matheus Pimenta --- runtime/go.mod | 2 +- tests/integration/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/go.mod b/runtime/go.mod index d80667aba..09757f7f9 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -13,7 +13,7 @@ require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 github.com/fluxcd/cli-utils v0.37.1-flux.1 github.com/fluxcd/pkg/apis/acl v0.9.0 - github.com/fluxcd/pkg/apis/event v0.23.0 + github.com/fluxcd/pkg/apis/event v0.24.0 github.com/fluxcd/pkg/apis/kustomize v1.15.0 github.com/fluxcd/pkg/apis/meta v1.25.0 github.com/go-logr/logr v1.4.3 diff --git a/tests/integration/go.mod b/tests/integration/go.mod index c1a4bf0fe..26ab059e3 100644 --- a/tests/integration/go.mod +++ b/tests/integration/go.mod @@ -20,7 +20,7 @@ require ( github.com/fluxcd/pkg/auth v0.36.0 github.com/fluxcd/pkg/cache v0.13.0 github.com/fluxcd/pkg/git v0.42.0 - github.com/fluxcd/pkg/runtime v0.98.0 + github.com/fluxcd/pkg/runtime v0.99.0 github.com/fluxcd/test-infra/tftestenv v0.0.0-20250626232827-e0ca9c3f8d7b github.com/go-git/go-git/v5 v5.16.4 github.com/google/go-containerregistry v0.20.7