← Back to Pull requests

[Backport v1.32] fix(kubectl): embed release version metadata and expose --version #3718

Closed
unknown closed this pull request without merging on Nov 03, 2026 11:14 UTC
View on GitHub
unknown unknown commented on Nov 03, 2026 09:45 UTC
Author

Backport e208d5a190b8b4c670c0d6aa454fd5c94b709896 from #3717.

___

What does this PR do?

Embed the release version, full Git commit, and build time in kubectl-datadog using GoReleaser's metadata in all four build configurations. Add kubectl datadog --version to print those values, with a regression test and usage documentation.

Motivation

CONTP-2289: published plugin binaries retain the default version 0.0.0 because the release workflow runs GoReleaser directly, while the linker flags reference variables defined only in the Makefile. The generic configuration also targets an incorrect package path. Users and support need to identify the installed plugin release.

Additional Notes

The platform-specific release configurations have contained these flags since their introduction in #697. This changes the configuration directly, so the workflow does not need to supply additional environment variables.

The published-artifact acceptance check remains pending until the next release.

Minimum Agent Versions

No new minimum version requirements.

Agent: unchanged
Cluster Agent: unchanged

Describe your test plan

  • Run go test ./cmd/kubectl-datadog/... ./pkg/version.

  • Run make lint.

  • Validate all four configurations with goreleaser check using GoReleaser 2.4.1.

  • Build both macOS architectures with goreleaser build --snapshot --skip=before --config .goreleaser-for-darwin.yaml; run the native binary with --version and compare its version, commit, and build time against dist/metadata.json.

  • After the next release, download the published plugin archive, extract it, and check that kubectl-datadog --version reports that release's version, commit, and build time.
  • Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies

  • PR has a milestone or the qa/skip-qa label

  • All commits are signed (see: [signing commits][1])
  • [1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

    [CONTP-2289]: https://datadoghq.atlassian.net/browse/CONTP-2289?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    Diff: 287 lines (+215 / -72) across 3 files Reviewer: tbavelier Review duration: 88m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 287 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.339
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #3718"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 63.0% (MEDIUM) · Higher = larger blast radius
    63.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.9% · Safe to merge
    24.9%