Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/arsn 177 introduce archive field in metadata #1856

Merged

Conversation

williamlardier
Copy link
Contributor

@williamlardier williamlardier commented May 3, 2022

This new metadata field is introduced as part of the Cold Storage epic.

The suggested format is a class in the same way as #1855.

Here, we enforce a specific order of fields edition:

  • The archiveInfo is required when creating the object
  • Both restoreRequestedAt and restoreRequestedDays can be only set if archiveInfo is set (because the latter is mandatory when creating the object)
  • Both restoreCompletedAt and restoreWillExpireAt can be only set if restoreRequestedAt and restoreRequestedDays are set, because the restoration completion comes after the restoration request.

Once the object is restored and the restoration expires, the archive field can be re-computed by keeping the archiveInfo field only.

The field setter will make sure the provided object is of the right type or is valid using the isValid static function of the new class.

Unit tests are added to make sure the class behave as expected.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

lgtm

@williamlardier williamlardier force-pushed the feature/ARSN-178-introduce-x-amz-restore-header branch from 642ef25 to 0e1b895 Compare May 5, 2022 12:37
@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch from 882dea9 to bca296c Compare May 5, 2022 12:37
@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch 2 times, most recently from 3e5a2bf to af71f12 Compare May 6, 2022 08:47
@williamlardier williamlardier force-pushed the feature/ARSN-178-introduce-x-amz-restore-header branch from 7c740a4 to da9090d Compare May 9, 2022 06:51
@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch 2 times, most recently from d735a57 to 11106e9 Compare May 9, 2022 07:02
@williamlardier williamlardier force-pushed the feature/ARSN-178-introduce-x-amz-restore-header branch from 158cf7d to f8881ef Compare May 9, 2022 14:00
@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch from 11106e9 to a0babc8 Compare May 9, 2022 14:00
@williamlardier williamlardier force-pushed the feature/ARSN-178-introduce-x-amz-restore-header branch from f8881ef to 25ae7e4 Compare May 9, 2022 14:45
@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch 2 times, most recently from 888c853 to 8bfe1a5 Compare May 10, 2022 09:11
@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch from 8bfe1a5 to b3cf9e8 Compare May 12, 2022 08:00
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2022

Codecov Report

Merging #1856 (5c936c9) into development/8.1 (75f0744) will increase coverage by 0.25%.
The diff coverage is 98.27%.

@@                 Coverage Diff                 @@
##           development/8.1    #1856      +/-   ##
===================================================
+ Coverage            63.00%   63.26%   +0.25%     
===================================================
  Files                  201      203       +2     
  Lines                15421    15535     +114     
  Branches              3076     3101      +25     
===================================================
+ Hits                  9716     9828     +112     
- Misses                5690     5692       +2     
  Partials                15       15              
Impacted Files Coverage Δ
lib/s3middleware/objectRestore.ts 95.45% <95.45%> (ø)
lib/constants.ts 100.00% <100.00%> (ø)
lib/models/ObjectMD.js 90.31% <100.00%> (+0.28%) ⬆️
lib/models/ObjectMDAmzRestore.js 100.00% <100.00%> (ø)
lib/models/ObjectMDArchive.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75f0744...5c936c9. Read the comment docs.

Base automatically changed from feature/ARSN-178-introduce-x-amz-restore-header to development/8.1 May 13, 2022 11:57
@bert-e
Copy link
Contributor

bert-e commented May 13, 2022

Hello williamlardier,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented May 13, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@williamlardier williamlardier force-pushed the feature/ARSN-177-introduce-archive-field-in-metadata branch from 9d03c24 to f87101e Compare May 13, 2022 12:02
@williamlardier
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented May 13, 2022

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/8.1

The following branches will NOT be impacted:

  • development/6.4
  • development/7.10
  • development/7.4

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented May 13, 2022

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/8.1

The following branches have NOT changed:

  • development/6.4
  • development/7.10
  • development/7.4

Please check the status of the associated issue ARSN-177.

Goodbye williamlardier.

@bert-e bert-e merged commit 5c936c9 into development/8.1 May 13, 2022
@bert-e bert-e deleted the feature/ARSN-177-introduce-archive-field-in-metadata branch May 13, 2022 12:43
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.

6 participants