Skip to content

feat(cliv2): enable CaptureEngine billing lifecycle [IANDT-240] - #7067

Draft
brettgurman-snyk wants to merge 6 commits into
mainfrom
bg/attach-capture-bag
Draft

feat(cliv2): enable CaptureEngine billing lifecycle [IANDT-240]#7067
brettgurman-snyk wants to merge 6 commits into
mainfrom
bg/attach-capture-bag

Conversation

@brettgurman-snyk

@brettgurman-snyk brettgurman-snyk commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Minimal cliv2 host adapter for IANDT-240: enable GAF capture orchestration and call clibilling.BeginCommand / clibilling.FinishCommand at command boundaries.

Requires GAF IANDT-237 + 238 + 240 (#681) merged and a go.mod bump.

Diff vs main (2 files)

File Change
main.go EnableIfConfigured + WithContributorBillingCapture(); BeginCommand / FinishCommand at command start and tearDown
go.mod Comment documenting GAF dependency + local replace

No contributor_billing.go — lifecycle helpers live in GAF pkg/clibilling.

cliv2 wiring

globalEngine = clibilling.EnableIfConfigured(app.CreateAppEngineWithOptions(
    ...,
    app.WithContributorBillingCapture(),
))

cmdCtx := clibilling.BeginCommand(globalContext, globalEngine, config)
// Invoke(..., workflow.WithContext(cmdCtx))

clibilling.FinishCommand(teardownCtx, globalEngine, config, exitCode == 0)

Test plan

  • go test ./pkg/core/... (with local GAF replace)
  • CI after GAF merge + go.mod bump
  • E2E pre-prod

Merge order

#664#671#681this PR (go.mod bump) → E2E

brettgurman-snyk and others added 3 commits July 30, 2026 04:37
…-240]

Create one command-scoped capture bag for workflow and legacy proxy traffic,
call clibilling.Finish from tearDown on exit code 0, and remove the bespoke
legacy_contributor_billing emit path. Requires GAF 237+238; use local replace
for development until those land on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@snyk-io

snyk-io Bot commented Aug 3, 2026

Copy link
Copy Markdown

Snyk checks have failed. 2 issues have been found so far.

Status Scan Engine Critical High Medium Low Total (2)
Open Source Security 0 2 0 0 2 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Delegate bag lifecycle to GAF CaptureEngine (begin/finish at command
boundaries). Remove cliv2 networkinjector ctx and legacycli capture
duplication; GAF HTTP transport injection handles legacy proxy traffic.

Co-authored-by: Cursor <cursoragent@cursor.com>
@brettgurman-snyk brettgurman-snyk changed the title feat(cliv2): attach capture bag and finish billing at teardown [IANDT-240] feat(cliv2): enable CaptureEngine billing lifecycle [IANDT-240] Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️ There are multiple commits on your branch, please squash them locally before merging!
⚠️

"[refactor(cliv2): call clibilling BeginCommand/FinishCommand directly IANDT-240](https://api.github.com/repos/snyk/cli/git/commits/e0fbc5f8e328410326ee627306fd6ce96965be4f)" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"[feat(cliv2): attach capture bag and finish billing in teardown IANDT-240](https://api.github.com/repos/snyk/cli/git/commits/e2e960204fc28fb04dfc66e85aa085f448192d17)" is too long. Keep the first line of your commit message under 72 characters.

Generated by 🚫 dangerJS against e0fbc5f

brettgurman-snyk and others added 2 commits August 3, 2026 01:14
…[IANDT-240]

Remove contributor_billing.go wrapper; host lifecycle helpers now live in GAF.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use pseudo-version from go-application-framework #681 so CI can
compile pkg/clibilling before the tagged release.

Co-authored-by: Cursor <cursoragent@cursor.com>
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