Skip to content

Conversation

@phm07
Copy link
Contributor

@phm07 phm07 commented Sep 5, 2025

This PR implements actions for Storage Boxes.

@phm07 phm07 self-assigned this Sep 5, 2025
@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 64.23983% with 167 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (storage-boxes@529ad9d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/cmd/storagebox/rollback_snapshot.go 41.66% 28 Missing and 7 partials ⚠️
internal/cmd/storagebox/change_type.go 55.31% 14 Missing and 7 partials ⚠️
internal/cmd/storagebox/enable_protection.go 68.25% 14 Missing and 6 partials ⚠️
internal/cmd/storagebox/enable_snapshot_plan.go 76.92% 12 Missing and 6 partials ⚠️
internal/cmd/storagebox/update_access_settings.go 70.00% 12 Missing and 6 partials ⚠️
internal/cmd/storagebox/disable_snapshot_plan.go 61.29% 8 Missing and 4 partials ⚠️
internal/cmd/storagebox/reset_password.go 68.42% 8 Missing and 4 partials ⚠️
internal/cmd/storagebox/disable_protection.go 66.66% 6 Missing and 3 partials ⚠️
internal/cmd/storagebox/texts.go 0.00% 8 Missing ⚠️
internal/cmd/util/util.go 60.00% 8 Missing ⚠️
... and 1 more
Additional details and impacted files
@@               Coverage Diff                @@
##             storage-boxes    #1145   +/-   ##
================================================
  Coverage                 ?   64.28%           
================================================
  Files                    ?      267           
  Lines                    ?    11743           
  Branches                 ?        0           
================================================
  Hits                     ?     7549           
  Misses                   ?     3380           
  Partials                 ?      814           
Flag Coverage Δ
unit 64.28% <64.23%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@phm07 phm07 force-pushed the storage-boxes-actions branch from 63258d9 to b54efad Compare September 5, 2025 09:56
@apricote apricote mentioned this pull request Aug 20, 2025
11 tasks
@phm07 phm07 marked this pull request as ready for review September 5, 2025 15:00
@phm07 phm07 requested a review from a team as a code owner September 5, 2025 15:00
@phm07 phm07 force-pushed the storage-boxes-actions branch from c58e759 to b99852c Compare September 5, 2025 15:12
Base automatically changed from storage-boxes-crud to storage-boxes September 8, 2025 14:39

_ = cmd.RegisterFlagCompletionFunc("day-of-week", cmpl.SuggestCandidates("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"))

// TODO: should we add some validation here to avoid footguns? (e.g. backing up every minute)
Copy link
Contributor

Choose a reason for hiding this comment

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

The frontend does not allow unsetting the values I think. What about having -1 for every minute/hour, and we default to UTC 00:00?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want the same behavior as the frontend, we could also just require a value for minute and hour

Copy link
Contributor

@lukasmetzner lukasmetzner Sep 10, 2025

Choose a reason for hiding this comment

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

And not allow snapshotting every minute, or every hour at all? For snapshotting every minute, I would be okay not allowing it, because I can't imagine some needing that. For snapshotting every hour, I am not sure, but probably no wants that?

If you want to move forward, I would be okay with making this a TODO in the code and marking both as required for now.

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 think snapshotting every hour would definitely make sense, but the frontend requires both an hour and minute 🤷
If we allow not setting it, then the user could cause invalid state in the frontend using the CLI.
Ideally I think defaulting to UTC 00:00 would make the most sense. Otherwise when a user for example only sets --day-of-week, a snapshot would be created at every minute of that day of the week. Creating only one snapshot on that day at 00:00 would definitely make more sense.
On the other hand, if we allow -1 as a value, we deviate from the API. So I'm not sure what what would be the best proceeding here. If we default to 00:00 and allow -1 for minute or hour, the behavior is different in the API, CLI and the frontend.

Copy link
Contributor

Choose a reason for hiding this comment

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

If think if we support every hour, we should definitely support every minute.

I can think of:

  1. --minute * --hour * --day-of-week sunday would be more intuitive I guess, but harder to parse
  2. --every-minute --every-hour --day-of-week sunday adds more flags, but would be very specific about the behaviour
  3. --minute -1 --hour -1 --day-of-week not as intuitive as *, but easier to parse

I think I'd prefer either the first or second option. I think we should discuss this at least with @jooola or @apricote.

But as said, we can also merge this now and talk about this internally.

@lukasmetzner
Copy link
Contributor

lukasmetzner commented Sep 9, 2025

@phm07 Looks good to me. Can you do a rebase and address the open issues, then I would take a final look, and we can merge this in storage-boxes?

@phm07 phm07 force-pushed the storage-boxes-actions branch from b99852c to 05160ac Compare September 10, 2025 09:26
@phm07 phm07 merged commit 6d03a93 into storage-boxes Sep 18, 2025
5 of 6 checks passed
@phm07 phm07 deleted the storage-boxes-actions branch September 18, 2025 09:06
phm07 added a commit that referenced this pull request Sep 18, 2025
This PR implements actions for Storage Boxes.
phm07 added a commit that referenced this pull request Sep 18, 2025
This PR implements actions for Storage Boxes.
phm07 added a commit that referenced this pull request Sep 19, 2025
This PR implements actions for Storage Boxes.
phm07 added a commit that referenced this pull request Sep 22, 2025
This PR implements actions for Storage Boxes.
phm07 added a commit that referenced this pull request Oct 9, 2025
This PR implements actions for Storage Boxes.
phm07 added a commit that referenced this pull request Oct 10, 2025
This PR implements actions for Storage Boxes.
jooola pushed a commit that referenced this pull request Oct 17, 2025
This PR implements actions for Storage Boxes.
apricote pushed a commit that referenced this pull request Oct 21, 2025
This PR implements actions for Storage Boxes.
apricote pushed a commit that referenced this pull request Oct 21, 2025
This PR implements actions for Storage Boxes.
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