This document describes the automated release process for the Terraform Provider Couchbase Capella.
Releases are semi-automated using the make release-prep command, which:
- Generates the changelog from GitHub PRs
- Creates an upgrade guide scaffold
- Builds the documentation
The actual release is triggered automatically via GitHub Actions when a tag is pushed.
# Ruby gem for changelog generation
gem install github_changelog_generatorFor the best results with automatic content extraction:
# Python with PyGithub for intelligent PR analysis
pip install PyGithub
# Set GitHub token for API access (avoids rate limiting)
export GITHUB_TOKEN="your_github_token_here"With PyGithub installed, you get:
- Automatic extraction of PR descriptions
- Code example detection and inclusion
- New resource/data source detection
- Deprecation detection
- PR quality validation
- 80%+ complete upgrade guides (vs 30% without)
Without PyGithub:
- Falls back to basic bash scripts
- Creates simple scaffolds with TODOs
- Still works, just requires more manual editing
To create a GitHub token:
- Go to https://github.com/settings/tokens
- Generate a new token (classic)
- Select scope:
repo(for private repos) orpublic_repo - Copy the token and set it as an environment variable
Always edit files in templates/guides/, never in docs/guides/
templates/guides/- SOURCE files (you edit these)docs/guides/- GENERATED files (auto-created bymake build-docs)
The workflow:
- Scripts create upgrade guides in
templates/guides/X.Y.Z-upgrade-guide.md - You edit the file in
templates/guides/ - Run
make build-docsto copytemplates/→docs/ - Commit both
templates/anddocs/directories
Why? The tfplugindocs tool generates documentation from schema definitions and copies custom content from templates/ to docs/. If you edit docs/ directly, your changes will be overwritten next time docs are built.
# Prepare release artifacts for version 1.5.4
make release-prep VERSION=1.5.4
# This will:
# 1. Update .github_changelog_generator config with enhanced categorization
# 2. Generate CHANGELOG.md from GitHub PRs
# 3. Validate PR quality (checks labels, descriptions, etc.)
# 4. Generate upgrade guide with auto-extracted content:
# - PR descriptions
# - Code examples from PR bodies
# - New resource detection
# - Deprecation detection
# 5. Build documentation (copies to docs/)-
Review the changelog:
# Check CHANGELOG.md for accuracy git diff CHANGELOG.md -
(Optional) Edit the upgrade guide:
# Edit the scaffold with real content (replace <VERSION> with your version, e.g., 1.7.0) vim templates/guides/<VERSION>-upgrade-guide.md
Add:
- Detailed feature descriptions
- Code examples for new features
- Migration steps for breaking changes
- Bug fix details
-
(Optional) Test examples:
# Test any code examples in the upgrade guide cd examples/feature_name terraform init && terraform plan
-
(Optional) Rebuild docs:
# After editing templates, rebuild docs make build-docs
Note: Replace
<VERSION>with your actual version number (e.g.,1.7.0)
# Create a new branch for the release
git checkout -b release/v<VERSION>
# Commit all changes
git add .
git commit -m "Prepare release v<VERSION>"
# Push the branch
git push origin release/v<VERSION>Example for version 1.7.0:
git checkout -b release/v1.7.0
git add .
git commit -m "Prepare release v1.7.0"
git push origin release/v1.7.0Open a Pull Request for review on GitHub.
After the PR is reviewed and approved:
Note: Replace
<VERSION>with your actual version number (e.g.,1.7.0)
# Merge the PR to main (via GitHub UI or CLI)
gh pr merge release/v<VERSION> --merge
# Switch to main and pull the latest changes
git checkout main
git pull origin main
# Create and push the tag from main branch
git tag v<VERSION>
git push origin v<VERSION>
# GitHub Actions will automatically:
# - Build binaries
# - Create GitHub release
# - Upload to Terraform RegistryExample for version 1.7.0:
gh pr merge release/v1.7.0 --merge
git checkout main
git pull origin main
git tag v1.7.0
git push origin v1.7.0- Check GitHub Actions workflow: https://github.com/couchbasecloud/terraform-provider-couchbase-capella/actions
- Verify release: https://github.com/couchbasecloud/terraform-provider-couchbase-capella/releases
- Check Terraform Registry: https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest
Use this command to display the full checklist:
make release-checklistIf you prefer not to use the automation or it's unavailable:
Edit .github_changelog_generator:
future-release=v1.5.4
since-tag=v1.5.3
exclude-labels=no-changelog-needed
date-format=%Y-%m-%d
base=CHANGELOG.md
github-changelog-generator --token $GITHUB_TOKEN# Create the file
touch templates/guides/1.5.4-upgrade-guide.md
# Add content based on template structure
# See existing guides for examplesmake build-docs# Install the gem
gem install github_changelog_generator
# Or on macOS with homebrew
brew install github_changelog_generator# Set a GitHub token to increase rate limits
export GITHUB_TOKEN="your_token_here"
# Then re-run the release prep
make release-prep VERSION=1.5.4# For enhanced upgrade guide generation
pip install PyGithub
# Or use the basic bash version (it will fall back automatically)# Manually specify previous version
bash scripts/generate-changelog.sh v1.5.4 v1.5.3
bash scripts/generate-upgrade-guide.sh 1.5.4 v1.5.3When creating an upgrade guide, use this structure:
---
layout: "couchbase-capella"
page_title: "Couchbase Capella Provider X.Y.Z: Upgrade and Information Guide"
sidebar_current: "docs-couchbase-capella-guides-XYZ-upgrade-guide"
description: |-
Couchbase Capella Provider X.Y.Z: Upgrade and Information Guide
---
# Couchbase Capella Provider X.Y.Z: Upgrade and Information Guide
## New Features
* Feature name [`resource_name`](link)
- Brief description
- Code example
## Bug Fixes
* Brief description [#PR](link)
## Breaking Changes
If none:
There are no breaking changes as part of this release.
If any:
WARNING: **ACTION REQUIRED**
* Change description
* Migration steps
## Changes
List deprecations and other changes.
### Helpful Links
- [Getting Started](link)
- [API Reference](link)
- [Examples](link)For best results with automated changelog generation, ensure all PRs have proper labels:
enhancementorfeature- New featuresbugorbugfix- Bug fixesbreaking-change- Breaking changesdocumentation- Documentation updatesno-changelog-needed- Skip in changelog (internal changes)
Use conventional commit messages for clarity:
[AV-12345] Add support for feature X
[AV-12346] Fix bug in resource Y
[AV-12347] BREAKING: Remove deprecated field Z
Before releasing:
- Run all tests:
make test - Run acceptance tests:
make testacc - Run linters:
make check - Test examples in upgrade guide
Follow Semantic Versioning:
- MAJOR (X.0.0): Breaking changes
- MINOR (0.X.0): New features (backwards compatible)
- PATCH (0.0.X): Bug fixes (backwards compatible)
The generate-changelog.sh script creates a comprehensive changelog with:
- Automatic PR categorization (features, bugs, breaking changes, etc.)
- Links to PRs and issues
- Author attribution
- Filtered by labels (excludes dependencies, no-changelog-needed)
The enhanced generate-upgrade-guide.py script automatically:
- Extracts Descriptions - Parses PR bodies for feature descriptions
- Finds Code Examples - Detects Terraform code blocks in PR descriptions
- Detects Resources - Scans file changes for new resources/data sources
- Auto-links - Creates links to Terraform Registry and examples
- Finds Deprecations - Detects deprecated fields mentioned in PRs
- Validates Quality - Checks PR labels and descriptions
Example Output (matching existing template):
For feature releases, you get:
Here is a list of what's new in 1.5.4
## New Features
* Create and manage free tier clusters with [`couchbase-capella_free_tier_cluster`](registry_link)
* Turn clusters on/off on demand with [`couchbase-capella_cluster_onoff_ondemand`](registry_link)
## Changes
There are no deprecations as part of this release.
1.5.4 includes new features and general improvements. See the [CHANGELOG](...) for more specific information.
* Manage Free Tier Cluster [`couchbase-capella_free_tier_cluster`](registry_link)
## Managing Free Tier Clusters
Use the new free_tier_cluster resource to create and manage free tier operational clusters...
resource "couchbase-capella_free_tier_cluster" "example" { organization_id = var.organization_id ... }
For more information, see the [examples for free_tier_cluster](examples_link)
The format matches your existing upgrade guides in docs/guides/.
The validate-prs.py script checks:
- All PRs have appropriate type labels
- PRs have meaningful descriptions
- Feature PRs include code examples
- Breaking changes are properly labeled
- Ticket references are present