Before You Start
See Proposing Changes for the full discussion process.Pull Request Lifecycle
1. Draft Pull Request (Optional)
Submit a draft pull request for early feedback:- Get commentary before completion
- Ask specific questions
- Request feedback on particular approaches
2. Create Pull Request
Once ready for review:- Ensure all tests pass locally
- Add changelog entry if user-facing (see below)
- Fill out the PR template completely
- Request review (don’t target specific team members)
3. Code Review
The Terraform team will review when time permits:- May ask questions about your approach
- May request changes
- May suggest alternative implementations
View pull requests as a collaboration opportunity. The team welcomes conversations about how to improve code.
4. Address Feedback
You can either:- Make requested changes
- Discuss alternative approaches if you disagree
- Have a conversation to agree on a path forward
It’s the contributor’s responsibility to address requested changes. While reviewers provide guidance, they cannot perform the coding work to get PRs mergeable.
5. Merge
Once approved:- Your PR will be merged
- The core team updates the main CHANGELOG.md
- Your change may or may not be included in the next release depending on whether it’s breaking
6. Possible Closure
Sometimes PRs are closed without merging:- Clear reasoning will be provided
- Following the recommended process reduces this likelihood
Changelog Requirements
User-Facing Changes
If your PR changes user-visible behavior, add a changelog entry.Non-User-Facing Changes
If your changes are internal only (refactoring, tests, etc.), add theno-changelog-needed label.
Creating Changelog Entries
Using changie
Use thechangie tool interactively:
- Change kind: Select the appropriate category
- Description: Short description of the change
- Issue/PR number: The GitHub issue or PR number
Change Kinds
| Kind | When to Use |
|---|---|
| NEW FEATURES | New, separate functionality added to Terraform (e.g., ephemeral resources) |
| ENHANCEMENTS | Improvements to existing functionality (e.g., new backend field, new environment variable) |
| BUG FIXES | User-facing bug fixes (e.g., crash fixes, improved errors, regression fixes) |
| NOTES | Changes unlikely to cause issues but might have edge cases (e.g., binary build changes) |
| UPGRADE NOTES | Changes requiring user action when upgrading or notable behavior changes (e.g., deprecating a backend field) |
| BREAKING CHANGES | Changes that could break valid configurations (e.g., removing a backend field, changing function behavior, stricter validation) |
Changelog File Location
Place changelog files in the.changes/v1.XX/ folder matching the version in version/VERSION.
Exception: For backported changes, use the .changes/v1.XX/ folder for the earliest backport version.
Example: If a PR is labeled 1.11-backport and 1.10-backport, create the changelog file in .changes/v1.10/ only.
Backporting PRs
PRs can be backported to previous releases for patch releases.How to Request Backport
Add backport labels to your PR:1.9-backport1.10-backport- etc.
What Happens
The PR reviewer will ensure the PR is merged into:- The
mainbranch - All labeled release branches
Backports are typically used for bug fixes and critical patches, not new features.
Getting PRs Merged Faster
1. Well-Documented
Explain in the PR description:- What: What does your change do?
- Why: Why did you make this change?
- How: How can reviewers test the new behavior?
- Screenshots or terminal output
- Before/after comparisons
- Example configurations
2. Small and Focused
Benefits of small PRs:- Easier for reviewers to understand implications
- Requires less effort and energy to review
- Gets reviewed and merged sooner
3. Passing Tests
Ensure all tests pass before requesting review:- Fix all affected tests
- Update tests to match new behavior
- Explain why test changes are necessary
4. Timely Responses
When the team requests changes:- Respond promptly
- Make requested changes in a timely manner
- Stale PRs require more work to merge later
PR Checks
Automated checks run on every PR:Contributor License Agreement (CLA)
First-time contributors must sign the CLA.Tests
- Unit tests
- Acceptance tests (when
TF_ACC=1) - All tests must pass before merging
Change Files
Automation verifies:- PRs with
no-changelog-neededlabel don’t need changelog files - PRs without the label include appropriate changelog files
Vercel
This is an internal tool that doesn’t run correctly for external contributors. The team works around this - you can ignore failures.
PR Best Practices
Commit Messages
Write clear commit messages:Code Comments
Add comments explaining:- Why: The reasoning behind non-obvious decisions
- Not what: Don’t explain what the code does (that should be clear)
Tests
Include tests that:- Cover the bug you fixed
- Cover the feature you added
- Cover edge cases
- Are readable and maintainable
Documentation
Update documentation if your change:- Adds new functionality
- Changes existing behavior
- Deprecates features
- Adds configuration options
AI Usage in Contributions
If using AI tools to assist with your contribution, follow these principles:Transparency
Disclose AI usage in your PR description:Accountability
- Human review: Review every line of AI-generated code
- Deep understanding: Be able to explain all code in your own words
- Human ownership: Understand logic, implications, and side effects
Quality
- Verify AI output for correctness
- Adhere to Terraform’s style guidelines
- Ensure thoughtful architecture
- Avoid low-effort, copy-pasted submissions
Communication Tips
Be Patient
The Terraform team cannot always respond promptly to PRs, especially those not related to existing issues where the team has already participated.
- Reviews take time
- Back-and-forth is normal
- The team appreciates your patience and effort
Don’t Target Specific Team Members
Kindly avoid:- @mentioning specific team members
- Requesting review from individuals
Be Respectful
All communication is subject to HashiCorp community guidelines:- Be respectful and professional
- Assume good intent
- Focus on technical merits
- Welcome feedback and learning opportunities
After Your PR is Merged
Release Inclusion
Your change may appear in:- The next minor release (X.Y.0)
- A patch release (X.Y.Z)
- A later release if it’s considered breaking
Release Notes
The core team:- Compiles changelog entries into release notes
- Updates the main CHANGELOG.md
- Includes your contribution in release announcements
Recognition
Contributors are recognized:- In git commit history
- In PR merge messages
- In release notes (for significant contributions)
Example PR Description
Next Steps
Code Style
Ensure your PR follows style guidelines
Testing
Write tests for your changes
Bug Reports
Understand the bug triage process
Contributing Overview
Review the full contributing guidelines