-
Notifications
You must be signed in to change notification settings - Fork 37
fix(tracing-versions): stamp service versions for tracing #383
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,11 +24,28 @@ if [ "$COMMIT" != "unknown" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; | |
| fi | ||
|
|
||
| # CI overrides for VERSION (from git tag or MR sha) and BUILD_USER. | ||
| # When unset, fall back to the values the legacy nvcf-cli Makefile computed. | ||
| # When unset, use only tags that belong to this service. `git describe | ||
| # --exact-match` is unsafe in the monorepo because a commit can also have | ||
| # stack/chart tags such as deploy/stacks/nvcf-compute-plane/v... | ||
| TAG_PREFIX="src/invocation-plane-services/http-invocation/v" | ||
| LEGACY_TAG_PREFIX="nvcf-invocation-service-v" | ||
|
|
||
| version_from_exact_tag() { | ||
| local prefix tag | ||
| for prefix in "$@"; do | ||
| tag=$(git tag --points-at HEAD --list "${prefix}*" 2>/dev/null | sort -V | tail -n1 || true) | ||
| if [ -n "${tag}" ]; then | ||
| printf '%s\n' "${tag#"${prefix}"}" | ||
| return 0 | ||
| fi | ||
| done | ||
| return 1 | ||
| } | ||
|
|
||
| if [ -n "${NVCF_VERSION:-}" ]; then | ||
| VERSION="${NVCF_VERSION}" | ||
| elif TAG=$(git describe --tags --exact-match HEAD 2>/dev/null); then | ||
| VERSION="${TAG}" | ||
| elif VERSION=$(version_from_exact_tag "${TAG_PREFIX}" "${LEGACY_TAG_PREFIX}"); then | ||
| : | ||
|
Comment on lines
+33
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift Add repository-native regression coverage for the version contract. The stated validation covers shell syntax and diff formatting, but not canonical-only, legacy-only, both-prefix, no-tag fallback, or As per coding guidelines, code changes must include tests or explain why tests are not applicable, run the repository-native test runner, and use Bazel as the canonical validation path for 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| else | ||
| VERSION="mr-${COMMIT}" | ||
| fi | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Fix cross-prefix version selection in both workspace scripts.
Both helpers return after the first prefix match, so they do not reliably select the highest matching service tag when canonical and legacy tags coexist.
src/control-plane-services/function-autoscaler/tools/workspace_status.sh#L33-L42: collect suffixes from both prefixes before semantic sorting, or explicitly enforce canonical-prefix precedence.src/invocation-plane-services/http-invocation/tools/workspace_status.sh#L33-L42: apply the same fix and add regression coverage for both-prefix resolution.📍 Affects 2 files
src/control-plane-services/function-autoscaler/tools/workspace_status.sh#L33-L42(this comment)src/invocation-plane-services/http-invocation/tools/workspace_status.sh#L33-L42🤖 Prompt for AI Agents