Skip to content

chore: adopt Data Services Versioning Standard#680

Merged
jirhiker merged 7 commits into
stagingfrom
chore/adopt-versioning-standard
Jun 3, 2026
Merged

chore: adopt Data Services Versioning Standard#680
jirhiker merged 7 commits into
stagingfrom
chore/adopt-versioning-standard

Conversation

@jirhiker

@jirhiker jirhiker commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Adopt the Data Services Versioning Standard on OcotilloAPI. Wires release-please + tag-triggered deploy per spec §§5–10.

  • Bump pyproject.toml to 1.0.0, add .release-please-manifest.json + release-please-config.json.
  • Add release-please workflow watching production and hotfix/v*.
  • Add hotfix-start workflow (workflow_dispatch) that branches hotfix/vX.Y.(Z+1) off the latest (or specified) v*.*.* tag.
  • Add PR title lint (Conventional Commits).
  • Retarget CD (Production) to fire on v*.*.* tag push (no more push-to-branch deploys); drop the self-tagging step; inject APP_VERSION into App Engine env.
  • Surface version: Settings.version reads APP_VERSION env, falls back to importlib.metadata.version("OcotilloAPI"). Public OpenAPI uses settings.version (was hardcoded 0.0.1). New /health returns {status, version}.
  • Remove obsolete Sentry release workflow.

Why

Implements the Data Services Versioning Standard. Pins the public contract at 1.0.0 so SemVer rules engage going forward.

Release flow after merge

  1. Merge this PR to staging (CD Staging deploys to staging env as usual).
  2. Open separate staging -> production promotion PR when ready to cut 1.0.0.
  3. On merge to production, release-please opens a Release PR titled chore(production): release 1.0.0.
  4. Merge the Release PR -> v1.0.0 tag + GitHub Release created automatically.
  5. Tag push fires CD (Production) -> Alembic migrations + App Engine deploy.

Follow-up (manual, not in this PR)

  • Apply branch protection on production (required reviews + status checks). Squash-only merge is already enforced at the repo level.

Test plan

  • CI: pr-title-lint passes.
  • CI: unit-tests / bdd-tests pass against the new /health endpoint + settings.version change.
  • Local: curl localhost:8000/health returns {"status":"ok","version":"1.0.0"}.
  • After staging deploy: hit the staging /health and confirm version field present.
  • After staging -> production promotion: release-please Release PR appears on production.
  • After Release PR merge: v1.0.0 tag exists, CD (Production) succeeds, prod /health returns the tagged version.

🤖 Generated with Claude Code

- Bump pyproject version to 1.0.0 + add release-please manifest/config
- Add release-please workflow (watches production + hotfix/v* branches)
- Add hotfix-start workflow (workflow_dispatch creates hotfix/vX.Y.Z+1 off a release tag)
- Add PR title lint workflow (Conventional Commits)
- Retarget CD (Production) to fire on v*.*.* tag (no more push-to-branch deploys); drop self-tagging step; pass APP_VERSION through to App Engine env
- Surface APP_VERSION via Settings.version (env override -> importlib.metadata fallback) and add /health endpoint returning version
- Use settings.version for public OpenAPI schema (was hardcoded 0.0.1)
- Remove Sentry release workflow

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 3, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the Data Services Versioning Standard for OcotilloAPI by introducing release automation (release-please), switching production deploys to tag-driven releases, and surfacing the runtime application version via settings/OpenAPI and a new health endpoint.

