Skip to content

Policy probe util#3790

Open
End-rey wants to merge 2 commits intomasterfrom
policy-probe-util
Open

Policy probe util#3790
End-rey wants to merge 2 commits intomasterfrom
policy-probe-util

Conversation

@End-rey
Copy link
Contributor

@End-rey End-rey commented Jan 28, 2026

Closes #3626.

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 0% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.51%. Comparing base (827cad9) to head (b430c89).

Files with missing lines Patch % Lines
cmd/neofs-cli/modules/container/policy/check.go 0.00% 40 Missing ⚠️
cmd/neofs-cli/modules/container/policy/util.go 0.00% 17 Missing ⚠️
cmd/internal/cmdprinter/netmap.go 0.00% 15 Missing ⚠️
cmd/neofs-cli/modules/container/policy/root.go 0.00% 7 Missing ⚠️
cmd/neofs-cli/modules/container/create.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/container/nodes.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/container/root.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/object/nodes.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3790      +/-   ##
==========================================
- Coverage   25.52%   25.51%   -0.02%     
==========================================
  Files         660      663       +3     
  Lines       42636    42673      +37     
==========================================
+ Hits        10884    10889       +5     
- Misses      30749    30783      +34     
+ Partials     1003     1001       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -0,0 +1,104 @@
package container
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything with "test" in name is suspicious by definition, better name it policy.go

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I mean it's pretty easy to confuse it with policy_test.go that'd be a test file, test_policy.go is not, but it looks so close that we're better not name it this way.

)

var testPolicyCmd = &cobra.Command{
Use: "test-policy",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be policy to me. Maybe policy try like we have acl basic print, although here it's application to a particular network that matters. I'm open to other suggestions, but I'd try to avoid test as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you suggesting a separate policy command with a single try command?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Maybe some other policy things could be done in future. But I'd like to hear @carpawell and @cthulhu-rider as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can imagine serverless container policy parse --policy 'EC 3/1 CBF 2 SELECT ...'. Taking this into account, container policy try seems better

at the same time, try seems too abstract to me. I suggest container policy apply

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is possible not to use - in a command name and there is subcomand relation (policy is a common thing, try is one of the things that can be done with policies), i would vote for policy try

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify/validate/check/test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of the policy try/apply/check command.
@roman-khimov Which one should we choose?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

policy check

@End-rey End-rey force-pushed the policy-probe-util branch 2 times, most recently from 2b79a01 to b430c89 Compare February 4, 2026 18:53
@End-rey End-rey requested a review from roman-khimov February 4, 2026 18:53
Add a CLI utility to validate container policies and display nodes that are
policy-compliant in the current epoch.

Closes #3626.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
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.

Provide storage policy probe util

4 participants