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

refactor: sources async job #4008

Merged
merged 18 commits into from
Nov 1, 2023
Merged

refactor: sources async job #4008

merged 18 commits into from
Nov 1, 2023

Conversation

achettyiitr
Copy link
Member

@achettyiitr achettyiitr commented Oct 25, 2023

Description

  • Introduce the repo and model for the Source Job.
  • Start() to honour context.
  • Minor cleanup to use SourceJob keyword instead of AsyncJob.
  • Introduce SourceManager for the source package.

Linear Ticket

  • Resolved PIPE-168

Security

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

@achettyiitr achettyiitr force-pushed the refactor.source-job branch 2 times, most recently from d463c62 to 43e41fc Compare October 25, 2023 17:53
@achettyiitr achettyiitr changed the title Refactor.source job refactor: sources async job Oct 25, 2023
@achettyiitr achettyiitr force-pushed the refactor.source-job branch 2 times, most recently from b9ac78f to 6cc7b72 Compare October 26, 2023 04:35
@achettyiitr achettyiitr marked this pull request as ready for review October 26, 2023 04:36
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 141 lines in your changes are missing coverage. Please review.

Comparison is base (17590a6) 71.53% compared to head (98a2ca2) 71.73%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4008      +/-   ##
==========================================
+ Coverage   71.53%   71.73%   +0.19%     
==========================================
  Files         373      373              
  Lines       54838    54941     +103     
==========================================
+ Hits        39227    39410     +183     
+ Misses      13273    13199      -74     
+ Partials     2338     2332       -6     
Files Coverage Δ
warehouse/api/http.go 78.94% <100.00%> (ø)
warehouse/app.go 89.59% <100.00%> (ø)
warehouse/integrations/testhelper/setup.go 99.36% <100.00%> (-0.32%) ⬇️
warehouse/internal/model/upload.go 100.00% <ø> (ø)
warehouse/internal/repo/upload.go 91.01% <ø> (ø)
warehouse/router/router.go 87.54% <100.00%> (-0.03%) ⬇️
warehouse/integrations/testhelper/verify.go 89.64% <91.66%> (ø)
warehouse/internal/model/source.go 91.66% <91.66%> (ø)
warehouse/slave/worker.go 80.97% <76.19%> (-0.89%) ⬇️
warehouse/internal/repo/load.go 80.32% <79.41%> (+4.57%) ⬆️
... and 5 more

... and 9 files with indirect coverage changes

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

warehouse/api/http_test.go Outdated Show resolved Hide resolved
warehouse/internal/model/source.go Outdated Show resolved Hide resolved
warehouse/internal/repo/source.go Outdated Show resolved Hide resolved
warehouse/internal/repo/source.go Outdated Show resolved Hide resolved
warehouse/internal/repo/source_test.go Outdated Show resolved Hide resolved
warehouse/internal/repo/table_upload_test.go Outdated Show resolved Hide resolved
})
tableNames = lo.Filter(lo.Uniq(tableNames), func(tableName string, i int) bool {
switch strings.ToLower(tableName) {
case "rudder_discards", "rudder_identity_mappings", "rudder_identity_merge_rules":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we have enums for these? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

We have constants for these:

	tableNames = lo.Filter(lo.Uniq(tableNames), func(tableName string, i int) bool {
		switch strings.ToLower(tableName) {
		case whutils.DiscardsTable, whutils.IdentityMappingsTable, whutils.IdentityMergeRulesTable:
			return false
		default:
			return true
		}
	})

warehouse/source/http.go Outdated Show resolved Hide resolved
warehouse/source/http.go Outdated Show resolved Hide resolved
warehouse/source/http.go Outdated Show resolved Hide resolved
@achettyiitr achettyiitr merged commit a9199ae into master Nov 1, 2023
35 checks passed
This was referenced Nov 12, 2023
@achettyiitr achettyiitr deleted the refactor.source-job branch November 13, 2023 08:03
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