Skip to content

go: control nogo analysis and preserve caller settings - #306

Merged
tonyredondo merged 1 commit into
mainfrom
fix/go-sdk-nogo-controls
Nov 13, 2026
Merged

tonyredondo merged 1 commit into
mainfrom
fix/go-sdk-nogo-controls

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Instrumented Go tests can repeat nogo analysis already performed by the ordinary build. Their SDK transition also needs to preserve the caller's settings when a consumer's rules_go restores configuration on non-Go dependency edges.

This PR adds two options to dd_topt_go_test:

Option Behavior Default
nogo Set False to skip analysis in the enabled instrumented Go dependency closure when the ordinary build already analyzes those sources. Disabled sync exports retain ordinary analysis. True, preserving the caller's policy
restore_non_go_settings Record the incoming SDK/nogo values for an already-patched rules_go to restore and clear on non-Go edges. Existing records survive repeated transitions. False

The restoration option requires original_sdk_name, original_bootstrap_nogo and the consumer's restoration transitions. Stock upstream rules_go 0.59.0–0.65.0 does not implement that contract. The default path remains compatible with those versions; the opt-in fails analysis if the required settings are missing. This PR does not patch rules_go or change SDK registration. Both wrapper variants keep the ddtest_go test language.

The README, configuration reference, Go onboarding skill and changelog explain when an opt-out is appropriate and which consumer patches remain necessary.

Validation:

  • 105 Go suite tests passed, including transition combinations, idempotence, SDK variants and exec tools. A copied transition with the opt-out removed fails the new regression.
  • Actual nogo rejection/default/disabled controls and an instrumented passing payload passed with upstream 0.59.0 and 0.65.0 in WORKSPACE and Bzlmod.
  • Existing consumer E2E passed in both modes at 0.64.2, including configured data, x_defs, manifest-only runfiles, doctor and a received mock payload.
  • Positive restoration passed in both modes against a temporary restoration-capable rules_go, including cleared records, a shared ordinary data configuration and preserved analyzer rejection on ordinary Go data/helper dependencies. A named caller SDK also passed.
  • Buildifier, shell syntax, helper ShellCheck, module-version alignment and git diff --check passed. Independent final audit found no remaining concrete defects.

The local runs above used macOS ARM64. Ordinary CI at 61240b2a now passes all 34 checks, including native Linux/macOS/Windows and all seven supported rules_go versions in WORKSPACE and Bzlmod. The new nogo controls run at the range endpoints. RBE, differing host/exec platforms and cryptographic FIPS execution have not been verified here. No performance gain is claimed.

Stacked on #305 so the diff contains only the SDK/nogo changes. Consumer E2E #193 pins this commit and exercises the public options in the existing native jobs.

@tonyredondo
tonyredondo marked this pull request as ready for review November 13, 2026 18:49
@tonyredondo
tonyredondo requested a review from a team as a code owner November 13, 2026 18:49

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 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.

Bits Code Review: PASS

More details

The transitions preserve caller nogo policy and existing restoration records, while disabled exports retain ordinary analysis. Restoration remains explicitly opt-in and requires patched rules_go.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 61240b2

Base automatically changed from perf/uploader-throughput to main November 13, 2026 20:32
@tonyredondo
tonyredondo merged commit 95cf545 into main Nov 13, 2026
35 checks passed
@tonyredondo
tonyredondo deleted the fix/go-sdk-nogo-controls branch November 13, 2026 20:33
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.

2 participants