Repository navigation
fix: bound the sync interval and fill doc gaps - #396
Conversation
- `sync_interval_hours` must be from 1 to 8760 hours (finite): larger values overflowed the times of next attempts on startup, and smaller ones fetched from services far more often than needed. - Configuration: the rate at which syncs can leave versions behind that don't count for `max_unused_service_types`. - Chart README (to 1.0.0rc2): the new policy rules that values files with list-form policies must add. Closes #389 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The interval's bounds in the config comment, the spec and the API docs; boundary tests with literal values instead of a test that repeats the constants; the long field line wrapped. - Configuration: left-behind versions only stop counting for the user the service counts for, if that user added them; one list per mode. - Chart README: the read rules of syncs only matter where login is required for reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideData structuresAdd finite 1-to-8760-hour bounds to the service-info configuration model and document those bounds alongside the field.
APIDocument the supported interval range for the public
ConfigurationState the supported sync-interval range in the default configuration comment.
DocumentationExplain the sync interval bounds and clarify how sync-created type versions affect unused-type limits by registration mode and service user.
Document the additional policy rules needed when upgrading chart values that use list-form policies.
TestsTest rejection of non-finite and out-of-range intervals and acceptance of the supported boundary values.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Linked issuesChecked at commit 7009a20 #389 fix: small fixes from the 1.0.0rc2 review · 3 of 3 met
|
The sync interval's bounds and the documentation of left-behind type versions and of the chart's new policy rules (#389, #396). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #396 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 3265 3343 +78
=========================================
+ Hits 3265 3343 +78 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Small fixes from the pre-release review of 1.0.0rc2, before the tag:
Sync interval bounds:
custom.endpoints.services.service_info.sync_interval_hoursmust now be finite and from 1 to 8760 hours (MIN_SYNC_INTERVAL_HOURS,MAX_SYNC_INTERVAL_HOURSincloud_registry/service_models/custom_config.py). Very large values failed every worker at startup with anOverflowError. Very small ones fetched from the registered services far more often than needed, with the scheduler checking every second. Values outside the range now stop the app at startup, through FOCA's config validation. Sync is new in 1.0.0rc2, so no earlier configuration is affected. The bounds are documented indocs/configuration.md,docs/api.md, the comment inconfig.yamland the description ofintervalHoursin the additions spec.Left-behind versions:
docs/configuration.md(Service types) now says at what rate syncs can leave type versions behind that stop counting formax_unused_service_types:open, one per sync: per service and interval for the app's syncs, and up tofetches_per_hourper hour and user forPUT /services/{serviceId}/sync;moderated, pending versions still count;controlled, or with the limit0, syncs add no types.It also says that the release only applies to versions that the user the service counts for added. I didn't change the code to limit the rate: releasing only for background syncs would make owners who sync by hand use up their limit, so that their services stop syncing.
Chart README (To app version 1.0.0rc2): values files that give the policies as a list must add the seven new rules (
import-service-info,owners-sync-services,maintainers-sync-services,get-service-sync,list-syncs,list-notifications,dismiss-notifications), asdocs/upgrading.mdalready says.Closes #389
Full lane:
adversarial-reviewerandquality-reviewerran on the first commit; their findings are fixed in the second commit (see below).Verification
Locally, Python 3.13, locked dependencies:
tests/test_sync.py::test_settings: 0, -1, 0.5, 0.9999, 8760.0001, 1e9, inf and nan are rejected; 1 and 8760 are accepted).tests/test_sync.py: 88 passed.tests/test_config.py::TestChartOverlayplus one intests/test_chart.py: they need the chart's dependencies (helm dependency build), and Helm isn't installed here. Because they didn't run, coverage ofcustom_config.pywas below 100% locally. CI runs them, in the Chart and Test jobs.pre-commit run --all-files: passed, after ruff reformatted one line.mkdocs build --strict: passed.CI: see the checks of this PR.
Review
config.yaml; a change-detector test is replaced by boundary tests with literal values; the line over 88 characters is wrapped; the passage on the type limit is split into a list.get-service-syncandlist-syncsonly matter where login is required for reads.Declined review findings
minimum/maximumonintervalHoursin the spec (quality, medium): the bounds are in the description instead. Responses are validated, and tests set intervals below an hour directly on the config, so schema bounds could turn theirGET /service-infointo500responses.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Enforce safe service sync interval bounds and close documentation gaps for synchronization behavior and the 1.0.0rc2 upgrade.
Bug Fixes:
Enhancements:
Documentation:
Tests: