Refactor storing of versioning setting in the tree service #273

Closed
opened 2025-12-28 17:36:48 +00:00 by sami · 3 comments
Owner

Originally created by @masterSplinter01 on GitHub (Jul 4, 2022).

Originally assigned to: @masterSplinter01 on GitHub.

Now we store versioning settings as two bools:
https://github.com/nspcc-dev/neofs-s3-gw/blob/master/api/data/info.go#L48

BucketSettings struct {
  IsNoneStatus      bool
  VersioningEnabled bool                     `json:"versioning_enabled"`
  LockConfiguration *ObjectLockConfiguration `json:"lock_configuration"`
}
  1. IsNoneStatus = true, VersioningEnabled = false -- unversioned (if a tree node has not been created)
  2. IsNoneStatus = false, VersioningEnabled = false -- suspended
  3. IsNoneStatus= false, VersioningEnabled = true -- versioned
  4. IsNoneStatus = true, VersioningEnabled = true -- is not possible

Maybe we can store it as a string Unversioned, Versioned, Suspended or as int (line enum: 0 = Unversioned, 1 = Versioned, 2 = Suspended).

It will make code simpler.

BUT it breaks backward compatibility.

Originally created by @masterSplinter01 on GitHub (Jul 4, 2022). Originally assigned to: @masterSplinter01 on GitHub. Now we store versioning settings as two bools: https://github.com/nspcc-dev/neofs-s3-gw/blob/master/api/data/info.go#L48 ``` BucketSettings struct { IsNoneStatus bool VersioningEnabled bool `json:"versioning_enabled"` LockConfiguration *ObjectLockConfiguration `json:"lock_configuration"` } ``` 1. `IsNoneStatus` = true, `VersioningEnabled` = false -- unversioned (if a tree node has not been created) 2. `IsNoneStatus` = false, `VersioningEnabled` = false -- suspended 3. `IsNoneStatus`= false, `VersioningEnabled` = true -- versioned 4. `IsNoneStatus` = true, `VersioningEnabled` = true -- is not possible Maybe we can store it as a string `Unversioned`, `Versioned`, `Suspended` or as int (line `enum`: 0 = `Unversioned`, 1 = `Versioned`, 2 = `Suspended`). It will make code simpler. BUT it breaks backward compatibility.
sami 2025-12-28 17:36:48 +00:00
Author
Owner

@alexvanin commented on GitHub (Jul 7, 2022):

Blocked the same as https://github.com/nspcc-dev/neofs-s3-gw/issues/533#issuecomment-1157524328

@alexvanin commented on GitHub (Jul 7, 2022): Blocked the same as https://github.com/nspcc-dev/neofs-s3-gw/issues/533#issuecomment-1157524328
Author
Owner

@alexvanin commented on GitHub (Jul 18, 2022):

I think it is time to do that according to https://github.com/nspcc-dev/neofs-s3-gw/pull/536#issuecomment-1186941185

@alexvanin commented on GitHub (Jul 18, 2022): I think it is time to do that according to https://github.com/nspcc-dev/neofs-s3-gw/pull/536#issuecomment-1186941185
Author
Owner

@alexvanin commented on GitHub (Jul 27, 2022):

Closed in #599

@alexvanin commented on GitHub (Jul 27, 2022): Closed in #599
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#273
No description provided.