Changes:

  • Add release-please configuration + workflow, plus a hotfix branch creation workflow and PR title Conventional Commits linting.
  • Retarget production CD to deploy on v*.*.* tag pushes, inject APP_VERSION into App Engine, and remove the obsolete Sentry release workflow.
  • Surface version consistently (Settings.version, public OpenAPI version, /health endpoint) and update org lexicon entries; bump a few Python dependencies.

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
uv.lock Bumps pinned dependency versions in the lockfile.
requirements.txt Updates hashed pins to match dependency bumps.
pyproject.toml Bumps project version to 1.0.0 and updates dependency pins.
release-please-config.json Adds release-please configuration for Python releases with v tags.
.release-please-manifest.json Introduces the manifest pinning the current release version.
.github/workflows/release-please.yml Adds release-please workflow for production and hotfix/v* branches.
.github/workflows/pr-title-lint.yml Adds PR title lint enforcing Conventional Commits for squash merges.
.github/workflows/hotfix-start.yml Adds workflow_dispatch helper to create hotfix/vX.Y.(Z+1) branches from tags.
.github/workflows/CD_production.yml Switches prod deploy trigger to semver tag pushes; injects APP_VERSION; removes self-tagging.
.github/app.template.yaml Adds APP_VERSION env var to deployed App Engine configuration.
.github/workflows/release.yml Removes obsolete Sentry release workflow.
core/settings.py Resolves version from APP_VERSION or package metadata (fallback 0.0.0).
core/app.py Uses settings.version in public OpenAPI and adds /health returning {status, version}.
api/search.py Improves contact search label fallback (nameorganization).
core/lexicon.json Adds several new organization terms.
.env.example Adds example PyGeoAPI Postgres credentials variables.
transfers/migrate_nmbgmr_site_names.py Adds one-time idempotent migration script to populate NMBGMR site names into ThingIdLink.

Comment thread pyproject.toml
Comment thread transfers/migrate_nmbgmr_site_names.py
Comment thread core/app.py
@jirhiker jirhiker changed the base branch from production to staging June 3, 2026 00:23
jirhiker and others added 2 commits June 2, 2026 18:26
uv sync --locked compares lockfile project metadata to pyproject.toml;
mismatched version (lock pinned 0.1.0 vs pyproject 1.0.0) would fail CI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ning-standard

# Conflicts:
#	.github/workflows/release.yml
Copilot AI review requested due to automatic review settings June 3, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/hotfix-start.yml Outdated
Comment thread .github/app.template.yaml
Comment thread core/app.py
jirhiker and others added 2 commits June 2, 2026 18:36
- release-please-config.json: set "prerelease": true and "prerelease-type": "rc" on the root package so the next Release PR cuts 1.0.0rc1; subsequent cuts roll rc2, rc3, etc. Flip to false to graduate to 1.0.0 GA.
- CD_production.yml: extend tag trigger to also match SemVer prerelease tags (v*.*.*-*) and PEP 440 prerelease tags (v*.*.*[a-z]*) so v1.0.0rc1 fires the deploy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 00:52
app.template.yaml requires APP_VERSION via envsubst; previously only the
production workflow supplied it, so staging/testing deploys would render an
empty value and Settings.version would fall back to importlib.metadata.
That fallback also fails because uv export --no-emit-project skips installing
the project, so /health and OpenAPI info.version were both reporting "0.0.0"
on non-prod App Engine services.

Sets APP_VERSION to "{branch}-{sha}" for staging + testing — unambiguous,
sortable, and not mistakable for a release tag.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Comment on lines +23 to +27
".": {
"package-name": "OcotilloAPI",
"prerelease": true,
"prerelease-type": "rc"
}
Comment thread core/settings.py Outdated
Comment thread core/app.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 00:56
@jirhiker jirhiker merged commit f0e9ec9 into staging Jun 3, 2026
10 checks passed
@jirhiker jirhiker deleted the chore/adopt-versioning-standard branch June 3, 2026 00:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Comment on lines +23 to +27
".": {
"package-name": "OcotilloAPI",
"prerelease": true,
"prerelease-type": "rc"
}
Comment thread core/app.py
Comment on lines +221 to +224
@app.get("/health", tags=["meta"])
@public_route
async def health():
return {"status": "ok", "version": settings.version}
Comment on lines +34 to +36
if [ -z "$BASE" ]; then
BASE="$(git tag --list 'v*.*.*' --sort=-v:refname | head -n1)"
fi
Comment on lines +5 to +8
tags:
- 'v*.*.*' # GA releases: v1.0.0, v1.4.2
- 'v*.*.*-*' # SemVer pre-releases: v1.0.0-rc.1
- 'v*.*.*[a-z]*' # PEP 440 pre-releases: v1.0.0rc1, v1.0.0b2 (release-please-python form)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants