Thanks for your interest in contributing. This provider is maintained on a best-effort basis with AI assistance (see the status callout in the README). Pull requests and issues are welcome, but reviews may take time.
This project pins exact tool versions in .tool-versions so local
development and CI resolve the same binaries from a single source.
golang 1.26.3
terraform 1.15.2
golangci-lint 2.12.2
pre-commit 4.2.0
asdf reads .tool-versions directly; CI's
actions/setup-go@v6 reads go-version-file: 'go.mod', which agrees
with .tool-versions. Install asdf and the relevant plugins, then:
asdf install
go mod download
pre-commit installDo not bypass asdf (e.g. Homebrew, GVM) — divergent toolchain
versions produce hard-to-debug failures.
The repo uses Task (Taskfile.yml):
task lint—golangci-lintv2 (tests excluded; see.golangci.yml)task test— unit tests, fasttask testacc— acceptance tests against a Dockerized SemaphoreUI (orchestratesdocker compose up, seeds an API token directly into the MySQLuser__tokentable, runs the suite, tears down)task generate— regeneratesdocs/viatfplugindocs; CI fails if the diff is non-empty
Run a single acceptance test:
SEMAPHORE_VERSION=v2.18.6 task testacc -- -run TestAcc_ProjectResource_basicTests prefixed TestAcc_ require the live API. The matrix in
.github/workflows/test.yml exercises the three most recent SemaphoreUI
minor lines.
Bug fixes and feature PRs should lead with a failing test. Structure your commits so the PR history reads:
- First commit — adds an acceptance test (or unit test) that reproduces the bug or asserts the new feature's behavior. CI should fail on this commit alone.
- Subsequent commits — the fix or implementation, with the test flipping from red to green.
For issue reports: include a minimal Terraform config that
reproduces the problem and the exact terraform apply output. Issues
with reproducible repro steps are triaged first.
The failing-test-first requirement does not apply to:
- Documentation-only changes (
README.md,docs/**,CLAUDE.md,CONTRIBUTING.md). - CI / workflow changes (
.github/**). - Dependency updates (Dependabot PRs, manual
go getbumps). - Generated-code changes (
semaphoreui/client/**,semaphoreui/models/**) — these come fromtask clientand should always be accompanied by the matchingapi-docs.ymlchange.
Releases are managed by
release-please, which
parses Conventional Commit
messages to compute version bumps and assemble the changelog. The
GitHub Actions title check (amannn/action-semantic-pull-request)
enforces the format on every PR.
Common prefixes:
feat:— new resource, new attribute, or other user-visible featurefix:— bug fixchore:/ci:/docs:— no user-visible changefeat!:/fix!:or aBREAKING CHANGE:footer — major-version bump
The SemaphoreUI API client is generated from api-docs.yml. When the
upstream API changes, bump api-docs.yml and regenerate:
# Install go-swagger if missing
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
# Regenerate semaphoreui/client/ and semaphoreui/models/
task client
# Run lint + acceptance tests against each matrix version
task lint
SEMAPHORE_VERSION=v2.16.51 task testacc
SEMAPHORE_VERSION=v2.17.39 task testacc
SEMAPHORE_VERSION=v2.18.6 task testaccThe local api-docs.yml is a patched copy of upstream. When
re-importing from a new upstream tag, do the import as a discrete
commit first, then apply nullability patches as a follow-up commit
based on which acceptance tests fail. This keeps the diff legible —
reviewers can see what came from upstream versus what we patched
locally. The current re-applied patches are documented in
CLAUDE.md.
Each Terraform type follows a three-file convention in
internal/provider/:
<name>_schema.go—<Name>Modelstruct +<Name>Schema()returning asuperschema.Schema(one definition, both resource and data-source variants viaResource:/DataSource:/Common:overrides).<name>_resource.go—resource.Resourceimplementation (Configure,Schema,Create,Read,Update,Delete,ImportState).<name>_data_source.go—datasource.DataSourceimplementation.
A new resource requires:
- Schema + resource + (optional) data source files.
- Registration in
provider.goResources()/DataSources(). - An
examples/resources/<name>/directory withresource.tfandimport.sh. - Acceptance tests (
<name>_resource_test.go) following the existing patterns (seeproject_inventory_resource_test.gofor a thorough example). task generateto produce the matchingdocs/page.
By contributing, you agree that your contributions will be licensed under this repo's LICENSE.