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

fix: removing the backup bucket env check to determine if backup is enabled #2668

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

BonapartePC
Copy link
Contributor

Description

Removing the backup bucket env check to determine if backup is enabled since bucket can be provided by customer as well

Notion Ticket

< Replace with Notion Link >

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@atzoum
Copy link
Contributor

atzoum commented Nov 8, 2022

@BonapartePC is this change needed for 1.3.0? If so, please change the target to release/1.3.x branch

@BonapartePC BonapartePC changed the base branch from master to release/1.3.x November 8, 2022 08:15
@BonapartePC
Copy link
Contributor Author

@BonapartePC is this change needed for 1.3.0? If so, please change the target to release/1.3.x branch

Made the change

@@ -29,7 +29,7 @@ type backupSettings struct {
}

func (b *backupSettings) isBackupEnabled() bool {
return masterBackupEnabled && b.instanceBackupEnabled && config.GetString("JOBS_BACKUP_BUCKET", "") != ""
Copy link
Contributor

@atzoum atzoum Nov 8, 2022

Choose a reason for hiding this comment

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

don't we need a default (fallback) backup bucket anyway? I don't think it is safe to remove this condition for single tenant deployments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but checking if JOBS_BACKUP_BUCKET env is set to determine if the backup is enabled does not seem right since we can take bucket details from the user as well right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Then jobsdb needs to consult another component for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, jobsdb only cares if master backup is enabled and instance backup is enabled and it's the job of fileuploader to provide bucket details to it right?

Copy link
Contributor

@atzoum atzoum Nov 8, 2022

Choose a reason for hiding this comment

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

we can take bucket details from the user as well right?

But still, don't we need to have a default bucket properly setup in a multitenant deployment, regardless of workspace-specific configurations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, that assertion should happen independently of this right? Probably somewhere even before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably check if all the backup related env are set?

Copy link
Contributor

@saurav-malani saurav-malani Nov 8, 2022

Choose a reason for hiding this comment

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

I agree with @atzoum. It is safer to keep the env check to ensure a default bucket is set for fallback, until we have a better way to do it.

@atzoum atzoum requested a review from saurav-malani November 8, 2022 08:25
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Base: 45.60% // Head: 45.45% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (abb0ce8) compared to base (0d061ff).
Patch coverage: 62.50% of modified lines in pull request are covered.

Additional details and impacted files
@@                Coverage Diff                @@
##           release/1.3.x    #2668      +/-   ##
=================================================
- Coverage          45.60%   45.45%   -0.15%     
=================================================
  Files                287      287              
  Lines              47790    47777      -13     
=================================================
- Hits               21793    21717      -76     
- Misses             24619    24683      +64     
+ Partials            1378     1377       -1     
Impacted Files Coverage Δ
enterprise/replay/setup.go 0.00% <0.00%> (ø)
services/archiver/archiver.go 7.93% <ø> (-3.91%) ⬇️
services/filemanager/filemanager.go 78.63% <60.00%> (ø)
jobsdb/backup.go 76.30% <100.00%> (-0.35%) ⬇️
warehouse/archiver.go 65.32% <100.00%> (ø)
processor/stash/stash.go 41.56% <0.00%> (-24.28%) ⬇️
services/rsources/handler.go 70.83% <0.00%> (-1.39%) ⬇️
processor/processor.go 85.99% <0.00%> (-0.42%) ⬇️
jobsdb/jobsdb.go 73.39% <0.00%> (-0.30%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@chandumlg chandumlg merged commit ea8cf4c into release/1.3.x Nov 8, 2022
@chandumlg chandumlg deleted the fix.removeCheckingBackupEnv branch November 8, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants