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

chore: archiver cleanup #3726

Merged
merged 7 commits into from
Aug 10, 2023
Merged

chore: archiver cleanup #3726

merged 7 commits into from
Aug 10, 2023

Conversation

fracasula
Copy link
Collaborator

@fracasula fracasula commented Aug 9, 2023

Description

Prepared statements for archiver + more DRY and cleanup.

Linear Ticket

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

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Patch coverage: 62.29% and project coverage change: -0.06% ⚠️

Comparison is base (b199d1d) 68.13% compared to head (8683c2a) 68.07%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3726      +/-   ##
==========================================
- Coverage   68.13%   68.07%   -0.06%     
==========================================
  Files         333      333              
  Lines       51462    51454       -8     
==========================================
- Hits        35063    35028      -35     
- Misses      14118    14140      +22     
- Partials     2281     2286       +5     
Files Changed Coverage Δ
warehouse/archive/archiver.go 66.05% <57.97%> (+0.19%) ⬆️
warehouse/jobs/runner.go 60.19% <65.00%> (+0.81%) ⬆️
warehouse/warehouse.go 54.53% <84.00%> (-0.17%) ⬇️

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fracasula fracasula marked this pull request as ready for review August 9, 2023 13:17
@@ -72,13 +72,16 @@ type Archiver struct {
}

func (a *Archiver) backupRecords(ctx context.Context, args backupRecordsArgs) (backupLocation string, err error) {
a.Logger.Infof(`Starting backupRecords for uploadId: %s, sourceId: %s, destinationId: %s, tableName: %s,`, args.uploadID, args.sourceID, args.destID, args.tableName)
a.Logger.Infof("[Archiver]: Starting backupRecords for uploadId: %s, sourceId: %s, destinationId: %s, tableName: %s,",
Copy link
Member

Choose a reason for hiding this comment

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

We should use structured logging, I would avoid prefixing with archiver

@@ -96,7 +99,9 @@ func (a *Archiver) backupRecords(ctx context.Context, args backupRecordsArgs) (b
Config: filemanagerutil.GetProviderConfigForBackupsFromEnv(ctx, config.Default),
})
if err != nil {
err = fmt.Errorf("error in creating a file manager for:%s. Error: %w", config.GetString("JOBS_BACKUP_STORAGE_PROVIDER", "S3"), err)
err = fmt.Errorf("error in creating a file manager for:%s. Error: %w",
Copy link
Member

Choose a reason for hiding this comment

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

Better error message

@fracasula
Copy link
Collaborator Author

@lvrach I'll merge this one and address the structured logging in this file in another PR with low prio.

@fracasula fracasula merged commit e9b6a69 into master Aug 10, 2023
36 checks passed
@fracasula fracasula deleted the chore.archiverCleanup branch August 10, 2023 07:43
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.

None yet

3 participants