Skip to content

Conversation

@cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider commented Nov 28, 2025

also wanna w8 4 #555 and provide option to set lock attribute the same way

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 79.06977% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.42%. Comparing base (e3afe03) to head (a62baea).

Files with missing lines Patch % Lines
contracts/container/contract.go 78.57% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
+ Coverage   63.37%   63.42%   +0.05%     
==========================================
  Files          29       29              
  Lines        3279     3303      +24     
==========================================
+ Hits         2078     2095      +17     
- Misses       1195     1202       +7     
  Partials        6        6              

☔ 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.

@cthulhu-rider cthulhu-rider force-pushed the container-lock branch 2 times, most recently from 98910b0 to 332b5e1 Compare December 3, 2025 13:57
@cthulhu-rider cthulhu-rider changed the title Support container locks Support container deletion lock Dec 3, 2025
@cthulhu-rider cthulhu-rider marked this pull request as ready for review December 3, 2025 14:55
cthulhu-rider added a commit to nspcc-dev/neofs-node that referenced this pull request Dec 3, 2025
This auto-makes IR to deploy/update Container contract with supported
locks nspcc-dev/neofs-contract#558.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit to nspcc-dev/neofs-node that referenced this pull request Dec 3, 2025
Catch 'container is locked' exception added in
nspcc-dev/neofs-contract#558 and respond with
`CONTAINER_LOCKED` API status on it.

Signed-off-by: Leonard Lyubich <[email protected]>
Attribute was introduced in nspcc-dev/neofs-api#357.
It is now validated on creation, checked on deletion and can be
set/reset in existing container.

Closes #497.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit to nspcc-dev/neofs-node that referenced this pull request Dec 5, 2025
This auto-makes IR to deploy/update Container contract with supported
locks nspcc-dev/neofs-contract#558.

This also makes IR to accept containers with lock attribute.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit to nspcc-dev/neofs-node that referenced this pull request Dec 5, 2025
Catch 'container is locked' exception added in
nspcc-dev/neofs-contract#558 and respond with
`CONTAINER_LOCKED` API status on it.

Signed-off-by: Leonard Lyubich <[email protected]>

switch name {
case corsAttributeName:
case corsAttributeName, lockAttributeName:
Copy link
Member

Choose a reason for hiding this comment

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

This attribute can't be removed/changed that easy. Treat it like a LOCK object, the lock can be extended, but not shortened or deleted, that's the purpose of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make it disposable?

Copy link
Member

Choose a reason for hiding this comment

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

After it expires it can be deleted, but not sooner than that.

@cthulhu-rider cthulhu-rider marked this pull request as draft December 5, 2025 16:51
for i := range cnr.Attributes {
switch cnr.Attributes[i].Key {
case lockAttributeName:
if std.Atoi10(cnr.Attributes[i].Value) <= 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also thinking of check against current time

Signed-off-by: Leonard Lyubich <[email protected]>
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.

3 participants