Skip to content

fix(examples): DSPX-4607 clear goconst and SA1019 lint findings - #3974

Open
dmihalcik-virtru wants to merge 1 commit into
mainfrom
fix/lint-examples-goconst
Open

fix(examples): DSPX-4607 clear goconst and SA1019 lint findings#3974
dmihalcik-virtru wants to merge 1 commit into
mainfrom
fix/lint-examples-goconst

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Sep 3, 2026

Copy link
Copy Markdown
Member

Part of the DSPX-4607 lint burndown. golangci-lint v2.13.2 (#3965) surfaced 351 pre-existing findings across the repo; they're being cleared as independent PRs grouped by CODEOWNER. This one covers examples/ — 9 findings (8 goconst, 1 staticcheck SA1019).

Changes

goconst (8) — two strings repeated across the benchmark subcommands are now package constants in cmd/examples.go:

  • benchmarkCmdShort = "OpenTDF benchmark tool" (3 uses)
  • exampleAttrValueFQN = "https://example.com/attr/attr1/value/value1" (5 uses)

Two redundant aliases folded into the new constant while I was there: the testAttr package var in benchmark_experimental.go and the attrValueFQN local in benchmark_decision_v2.go both held the same literal.

staticcheck SA1019 (1)cmd/attributes.go sets the deprecated GetAttributeRequest.Id. Annotated with //nolint:staticcheck per the agreed strategy for this burndown (annotate, don't migrate off deprecated proto fields).

Worth a follow-up: GetAttributeRequest does have a non-deprecated attribute_id in its identifier oneof, and this is example code — showing the deprecated path is arguably the wrong thing to demonstrate. Left as-is here to keep the burndown mechanical; happy to migrate it in this PR if reviewers prefer.

No behavior change.

Testing

Related

DSPX-4607 burndown index

@dmihalcik-virtru
dmihalcik-virtru requested a review from a team as a code owner September 3, 2026 21:46
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 63688fda-8ae6-4b9e-83ed-97392bf17522

📥 Commits

Reviewing files that changed from the base of the PR and between d5933ed and c40ebca.

📒 Files selected for processing (8)
  • examples/cmd/attributes.go
  • examples/cmd/benchmark.go
  • examples/cmd/benchmark_bulk.go
  • examples/cmd/benchmark_decision.go
  • examples/cmd/benchmark_decision_v2.go
  • examples/cmd/benchmark_experimental.go
  • examples/cmd/encrypt.go
  • examples/cmd/examples.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 161.083835ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 91.13973ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 310.057493ms
Throughput 322.52 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.687357355s
Average Latency 425.929358ms
Throughput 117.13 requests/second

jakedoublev
jakedoublev previously approved these changes Sep 3, 2026
Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 260.349973ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 142.489628ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 440.765813ms
Throughput 226.88 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 1m2.783092042s
Average Latency 626.34885ms
Throughput 79.64 requests/second

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • otdfctl
  • service
  • tests-bdd

See the workflow run for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants