Keep the schema check honest across a version bump
build / build (push) Successful in 10m48s

The build job regenerates schema.json and diffs it against the checked-in
copy, to catch a resources.go edit that never got a `make tfgen`. The comment
above it claimed the schema carries no version. It does: tfgen writes the
upstream version into `packageDescription`.

So the job, which builds at the Makefile's default VERSION, regenerated a
schema stamped v0.1.0 and diffed it against the committed v0.2.0 one. The
v0.2.0 push failed on a mismatch that had nothing to do with the mapping.

Bump the default to match the committed schema and say plainly in both places
that the two move together. Verified by running the job's exact command --
`make provider` with no override, then the diff -- which now exits 0.

The release job was unaffected: it derives VERSION from the tag.
This commit is contained in:
max-voitcov
2026-08-26 01:32:04 +03:00
parent 73386ba0ff
commit 466e162efe
2 changed files with 14 additions and 5 deletions
+8 -3
View File
@@ -64,9 +64,14 @@ jobs:
working-directory: pulumi-dokploy
run: make provider
# schema.json and bridge-metadata.json are checked in and carry no
# version, so they only change when the mapping does. A diff here means
# someone edited resources.go without re-running `make tfgen`.
# schema.json and bridge-metadata.json are checked in, so a diff here
# means someone edited resources.go without re-running `make tfgen`.
#
# schema.json *does* carry the upstream version, in `packageDescription`,
# and this job builds at the Makefile's default VERSION. So the default
# has to be bumped in the same commit that regenerates the schema for a
# release, or this step fails on a mismatch that has nothing to do with
# the mapping. That is exactly how it failed for v0.2.0.
- name: Fail if the checked-in schema is stale
working-directory: pulumi-dokploy
run: git diff --exit-code -- provider/cmd/pulumi-resource-dokploy/schema.json
+6 -2
View File
@@ -10,8 +10,12 @@ PROVIDER := pulumi-resource-$(PACK)
WORKING_DIR := $(shell pwd)
SCHEMA_DIR := $(WORKING_DIR)/provider/cmd/$(PROVIDER)
# Override on the command line for a release build, e.g. `make build VERSION=0.2.0`.
VERSION ?= 0.1.0
# The checked-in schema.json embeds this version in `packageDescription`, and
# CI diffs the regenerated schema against it on every push to main. So this
# default is not cosmetic: it has to match the version the committed schema was
# generated at, which means bumping it in the same commit as a release.
# Release builds override it from the tag.
VERSION ?= 0.2.0
LDFLAGS := -X $(PROJECT)/$(VERSION_PATH)=$(VERSION)
JAVASCRIPT_PKG := @$(ORG)/pulumi-$(PACK)