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: app for warehouse #3862

Merged
merged 22 commits into from
Sep 27, 2023
Merged

chore: app for warehouse #3862

merged 22 commits into from
Sep 27, 2023

Conversation

achettyiitr
Copy link
Member

@achettyiitr achettyiitr commented Sep 13, 2023

Description

  • Introduce the warehouse app.
  • Remove globals from the warehouse package.
  • Added test cases.

Linear Ticket

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 Sep 13, 2023

Codecov Report

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

Comparison is base (85adbbf) 68.96% compared to head (3a3721f) 69.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3862      +/-   ##
==========================================
+ Coverage   68.96%   69.19%   +0.23%     
==========================================
  Files         357      357              
  Lines       53082    53132      +50     
==========================================
+ Hits        36607    36764     +157     
+ Misses      14155    14051     -104     
+ Partials     2320     2317       -3     
Files Coverage Δ
warehouse/admin.go 9.72% <100.00%> (+2.57%) ⬆️
warehouse/encoding/encoding.go 100.00% <100.00%> (ø)
warehouse/grpc.go 81.04% <100.00%> (+1.55%) ⬆️
warehouse/http.go 78.72% <100.00%> (+1.14%) ⬆️
warehouse/integrations/deltalake/deltalake.go 74.49% <100.00%> (-0.31%) ⬇️
warehouse/internal/loadfiles/loadfiles.go 72.95% <100.00%> (ø)
warehouse/internal/repo/schema.go 88.88% <100.00%> (ø)
warehouse/internal/repo/upload.go 88.95% <100.00%> (ø)
warehouse/mode.go 100.00% <100.00%> (ø)
warehouse/router_scheduling.go 95.20% <100.00%> (-0.04%) ⬇️
... and 15 more

... and 8 files with indirect coverage changes

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

Comment on lines -314 to -319
if dbHandle == nil && !isStandAloneSlave(mode) {
return errors.New("warehouse service cannot start, database connection is not setup")
}
Copy link
Member Author

@achettyiitr achettyiitr Sep 14, 2023

Choose a reason for hiding this comment

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

We can probably skip starting in case rudder-core is in degraded mode as we are already skipping the start for the warehouse service later in here.

Copy link
Collaborator

@fracasula fracasula left a comment

Choose a reason for hiding this comment

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

Great work so far @achettyiitr, it's looking good 👍

warehouse/jobs/runner.go Show resolved Hide resolved
warehouse/mode.go Show resolved Hide resolved
warehouse/router.go Show resolved Hide resolved
warehouse/router_scheduling.go Outdated Show resolved Hide resolved
warehouse/slave_worker_job.go Outdated Show resolved Hide resolved
warehouse/warehouse_test.go Outdated Show resolved Hide resolved
warehouse/warehouse_test.go Show resolved Hide resolved
warehouse/trigger/trigger.go Outdated Show resolved Hide resolved
warehouse/warehouse_test.go Outdated Show resolved Hide resolved
warehouse/warehouse_test.go Outdated Show resolved Hide resolved
@achettyiitr
Copy link
Member Author

achettyiitr commented Sep 14, 2023

It still has nothing to do with triggers though so maybe we can give it a generic name or remove it completely.
Thoughts?

Yeah, we can remove this and just pass the dependency for triggerStore: syncs.Map. But I don't want to expose Store, Delete, and Load to other modules. Currently, it hides the implementation details. Thoughts?

warehouse/upload.go Outdated Show resolved Hide resolved
@achettyiitr
Copy link
Member Author

achettyiitr commented Sep 15, 2023

It still has nothing to do with triggers though so maybe we can give it a generic name or remove it completely.
Thoughts?

Yeah, we can remove this and just pass the dependency for triggerStore: syncs.Map. But I don't want to expose Store, Delete, and Load to other modules. Currently, it hides the implementation details. Thoughts?

Thanks, @fracasula, for pointing it out regarding triggerStore. No need to have it, since it is just proxying to syncs.Map. Removing it.

@atzoum
Copy link
Contributor

atzoum commented Sep 19, 2023

@achettyiitr this could be a good chance to fix deprecated usages of the config api in warehouse, e.g. config.RegisterXxxConfigVariable.

All other packages have been adapted except for reporting, event_schema (soon to be removed) and warehouse

@achettyiitr
Copy link
Member Author

@achettyiitr this could be a good chance to fix deprecated usages of the config api in warehouse, e.g. config.RegisterXxxConfigVariable.

All other packages have been adapted except for reporting, event_schema (soon to be removed) and warehouse

Picking it up just after these changes get merged.

Copy link
Collaborator

@fracasula fracasula left a comment

Choose a reason for hiding this comment

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

Approving with the last batch of minor comments. Thanks @achettyiitr for the effort! This is good work 👍

warehouse/jobs/runner.go Outdated Show resolved Hide resolved
warehouse/router.go Outdated Show resolved Hide resolved
warehouse/warehouse.go Outdated Show resolved Hide resolved
warehouse/warehouse.go Outdated Show resolved Hide resolved
@achettyiitr achettyiitr force-pushed the chore.app-warehouse branch 2 times, most recently from 3825375 to 7b0ef4e Compare September 21, 2023 11:22
@achettyiitr achettyiitr merged commit 5c9789f into master Sep 27, 2023
35 checks passed
@achettyiitr achettyiitr deleted the chore.app-warehouse 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

4 participants