feat: emit contributor billing after native code test --report - #169
feat: emit contributor billing after native code test --report#169brettgurman-snyk wants to merge 3 commits into
Conversation
|
|
|
| Status | Scan Engine | Total (0) | ||||
|---|---|---|---|---|---|---|
| Open Source Security | 0 | 0 | 0 | 0 | See details | |
| Licenses | 0 | 0 | 0 | 0 | See details | |
| ✅ | Code Security | 0 | 0 | 0 | 0 | 0 issues |
| ✅ | Secrets | 0 | 0 | 0 | 0 | 0 issues |
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
|
| Status | Scan Engine | Total (0) | ||||
|---|---|---|---|---|---|---|
| Open Source Security | 0 | 0 | 0 | 0 | See details | |
| Licenses | 0 | 0 | 0 | 0 | See details | |
| ✅ | Code Security | 0 | 0 | 0 | 0 | 0 issues |
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
This comment has been minimized.
This comment has been minimized.
Resolve native_workflow conflicts (keep observability + billing emit), pin go-application-framework to IANDT-237 pre-release commit, and extract maybeEmitContributorBilling to satisfy gocyclo lint. Co-authored-by: Cursor <cursoragent@cursor.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Felix Sargent <felix.sargent@snyk.io>
PR Reviewer Guide 🔍
|
| Timeout: contributorbilling.DefaultTimeout, | ||
| Logger: ictx.GetEnhancedLogger(), | ||
| Items: []contributorbilling.BillingItem{ | ||
| {EntityID: projectID}, |
There was a problem hiding this comment.
The EntityID is missing the project: prefix. According to the PR description, the payload should be contributors_entity_id=project:{ProjectId}, but the code only passes the bare projectID. This will send incorrect entity identifiers to the billing system.
{EntityID: "project:" + projectID},| {EntityID: projectID}, | |
| {EntityID: "project:" + projectID}, | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
|
The build fails because go.mod uses GAF v0.11.0, which lacks pkg/contributorbilling. The former pinned commit is This needs an upstream decision:
|
Summary
Fire-and-forget AC billing emit for native
snyk code test --report: after a successful analyze with a project ID, POST to ES ingest via GAFpkg/contributorbilling.Legacy TS Code paths are out of scope (cliv2 follow-up).
Changes
internal/contributorbilling/— wrapper aroundEmitContributorBilling(capability=code, git collection fromINPUT_DIRECTORY)native_workflow.go— emit when--reportis on, analyze succeeded, andresultMetaData.ProjectIdis setPayload:
contributors_entity_id=project:{ProjectId}.Merge order
go.modGAF bump) — parallel with os-flows / iac extension PRscode-client-go+ GAF,WaitWithTimeout, legacy pathsTest plan
go test ./internal/contributorbilling/...snyk code test --report→ ingest POST observed (after GAF + cliv2 land)