Skip to content

fix(tracing-versions): stamp service versions for tracing#383

Open
borao wants to merge 1 commit into
mainfrom
fix/tracing-versions
Open

fix(tracing-versions): stamp service versions for tracing#383
borao wants to merge 1 commit into
mainfrom
fix/tracing-versions

Conversation

@borao

@borao borao commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Stamp the real release version into the HTTP invocation and function autoscaler Bazel image builds so tracing reports the service-specific version instead of stale package defaults or unrelated monorepo tags.

Additional Details

  • Pass NVCF_VERSION from the manual image push workflow and run the Bazel image push with --stamp.
  • Update both service workspace_status.sh scripts to prefer NVCF_VERSION.
  • Fall back only to tags that belong to the specific service, avoiding unrelated stack/chart tags on the same commit.

For the Reviewer

Please look closely at:

  • .github/workflows/image-push-manual.yml
  • src/invocation-plane-services/http-invocation/tools/workspace_status.sh
  • src/control-plane-services/function-autoscaler/tools/workspace_status.sh

For QA

Verified with:

  • bash -n src/control-plane-services/function-autoscaler/tools/workspace_status.sh
  • bash -n src/invocation-plane-services/http-invocation/tools/workspace_status.sh
  • git diff --check origin/main...HEAD

QA needed: no separate QA pass expected; this is build/stamping behavior.

Issues

NO-REF

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • Bug Fixes
    • Improved service version detection for builds using exact Git tags.
    • Added support for both current and legacy service tag formats.
    • Ensured manually built and pushed images receive the computed snapshot version.
    • Preserved fallback versioning when no matching tag is available.

Signed-off-by: Bora Oztekin <boztekin@nvidia.com>
@borao
borao requested a review from a team as a code owner July 23, 2026 08:15
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The workspace status scripts now resolve service-specific exact tags with semantic version sorting, while preserving explicit and fallback version handling. The manual image-push workflow passes its computed snapshot tag through NVCF_VERSION.

Changes

Version resolution and image publishing

Layer / File(s) Summary
Service-specific exact-tag resolution
src/control-plane-services/function-autoscaler/tools/workspace_status.sh, src/invocation-plane-services/http-invocation/tools/workspace_status.sh
Both scripts match tags at HEAD against current and legacy service prefixes, select the highest version, and retain the NVCF_VERSION override and fallback behavior.
Manual image version wiring
.github/workflows/image-push-manual.yml
The multi-architecture image push step exports the computed snapshot tag as NVCF_VERSION for the Bazel invocation.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the version-stamping fix in the workflow and workspace status scripts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tracing-versions

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
.github/workflows/image-push-manual.yml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Comment @coderabbitai help to get the list of available commands.

@borao
borao force-pushed the fix/tracing-versions branch from 08c4ed3 to 9e3ef4b Compare July 23, 2026 08:18
@borao
borao requested review from balajinvda and sbaum1994 July 23, 2026 08:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/control-plane-services/function-autoscaler/tools/workspace_status.sh`:
- Around line 33-42: Update version_from_exact_tag in both
src/control-plane-services/function-autoscaler/tools/workspace_status.sh (lines
33-42) and
src/invocation-plane-services/http-invocation/tools/workspace_status.sh (lines
33-42) to evaluate matching tags across all prefixes before selecting the
highest semantic version, or explicitly enforce canonical-prefix precedence. Add
regression coverage for cases where canonical and legacy prefixes both match,
verifying identical correct resolution in both scripts.

In `@src/invocation-plane-services/http-invocation/tools/workspace_status.sh`:
- Around line 33-48: Add repository-native Bazel regression coverage for the
version-selection contract in workspace_status.sh, covering canonical-only tags,
legacy-only tags, both prefixes, no-tag fallback, and NVCF_VERSION propagation
into the stamped Bazel invocation. Place the checks in the appropriate subtree
test target and run the repository-native Bazel validation for
src/invocation-plane-services/http-invocation/**/*.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 00050e5a-e605-41ee-baa4-7ea0007e1b89

📥 Commits

Reviewing files that changed from the base of the PR and between 2d238bf and 82f9d0a.

📒 Files selected for processing (3)
  • .github/workflows/image-push-manual.yml
  • src/control-plane-services/function-autoscaler/tools/workspace_status.sh
  • src/invocation-plane-services/http-invocation/tools/workspace_status.sh

Comment on lines +33 to +42
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

Copy link
Copy Markdown

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
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/control-plane-services/function-autoscaler/tools/workspace_status.sh`
around lines 33 - 42, Update version_from_exact_tag in both
src/control-plane-services/function-autoscaler/tools/workspace_status.sh (lines
33-42) and
src/invocation-plane-services/http-invocation/tools/workspace_status.sh (lines
33-42) to evaluate matching tags across all prefixes before selecting the
highest semantic version, or explicitly enforce canonical-prefix precedence. Add
regression coverage for cases where canonical and legacy prefixes both match,
verifying identical correct resolution in both scripts.

Comment on lines +33 to +48
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
:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 NVCF_VERSION propagation into the stamped Bazel invocation. Add these checks or explain why tests are not applicable; use Bazel validation for this subtree.

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 src/invocation-plane-services/http-invocation/**/*.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/invocation-plane-services/http-invocation/tools/workspace_status.sh`
around lines 33 - 48, Add repository-native Bazel regression coverage for the
version-selection contract in workspace_status.sh, covering canonical-only tags,
legacy-only tags, both prefixes, no-tag fallback, and NVCF_VERSION propagation
into the stamped Bazel invocation. Place the checks in the appropriate subtree
test target and run the repository-native Bazel validation for
src/invocation-plane-services/http-invocation/**/*.

Source: Coding guidelines

@borao
borao force-pushed the fix/tracing-versions branch from 9e3ef4b to 82f9d0a Compare July 23, 2026 08:31
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.

1 participant