feat: configurable retry delay#288
Open
maijalintunokka wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the API retry behavior configurable via config/environment variables (retry delay and max retry count), removing the previous hardcoded test-specific retry delay override introduced earlier.
Changes:
- Add
maxRetryCountandretryDelayto persistent and environment config schemas, plus new env vars. - Update retry logic to read retry settings from
getCachedConfig()(instead of hardcoded constants/test detection). - Update tests and test setup/mocks to use a very small retry delay for faster runs.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds an additional test setup file for config-related test defaults. |
| test/utils/mockFileSystem.ts | Ensures mocked .nosto.json includes a small retryDelay and satisfies the updated config type. |
| test/utils/mockConfig.ts | Extends mocked runtime config with maxRetryCount and retryDelay. |
| test/setupConfig.ts | New global test setup to override retryDelay via getCachedConfig() spying. |
| test/config/fileConfig.test.ts | Updates expectations to include new config defaults (maxRetryCount, retryDelay). |
| test/api/retry.test.ts | Updates retry warning assertions to match the new 1ms test retry delay. |
| src/modules/setup.ts | Documents the new retry-related config options in setup help output. |
| src/config/schema.ts | Adds maxRetryCount and retryDelay to persistent/environment config schemas with defaults. |
| src/config/envConfig.ts | Adds env var mappings for NOSTO_MAX_RETRY_COUNT and NOSTO_RETRY_DELAY. |
| src/api/retry.ts | Uses cached config for retry count/delay and removes test-aware delay override logic. |
| README.md | Removes an outdated “Known issues” section that was addressed previously. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Follow-up to #282. This removes the hardcoded test-aware logic from the retry function.
Related Jira ticket
https://nostosolutions.atlassian.net/browse/SEARCH-2278
Screenshots