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: add batch cacher #822

Merged
merged 6 commits into from
Feb 22, 2024
Merged

feat: add batch cacher #822

merged 6 commits into from
Feb 22, 2024

Conversation

cre8ivejp
Copy link
Member

Part of #405 and #820

I will add the cronjob in another PR.

Things done

  • Added feature flag cacher
  • Added segment user cacher
  • Added environment API key cacher
  • Added experiment cacher
  • Added auto ops rules cacher
  • Added unit tests

This pull request primarily extends the functionality of the batchService struct in pkg/batch/api/api.go by adding new cache jobs for feature flags, segment users, API keys, experiments, and autoOps rules. Additionally, the testing suite in pkg/batch/api/api_test.go has been updated to include tests for these new jobs and to make use of parallel testing.

Here are the most important changes:

New cache jobs in batchService:

Updates to the testing suite:

  • pkg/batch/api/api_test.go: Added new imports for the mock clients needed for the new tests. [1] [2]
  • type setupMockFunc func(: Extended the setupMockFunc type to include the new mock clients. [1] [2]
  • func TestExperimentStatusUpdater(t *testing.T) { and other test functions: Updated the setupMock function calls to include the new mock clients and added the t.Parallel() directive to enable parallel testing. [1] [2] [3] [4] [5] [6] [7]
  • func TestFeatureFlagCacher(t *testing.T) { and other new test functions: Added new test functions for the new jobs in batchService.
  • func newBatchService(t *testing.T,: Updated the function to create a new batchService for testing to include the new mock clients.

Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
@cre8ivejp cre8ivejp marked this pull request as ready for review February 15, 2024 03:39
@cre8ivejp cre8ivejp marked this pull request as draft February 20, 2024 07:45
@cre8ivejp cre8ivejp force-pushed the chore-segment-cacher branch from 7f09a15 to 32f634b Compare February 20, 2024 08:37
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
@cre8ivejp cre8ivejp force-pushed the chore-segment-cacher branch from 32f634b to fcadcac Compare February 20, 2024 08:44
@cre8ivejp cre8ivejp marked this pull request as ready for review February 20, 2024 10:49
@cre8ivejp cre8ivejp merged commit da18b3b into main Feb 22, 2024
14 checks passed
@cre8ivejp cre8ivejp deleted the chore-segment-cacher branch February 22, 2024 07:30
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.

2 participants