49 Commits

Author SHA1 Message Date
benvin f947f23e45 Merge pull request 'resource_remote: add mirror_strategy attribute (fixes missing API field)' (#19) from benvin/mirror-strategy into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #19
v0.5.1
2026-08-13 19:56:58 +10:00
unkin-agent 24c11d233a resource_remote: make mirror_strategy Computed to avoid plan churn
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The API stores mirror_strategy NOT NULL DEFAULT 'round_robin' and always
returns it on GET, so an Optional-only attribute (mapping empty->null on
read) put 'round_robin' into state while config was null, showing a
perpetual 'round_robin -> null' diff for every remote that did not set it.

- schema: mirror_strategy is now Optional+Computed with a round_robin
  default, mirroring how the description attribute handles an
  API-defaulted scalar; state can hold the API's round_robin with no diff
- apiToModel: pass the API value straight through, settling an empty
  create-response to the round_robin default (no more empty->null)
- datasource: read the value through directly (drop the shared helper)
- tests: assert the GET-returns-round_robin refresh path yields no
  post-apply diff, the empty create-response settles to the default, and
  the schema attribute is Optional+Computed

Removed the now-unused stringOrNull helper.
2026-08-13 19:27:49 +10:00
unkin-agent c69c3d9f74 resource_remote: add mirror_strategy attribute
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The provider exposed mirrorlist but not mirror_strategy, so the API's
mirror load-balancing strategy (round_robin/least_conn) was unreachable
via Terraform. Add mirror_strategy the same way mirrorlist was added,
scoped to rpm/deb/alpine remotes.

- schema: optional string mirror_strategy on the remote resource
- ValidateConfig: reject on non-rpm/deb/alpine types and validate the
  round_robin/least_conn enum at plan time
- wire model + modelToAPI/apiToModel (empty->null to avoid perpetual diff)
- datasource (computed) + README + rpm example
- unit tests: modelToAPI/apiToModel round-trip and ValidateConfig matrix
2026-08-13 17:50:52 +10:00
benvin bc13e7372d Merge pull request 'resource_remote: add mirrorlist attribute (rpm/deb/apk remotes)' (#18) from benvin/mirrorlist into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #18
v0.5.0
2026-08-13 17:24:58 +10:00
unkin-agent cd49af0f94 go.mod: promote terraform-plugin-go to a direct dependency
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The mirrorlist ValidateConfig test imports terraform-plugin-go/tftypes
directly to build a tfsdk.Config, so `go mod tidy` moves it from an
indirect to a direct require. Commit the tidied go.mod so the CI
go-mod-tidy pre-commit hook is green.
2026-08-13 16:22:29 +10:00
unkin-agent 9ed7f07463 resource_remote: add mirrorlist attribute (rpm/deb/apk remotes)
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed
Expose the artifactapi remotes API's new mirrorlist field so users can
configure extra upstream mirror base URLs. The API load-balances
base_url + mirrorlist with failover.

- Add optional mirrorlist list attribute to the remote resource schema
  and the remote data source (read-only).
- Wire it end-to-end: TF model, wire model (json mirrorlist,omitempty),
  modelToAPI/apiToModel, and preserve null/empty list semantics to avoid
  plan churn.
- Scope to rpm/deb/alpine via ValidateConfig (plan-time error on other
  remote types); API 400 is the backstop.
- Docs + rpm example; unit tests for round-trip, null handling, and the
  type-scoping validation.
2026-08-13 16:16:49 +10:00
benvin 0879921398 Merge pull request 'Add artifactapi_remote_github_alpine resource' (#17) from benvin/apk-github into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #17
v0.4.0
2026-08-12 20:49:57 +10:00
unkin-agent 719b0dd502 Add artifactapi_remote_github_alpine resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Adds the metadata-only Alpine/apk analog of the github_deb/github_rpm
remotes: exposes a GitHub repo's release .apk assets as an apk repository
(synthesized APKINDEX) without precaching, redirecting downloads to a
backing releases_remote.

- register newRemoteResource("github_alpine") in provider Resources()
- add NewRemoteGitHubAlpine convenience ctor
- extend provider/metadata/ctor table tests + bump resource count to 22
- document github_alpine remote type in README
- add examples/resources/artifactapi_remote_github_alpine/main.tf
2026-08-12 20:42:10 +10:00
benvin 8d2e0ef27d Merge pull request 'Add artifactapi_local_alpine resource' (#16) from benvin/apk-local into main
Reviewed-on: #16
2026-08-12 20:41:03 +10:00
unkin-agent cb1110c723 Add artifactapi_local_alpine resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Adds a local Alpine/apk repository resource mirroring the existing
artifactapi_local_deb and artifactapi_local_rpm locals, so Alpine
package registries can be managed directly via Terraform.

- add localAlpineResource (PackageType alpine, RepoType local) with
  CRUD + import passthrough and model<->API mappers
- register NewLocalAlpineResource in provider Resources()
- bump provider_test resource count to 21 and expected type list
- add local unit tests and README/example entries
2026-08-12 00:52:33 +10:00
benvin b8c18690ef Merge pull request 'Add artifactapi_remote_github_deb resource' (#15) from benvin/deb-github-metadataonly into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #15
v0.3.0
2026-08-11 23:52:45 +10:00
unkin-agent 25b72fd1ac Add artifactapi_remote_github_deb resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Add the metadata-only Debian/apt analog of artifactapi_remote_github_rpm,
exposing a GitHub repo's release .deb assets as a synthesized apt repository
with downloads redirected to a backing releases_remote.

- Register newRemoteResource("github_deb") and add NewRemoteGitHubDeb ctor
- Bump provider resource count 19 -> 20 and add the type name to test lists
- Add modelToAPI/metadata/constructor test coverage for github_deb
- Document github_deb in README and add an examples/ main.tf (goodtune/ghp)
2026-08-11 23:43:31 +10:00
benvin 5ee3a1d3d6 Merge pull request 'Add artifactapi_local_deb and artifactapi_remote_deb resources' (#14) from benvin/deb-local-remote into main
Reviewed-on: #14
2026-08-11 23:41:33 +10:00
unkin-agent b21892217a Add artifactapi_local_deb and artifactapi_remote_deb resources
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
2026-08-11 21:50:20 +10:00
benvin 2d8584f103 Merge pull request 'feat: add artifactapi_remote_github_rpm resource' (#13) from benvin/github-rpm-remote into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #13
v0.2.0
2026-08-10 21:08:50 +10:00
unkinben b26e651d45 feat: add artifactapi_remote_github_rpm resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The artifactapi server gains a github_rpm remote type that exposes a GitHub
repo's releases as a metadata-only yum repository (synthesized repodata, no
precache, downloads redirected to a backend remote). Surface it through the
provider so these remotes are declarable as code alongside the other types.

- Register the github_rpm remote resource (artifactapi_remote_github_rpm),
  reusing the shared remoteResource plumbing; add the NewRemoteGitHubRPM
  constructor to match its siblings.
- Generalize the releases_remote attribute description: it now names the
  backend remote that serves download bytes for both the terraform remote
  (URL rewriting) and the github_rpm remote (302 redirect of .rpm downloads).
- Document the type and add an example wiring a github_rpm remote to a generic
  github.com releases_remote.

Tests cover the resource metadata type name, the constructor, and mapping of
package_type/base_url/releases_remote/patterns through the API model; the
resource-count and expected-types assertions are updated.

Depends on the github_rpm API surface in artifactapi (separate PR). Cut a
minor release (make minor) once merged.
2026-08-10 20:57:26 +10:00
benvin c7a2416518 Merge pull request 'Add artifactapi_local_generic resource' (#12) from benvin/local-generic into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #12
v0.1.4
2026-07-29 23:52:46 +10:00
unkinben 14b7c4bdcd Add artifactapi_local_generic resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Adds a local generic (raw-file) repository resource so arbitrary binaries -- the
bootapi node rootfs tarballs -- can be hosted on artifactapi and managed in
Terraform. The backend already serves generic locals; only the provider surface
was missing.

- resource_local_generic.go: local repo with package_type=generic (mirrors
  local_rpm), registered in the provider.
- Tests + example.

Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
2026-07-29 21:48:47 +10:00
benvin a232a26bf5 Merge pull request 'feat: add artifactapi_local_docker resource' (#11) from benvin/local-docker into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #11
v0.1.3
2026-07-05 16:56:47 +10:00
unkinben 30b414141a feat: add artifactapi_local_docker resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The artifactapi server now serves local docker repos as real container
registries, but the provider had no resource to declare one — only remote
docker proxies and local terraform/pypi/rpm repos.

- Add the artifactapi_local_docker resource (package_type=docker,
  repo_type=local), mirroring the other local resources: name + description,
  managed via /api/v2/remotes.
- Register it in the provider and update the resource-count/type tests.
- Add unit tests, an example, and a Local Resources section to the README.
2026-07-04 22:37:10 +10:00
benvin b149e1bf9d Merge pull request 'Align release pipeline with the standard mechanism' (#10) from benvin/release-backend-options into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #10
v0.1.2
2026-07-03 15:13:07 +10:00
unkinben f82a9900a9 Add kubernetes backend options to build and test steps
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Give the build/lint/test CI steps the same serviceAccount + resource
requests/limits as the pre-commit and release steps, so every step on the k8s
woodpecker backend is scheduled with bounded resources.
2026-07-03 15:05:00 +10:00
unkinben 7d7cbde0bf Align release pipeline with the standard mechanism
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Match terraform-provider-litellmvaultsecret's release flow so both providers
publish the same way.

- Point the upload at the reachable artifactapi host
  (artifactapi.k8s.syd1.au.unkin.net) instead of the unresolvable artifactapi3
- Add kubernetes backend options (serviceAccount + resource requests/limits) to
  the package and upload steps
- Make the upload step explicitly depend_on the package step
2026-07-03 15:01:10 +10:00
benvin 0561bae10e Merge pull request 'feat: support per-remote upstream timeouts' (#9) from benvin/remote-upstream-timeouts into main
ci/woodpecker/tag/release Pipeline failed
Reviewed-on: #9
v0.1.1
2026-07-02 22:23:04 +10:00
unkinben 4dd290518d feat: support per-remote upstream timeouts
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Add upstream_dial_timeout, upstream_tls_timeout and
upstream_response_header_timeout (seconds; 0 = server default) to the
remote resource and data source, matching the artifactapi server. Wire
them through the API model, schema, create/read/update mapping, docs and
unit tests.
2026-07-02 22:19:39 +10:00
benvin 0b4db409b0 Merge pull request 'feat: add artifactapi_local_pypi and artifactapi_local_rpm resources' (#8) from benvin/add-local-pypi-rpm-resources into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #8
v0.1.0
2026-06-23 23:21:56 +10:00
unkinben 1bddc48e5a feat: add artifactapi_local_pypi and artifactapi_local_rpm resource types
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
2026-06-23 23:16:17 +10:00
benvin 4dcb3ac71a Merge pull request 'fix: escape shell variables in release pipeline' (#7) from benvin/fix-release-vars into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #7
v0.0.6
2026-06-23 00:42:40 +10:00
unkinben eeb4a60639 fix: escape shell variables in release pipeline
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
Woodpecker interpolates ${VERSION} as a CI variable (empty) before the
shell sees it. Use $$ escaping so the shell assignment and references
survive YAML interpolation.
2026-06-23 00:39:21 +10:00
benvin 41ef83ba34 Merge pull request 'fix: use python3 zipfile instead of zip binary' (#6) from benvin/fix-zip-packaging into main
ci/woodpecker/tag/release Pipeline failed
Reviewed-on: #6
v0.0.5
2026-06-23 00:35:50 +10:00
unkinben 3d5154a12a fix: use python3 zipfile instead of zip binary for packaging
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
The almalinux9-gobuilder image doesn't have the zip binary and dnf
install is unreliable in CI. python3 is always available.
2026-06-23 00:31:53 +10:00
benvin ec9f7d410f Merge pull request 'feat: add zip packaging target and woodpecker release pipeline' (#5) from benvin/makefile-ci-upload into main
ci/woodpecker/tag/release Pipeline failed
Reviewed-on: #5
v0.0.4
2026-06-23 00:21:30 +10:00
unkinben 03b3344d8f feat: add zip packaging target and woodpecker release pipeline
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
2026-06-23 00:18:06 +10:00
benvin 2dfbd1d799 Merge pull request 'feat: add artifactapi_local_terraform resource type' (#4) from benvin/add-local-terraform-resource into main
Reviewed-on: #4
v0.0.3
2026-06-23 00:02:39 +10:00
benvin ddd9e41679 Merge branch 'main' into benvin/add-local-terraform-resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
2026-06-22 23:59:16 +10:00
unkinben 2653c34f94 feat: add artifactapi_local_terraform resource type
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
New resource for creating local terraform registries in ArtifactAPI
(repo_type=local, package_type=terraform). These repos host providers
directly rather than proxying an upstream registry.

Schema is minimal: just name and description — no upstream-specific
fields like base_url, caching TTLs, or auth.
2026-06-22 23:30:21 +10:00
benvin e6d58ac2ee Merge pull request 'fix: strip v prefix from version in make install path' (#3) from benvin/fix-make-install-version into main
Reviewed-on: #3
2026-06-21 22:34:39 +10:00
unkinben 3d776f9e0f feat: add pre-commit to build jobs
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ensure pre-commit is run by woodpecker in ci
2026-06-21 22:31:28 +10:00
unkinben d2da94cb52 fix: pul_request tests only
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
- update tests to run on pull request only
2026-06-21 22:16:59 +10:00
unkinben 6446997a12 fix: strip v prefix from version in make install path
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
Terraform plugin directory expects bare version numbers (e.g. 0.0.2)
but git tags use v-prefixed versions (e.g. v0.0.2).
2026-06-21 22:07:47 +10:00
benvin 0ec5b80682 Merge pull request 'feat: add tag bumping features' (#2) from benvin/tag_bumping into main
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
Reviewed-on: #2
v0.0.2
2026-06-21 18:58:12 +10:00
unkinben 40aa86bc68 feat: add tag bumping features
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
enable the use of make minor, major and patch to automatically bump
tagged releases
2026-06-21 18:55:30 +10:00
benvin a626d29aff Merge pull request 'fix: preserve empty list vs null for optional list attributes' (#1) from benvin/fix-empty-list-null-inconsistency into main
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
Reviewed-on: #1
2026-06-21 18:51:31 +10:00
unkinben d9d8cc7b6d fix: preserve empty list vs null distinction for optional list attributes
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
The API returns null for empty arrays, but OpenTofu requires that the
state match the plan exactly — an empty list [] in the plan must remain
[] in the state, not become null. This caused "inconsistent result after
apply" errors on every resource with empty optional list fields like
mutable_patterns and ban_tags.
2026-06-21 18:42:14 +10:00
unkinben 7c94f06be6 docs: add README, per-resource examples, unit tests, CI, and pre-commit
- Add README.md with provider docs, resource/data-source reference, and
  development instructions
- Reorganize examples into per-resource-type subdirectories following
  Terraform provider conventions, add missing pypi/npm/puppet examples
- Add unit tests for helpers, HTTP client, model conversions, and
  provider registration
- Add Woodpecker CI pipelines for lint, test, and build
- Add pre-commit config with standard and Go-specific hooks
2026-06-07 18:55:48 +10:00
unkinben 31057182aa fix: include all optional fields in schema for all resource types 2026-06-07 16:47:03 +10:00
unkinben 1405675e8f docs: update example to use per-type resources 2026-06-07 16:42:31 +10:00
unkinben e1336c0c87 refactor: per-type resources + simplified classification model
Resources renamed from artifactapi_remote to per-type:
- artifactapi_remote_generic
- artifactapi_remote_docker (with ban_tags)
- artifactapi_remote_helm
- artifactapi_remote_pypi
- artifactapi_remote_npm
- artifactapi_remote_rpm
- artifactapi_remote_alpine
- artifactapi_remote_puppet
- artifactapi_remote_terraform (with releases_remote)
- artifactapi_remote_goproxy

Classification simplified:
- patterns: paths to proxy (empty = all, acts as allowlist)
- blocklist: paths to deny (checked first)
- mutable_patterns: override provider auto-classification
- immutable_patterns: override provider auto-classification
- Provider handles mutability automatically per package type
2026-06-07 16:12:11 +10:00
unkinben ad50a06b33 feat: initial terraform provider for artifactapi v0.0.1
Resources:
- artifactapi_remote: CRUD for remote proxy repositories
- artifactapi_virtual: CRUD for virtual (merged) repositories

Data sources:
- data.artifactapi_remote: read remote config
- data.artifactapi_virtual: read virtual config

Supports all 10 package types (generic, docker, helm, pypi, npm,
rpm, alpine, puppet, terraform, goproxy), allowlist/blocklist,
tag banning, quarantine, and terraform import.
2026-06-07 14:30:20 +10:00