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

feat: implement background syncing for warehouse schema #5405

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shekhar-rudder
Copy link
Member

@shekhar-rudder shekhar-rudder commented Jan 3, 2025

Description

Related to #5347

Refactoring

  • Replaced the use of the Schema struct with the SchemaHandler interface, ensuring clients depend on an interface rather than the actual implementation.

New features

  • Introduced a new implementation of SchemaHandler, schemaV2, where the schema in the database is the source of truth.
  • Added a schema syncer that runs on a configurable schedule (copied from feat: fetch remote schema async #5347).

Implementation Notes

  • Retained existing method names to minimize the risk of regression and limit the scope of the PR. These can be updated once the schema implementation is deprecated.
  • Controlled the choice between schema and schemaV2 using an env.

Linear Ticket

< Replace with Linear Link ( create or search linear ticket) or >

Security

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

@shekhar-rudder shekhar-rudder force-pushed the war-150-schema-interface branch from 37a4b16 to f539685 Compare January 3, 2025 08:13
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 59.00000% with 82 lines in your changes missing coverage. Please review.

Project coverage is 74.73%. Comparing base (8a186e5) to head (f539685).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
warehouse/schema/schema_v2.go 29.06% 60 Missing and 1 partial ⚠️
warehouse/router/sync.go 58.33% 7 Missing and 3 partials ⚠️
warehouse/router/router.go 33.33% 3 Missing and 1 partial ⚠️
warehouse/router/upload.go 69.23% 3 Missing and 1 partial ⚠️
warehouse/schema/schema.go 95.77% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5405      +/-   ##
==========================================
- Coverage   74.82%   74.73%   -0.10%     
==========================================
  Files         438      440       +2     
  Lines       61331    61474     +143     
==========================================
+ Hits        45893    45941      +48     
- Misses      12895    12981      +86     
- Partials     2543     2552       +9     

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

@shekhar-rudder shekhar-rudder force-pushed the war-150-schema-interface branch 4 times, most recently from 30fa19d to 8bfc7e9 Compare January 9, 2025 13:10
@shekhar-rudder shekhar-rudder force-pushed the war-150-schema-interface branch from 8bfc7e9 to d38e842 Compare January 9, 2025 13:11
@shekhar-rudder shekhar-rudder marked this pull request as ready for review January 9, 2025 13:26
@shekhar-rudder shekhar-rudder force-pushed the war-150-schema-interface branch from d38e842 to 16aa26e Compare January 10, 2025 03:25
@shekhar-rudder shekhar-rudder force-pushed the war-150-schema-interface branch from 3234275 to eda8b8d Compare January 10, 2025 10:00
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.

1 participant