Add serve_stale, cache_repodata, sync_interval and parallel_fetch #37

Merged
benvin merged 2 commits from benvin/remote-cache-sync-fields into main 2026-10-25 23:45:39 +11:00
Member

artifactapi v3.24/v3.25 added four remote/virtual fields. Its PUT is a full replace, so any field the provider leaves out resets on every apply.

  • add serve_stale to all remotes
  • add cache_repodata to remotes; true only on github_rpm
  • add sync_interval to remotes, 0..2592000; >0 only on github_rpm/deb/alpine, checked at plan time
  • add parallel_fetch to the virtual resource
  • expose all four on the remote/virtual data sources
  • update docs and the github_rpm example
artifactapi v3.24/v3.25 added four remote/virtual fields. Its PUT is a full replace, so any field the provider leaves out resets on every apply. - add `serve_stale` to all remotes - add `cache_repodata` to remotes; `true` only on github_rpm - add `sync_interval` to remotes, 0..2592000; >0 only on github_rpm/deb/alpine, checked at plan time - add `parallel_fetch` to the virtual resource - expose all four on the remote/virtual data sources - update docs and the github_rpm example
unkin-agent added 1 commit 2026-10-25 23:03:12 +11:00
Add serve_stale, cache_repodata, sync_interval and parallel_fetch
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
bb91098128
The artifactapi PUT is a full replace, so unmodelled fields reset on every apply.
Author
Member
  • internal/provider/resource_remote.go:ValidateConfig — sync_interval = 0 explicitly set on a non-github remote is rejected at plan, but the API accepts 0 on any type (ValidateSyncInterval only errors when >0) → reject only when ValueInt64() > 0 on unsupported types.
  • internal/provider/resource_remote.go:ValidateConfig — cache_repodata = false explicitly set on a non-github_rpm remote is rejected; the API has no such check, so this blocks harmless configs (e.g. shared modules passing false) → error only when ValueBool() is true.
  • nit: docs/resources/remote_{docker,helm,npm,...}.md — serve_stale is added to every remote schema but only the rpm/deb/alpine/github_* docs list it → add the row to the remaining per-type docs or note it in the schema description.
- internal/provider/resource_remote.go:ValidateConfig — `sync_interval = 0` explicitly set on a non-github remote is rejected at plan, but the API accepts 0 on any type (`ValidateSyncInterval` only errors when >0) → reject only when `ValueInt64() > 0` on unsupported types. - internal/provider/resource_remote.go:ValidateConfig — `cache_repodata = false` explicitly set on a non-github_rpm remote is rejected; the API has no such check, so this blocks harmless configs (e.g. shared modules passing false) → error only when `ValueBool()` is true. - nit: docs/resources/remote_{docker,helm,npm,...}.md — `serve_stale` is added to every remote schema but only the rpm/deb/alpine/github_* docs list it → add the row to the remaining per-type docs or note it in the schema description.
unkin-agent added 1 commit 2026-10-25 23:07:34 +11:00
Accept sync_interval=0 and cache_repodata=false on every remote type
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
76c2cef942
Document serve_stale on all remote pages.
Author
Member

No findings.

No findings.
benvin merged commit 26a3262732 into main 2026-10-25 23:45:39 +11:00
benvin deleted branch benvin/remote-cache-sync-fields 2026-10-25 23:45:39 +11:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/terraform-provider-artifactapi#37