Skip to content

Mutable containers#3789

Merged
roman-khimov merged 5 commits intomasterfrom
mutable-containers
Jan 29, 2026
Merged

Mutable containers#3789
roman-khimov merged 5 commits intomasterfrom
mutable-containers

Conversation

@cthulhu-rider
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.67%. Comparing base (bc322b8) to head (ff0022a).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
cmd/neofs-cli/modules/container/get.go 0.00% 17 Missing ⚠️
...md/neofs-adm/internal/modules/fschain/container.go 0.00% 7 Missing ⚠️
cmd/neofs-node/meta.go 0.00% 6 Missing ⚠️
cmd/neofs-cli/modules/container/nodes.go 0.00% 3 Missing ⚠️
cmd/neofs-node/container.go 0.00% 1 Missing ⚠️
pkg/services/meta/notifications.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3789      +/-   ##
==========================================
- Coverage   25.70%   25.67%   -0.03%     
==========================================
  Files         660      660              
  Lines       42167    42177      +10     
==========================================
- Hits        10837    10828       -9     
- Misses      30348    30364      +16     
- Partials      982      985       +3     

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

When executed with `--cid` flag, printing it again makes no sense. And
given the current container mutability (via attributes, #3733),
evaluating it from the container is incorrect.

Refs #3788.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Containers are mutable now (#3733), therefore result may be incorrect.

Refs #3788.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Containers are mutable now (#3733), therefore it's worth keeping (ID,
container) pairs.

Refs #3788.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
IDs can be in the dump now. If so, there is no need to calculate them.
Especially taking into account containers' mutability (#3733).

Refs #3788.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This may result in wrong ID since containers became mutable (#3733).
This also eliminates unnecessary resource consumption.

Closes #3788.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@cthulhu-rider cthulhu-rider marked this pull request as ready for review January 28, 2026 14:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes container ID handling by passing container IDs as parameters instead of recomputing them from marshalled container data. This is crucial for supporting "mutable containers" where container attributes can be modified while the ID remains constant.

Changes:

  • Modified the IsMineWithMeta and isContainerMine functions to accept container ID as a parameter instead of computing it from marshalled data
  • Updated CLI commands to return and reuse container IDs where available
  • Enhanced ADM fschain dump-containers and restore-containers commands to serialize/deserialize container IDs in JSON format

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/services/meta/meta.go Updated IsMineWithMeta interface to accept container ID parameter
pkg/services/meta/notifications.go Updated call to IsMineWithMeta to pass container ID
pkg/services/meta/notifications_test.go Updated test mock to match new interface signature
cmd/neofs-node/meta.go Updated IsMineWithMeta and isMineWithMeta implementations to accept container ID; modified isContainerMine to accept ID instead of computing it
cmd/neofs-node/container.go Updated call to isContainerMine to pass container ID
cmd/neofs-cli/modules/container/get.go Modified getContainer to return container ID; updated prettyPrintContainer to accept ID parameter
cmd/neofs-cli/modules/container/nodes.go Updated to use container ID from getContainer with fallback computation
cmd/neofs-adm/internal/modules/fschain/container.go Added ID field to Container struct; implemented ID serialization in dump and deserialization in restore commands
CHANGELOG.md Documented new features for ADM fschain commands

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@roman-khimov roman-khimov merged commit 03bbf38 into master Jan 29, 2026
26 of 28 checks passed
@roman-khimov roman-khimov deleted the mutable-containers branch January 29, 2026 15:12
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