Files
cd/hack/git-verify-wrapper.sh
zeekay 187be9e719 proto, settings: fix stale argoproj.argo_cd.v3 package path and hanzocd part-of drift
repository.proto and 11 sibling hand-written .proto files referenced
generated.proto's application/v1alpha1 types under the pre-fork package
path (github.com.argoproj.argo_cd.v3...); protoc silently kept compiling
because generated.proto still carried that same stale package too. Point
both at the real, mechanically-derived path
(github.com.hanzoai.cd.pkg.apis.application.v1alpha1, no v3 segment) and
regenerate everything protoc/go-to-protobuf own: generated.proto/pb.go,
every pkg/apiclient and reposerver/cmpserver/commitserver *.pb.go,
assets/swagger.json, and the CRD manifests.

That regeneration surfaced a second, unrelated bug: hack/gen-crd-spec
stamped app.kubernetes.io/part-of: cd on the CRDs, but
util/settings.isSettingsObject (and the ConfigMap informer built on it)
only ever recognizes part-of=hanzocd. The same wrong "cd" value was
baked into cmd/cd/commands/admin/settings.go's setSettingsMeta and the
shared test/testdata.go fixtures ~30 files import — util/settings' own
test suite was panicking on an empty slice because its fixture was
invisible to the informer it was supposedly seeding. Fixed the label
everywhere it's produced or asserted in the settings path; left the
~90 unrelated part-of:"cd" literals in other packages' local test
fixtures alone since they never touch this selector.

Also dropped 25 "TODO: Remove deprecated <dead upstream issue link>"
comments that duplicated the real explanation already sitting one line
away (a proper `Deprecated:` godoc, a cobra Deprecated field, or a
nolint:staticcheck marker) — kept the explanation, dropped the link, per
the standing rule for these citations.

And repointed the two Grafana dashboards' job selector from
argocd-server-metrics, a Service the manifests never create, to
hanzocd-server-metrics, the one they do.
2026-09-05 14:58:20 -07:00

48 lines
935 B
Bash
Executable File

#!/bin/sh
# Wrapper script to perform GPG signature validation on git commit SHAs and
# annotated tags.
#
# We capture stderr to stdout, so we can have the output in the logs. Also,
# we ignore error codes that are emitted if signature verification failed.
#
if test "$1" = ""; then
echo "Wrong usage of git-verify-wrapper.sh" >&2
exit 1
fi
REVISION="$1"
TYPE=
# Figure out we have an annotated tag or a commit SHA
if git describe --exact-match "${REVISION}" >/dev/null 2>&1; then
IFS=''
TYPE=tag
OUTPUT=$(git verify-tag "$REVISION" 2>&1)
RET=$?
else
IFS=''
TYPE=commit
OUTPUT=$(git verify-commit "$REVISION" 2>&1)
RET=$?
fi
case "$RET" in
0)
echo "$OUTPUT"
;;
1)
# git verify-tag emits error messages if no signature is found on tag,
# which we don't want in the output.
if test "$TYPE" = "tag" -a "${OUTPUT%%:*}" = "error"; then
OUTPUT=""
fi
echo "$OUTPUT"
RET=0
;;
*)
echo "$OUTPUT" >&2
;;
esac
exit $RET