Skip to content

fix(cli): DSPX-4607 annotate deprecated Action.Value use in migration test - #3969

Open
dmihalcik-virtru wants to merge 1 commit into
mainfrom
fix/lint-otdfctl-sa1019
Open

fix(cli): DSPX-4607 annotate deprecated Action.Value use in migration test#3969
dmihalcik-virtru wants to merge 1 commit into
mainfrom
fix/lint-otdfctl-sa1019

Conversation

@dmihalcik-virtru

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

Copy link
Copy Markdown
Member

Part of the DSPX-4607 lint burndown, following the golangci-lint v2.13.2 bump (#3965, merged). Branched from main, independent of the other burndown PRs.

Best merged after #3968 (goconst tuning), which clears the other 133 otdfctl findings.

What

golangci-lint v2.13.2 reports one SA1019 in otdfctl:

otdfctl/migrations/namespacedpolicy/resolved_test.go:343:7: SA1019: (policy.Action).Value is deprecated: use 'name' instead (staticcheck)

TestResolveExisting… constructs a policy.Action whose Id is literally "legacy" and deliberately sets the deprecated Value oneof so the resolver takes the standard-action path — see the comment two blocks up: "entirely on the proto Standard enum to reach the standard-action path". Migrating it to Name would delete the behaviour the test exists to cover, so it's annotated instead.

Testing

$ cd otdfctl && golangci-lint run -c ../.golangci.yaml
0 issues.
$ go test ./migrations/...
ok  	github.com/opentdf/platform/otdfctl/migrations/namespacedpolicy	0.602s

(run against the tuned config from #3968; otdfctl goes from 134 findings to 0 across the two PRs)

Summary by CodeRabbit

  • Tests
    • Improved test clarity by documenting intentional coverage of a legacy action path.
    • Reformatted test data for consistency; test behavior and assertions remain unchanged.

DSPX-4607 burndown index

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

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Team

Run ID: ebdc8572-5e0d-45db-8ac2-8637364417f4

📥 Commits

Reviewing files that changed from the base of the PR and between 3052b2a and 4b08b25.

📒 Files selected for processing (1)
  • otdfctl/migrations/namespacedpolicy/resolved_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change documents intentional use of the deprecated policy.Action.Value field in an existing test. It also realigns literal fields. Test behavior and assertions remain unchanged.

Changes

Legacy action test coverage

Layer / File(s) Summary
Document deprecated action usage
otdfctl/migrations/namespacedpolicy/resolved_test.go
The existing policy.Action literal adds a //nolint:staticcheck comment for deliberate legacy-field usage. Field alignment is also adjusted.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to c5cd9

This change documents intentional legacy action coverage in a migration test without changing runtime behavior or assertions. No current merge-blocking risk remains.

Suggested reviewers: alkalescent

Poem

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: annotating the intentionally deprecated policy.Action.Value usage in a migration test.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/lint-otdfctl-sa1019

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 194.094045ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 419.281048ms
Throughput 238.50 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 53.570650592s
Average Latency 534.503898ms
Throughput 93.33 requests/second

@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 172.919255ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 294.842094ms
Throughput 339.16 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.956859609s
Average Latency 428.748351ms
Throughput 116.40 requests/second

jakedoublev
jakedoublev previously approved these changes Sep 3, 2026
… test

golangci-lint v2.13.2 reports SA1019 for the deprecated policy.Action.Value
oneof. This test deliberately exercises the legacy standard-action path, so
annotate rather than migrate.

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 229.987484ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 441.924552ms
Throughput 226.28 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 56.060945575s
Average Latency 559.128075ms
Throughput 89.19 requests/second

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants