diff --git a/.changes/1.11.0.md b/.changes/1.11.0.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/.changes/experiments.md b/.changes/experiments.md new file mode 100644 index 000000000000..8cbffbf8241e --- /dev/null +++ b/.changes/experiments.md @@ -0,0 +1,11 @@ +EXPERIMENTS: + +Experiments are only enabled in alpha releases of Terraform CLI. The following features are not yet available in stable releases. + +- `terraform test` accepts a new option `-junit-xml=FILENAME`. If specified, and if the test configuration is valid enough to begin executing, then Terraform writes a JUnit XML test result report to the given filename, describing similar information as included in the normal test output. ([#34291](https://github.com/hashicorp/terraform/issues/34291)) +- The new command `terraform rpcapi` exposes some Terraform Core functionality through an RPC interface compatible with [`go-plugin`](https://github.com/hashicorp/go-plugin). The exact RPC API exposed here is currently subject to change at any time, because it's here primarily as a vehicle to support the [Terraform Stacks](https://www.hashicorp.com/blog/terraform-stacks-explained) private preview and so will be broken if necessary to respond to feedback from private preview participants, or possibly for other reasons. Do not use this mechanism yet outside of Terraform Stacks private preview. +- The experimental "deferred actions" feature, enabled by passing the `-allow-deferral` option to `terraform plan`, permits `count` and `for_each` arguments in `module`, `resource`, and `data` blocks to have unknown values and allows providers to react more flexibly to unknown values. This experiment is under active development, and so it's not yet useful to participate in this experiment + +## Previous Releases + +For information on prior major and minor releases, refer to their changelogs: diff --git a/.changes/previous-releases.md b/.changes/previous-releases.md new file mode 100644 index 000000000000..fe4cea59b42d --- /dev/null +++ b/.changes/previous-releases.md @@ -0,0 +1,16 @@ +- [v1.10](https://github.com/hashicorp/terraform/blob/v1.10/CHANGELOG.md) +- [v1.9](https://github.com/hashicorp/terraform/blob/v1.9/CHANGELOG.md) +- [v1.8](https://github.com/hashicorp/terraform/blob/v1.8/CHANGELOG.md) +- [v1.7](https://github.com/hashicorp/terraform/blob/v1.7/CHANGELOG.md) +- [v1.6](https://github.com/hashicorp/terraform/blob/v1.6/CHANGELOG.md) +- [v1.5](https://github.com/hashicorp/terraform/blob/v1.5/CHANGELOG.md) +- [v1.4](https://github.com/hashicorp/terraform/blob/v1.4/CHANGELOG.md) +- [v1.3](https://github.com/hashicorp/terraform/blob/v1.3/CHANGELOG.md) +- [v1.2](https://github.com/hashicorp/terraform/blob/v1.2/CHANGELOG.md) +- [v1.1](https://github.com/hashicorp/terraform/blob/v1.1/CHANGELOG.md) +- [v1.0](https://github.com/hashicorp/terraform/blob/v1.0/CHANGELOG.md) +- [v0.15](https://github.com/hashicorp/terraform/blob/v0.15/CHANGELOG.md) +- [v0.14](https://github.com/hashicorp/terraform/blob/v0.14/CHANGELOG.md) +- [v0.13](https://github.com/hashicorp/terraform/blob/v0.13/CHANGELOG.md) +- [v0.12](https://github.com/hashicorp/terraform/blob/v0.12/CHANGELOG.md) +- [v0.11 and earlier](https://github.com/hashicorp/terraform/blob/v0.11/CHANGELOG.md) diff --git a/.changes/unreleased/.gitkeep b/.changes/unreleased/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/.changes/unreleased/ENHANCEMENTS-20250102-130808.yaml b/.changes/unreleased/ENHANCEMENTS-20250102-130808.yaml new file mode 100644 index 000000000000..767c4fb1a7ae --- /dev/null +++ b/.changes/unreleased/ENHANCEMENTS-20250102-130808.yaml @@ -0,0 +1,5 @@ +kind: ENHANCEMENTS +body: "`init`: Provider installation will utilise credentials configured in a `.netrc` file for the download and shasum URLs returned by provider registries." +time: 2025-01-02T13:00:22.419624+01:00 +custom: + Issue: "35843" diff --git a/.changes/unreleased/ENHANCEMENTS-20250102-131022.yaml b/.changes/unreleased/ENHANCEMENTS-20250102-131022.yaml new file mode 100644 index 000000000000..0f45f2fc959c --- /dev/null +++ b/.changes/unreleased/ENHANCEMENTS-20250102-131022.yaml @@ -0,0 +1,5 @@ +kind: ENHANCEMENTS +body: "New command `modules -json`: Displays a full list of all installed modules in a working directory, including whether each module is currently referenced by the working directory's configuration." +time: 2025-01-02T13:10:22.419624+01:00 +custom: + Issue: "35884" diff --git a/.changie.yaml b/.changie.yaml new file mode 100644 index 000000000000..55682a655c3c --- /dev/null +++ b/.changie.yaml @@ -0,0 +1,27 @@ +changesDir: .changes +unreleasedDir: unreleased +versionFooterPath: version_footer.tpl.md +changelogPath: CHANGELOG.md +versionExt: md +versionFormat: '## {{.Version}} ({{.Time.Format "January 2, 2006"}})' +kindFormat: "{{.Kind}}:" +changeFormat: "* {{.Body}} {{- if .Custom.Issue }} ([#{{.Custom.Issue}}](https://github.com/hashicorp/terraform/issues/{{.Custom.Issue}})){{- end}}" +custom: + - key: Issue + label: Issue/PR Number + type: int + minInt: 1 +kinds: + - label: NEW FEATURES + - label: ENHANCEMENTS + - label: BUG FIXES + - label: NOTES + - label: UPGRADE NOTES + - label: BREAKING CHANGES +newlines: + afterChangelogHeader: 0 + afterKind: 1 + afterVersion: 1 + beforeChangelogVersion: 0 + endOfVersion: 2 +envPrefix: CHANGIE_ diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 024e699a8129..6b4dd468082c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -33,24 +33,14 @@ label to enable the backport bot. 1.11.x -## Draft CHANGELOG entry +## CHANGELOG entry -### NEW FEATURES | UPGRADE NOTES | ENHANCEMENTS | BUG FIXES | EXPERIMENTS - - - -- +- [ ] This change is user-facing and I added a changelog entry. +- [ ] This change is not user-facing. diff --git a/CHANGELOG.md b/CHANGELOG.md index 3965837a488a..7948073ab1b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ENHANCEMENTS: -- `init`: Provider installation will utilise credentials configured in a `.netrc` file for the download and shasum URLs returned by provider registries. ([https://github.com/hashicorp/terraform/pull/35843](35843)) -- New command `modules -json`: Displays a full list of all installed modules in a working directory, including whether each module is currently referenced by the working directory's configuration. ([#35884](https://github.com/hashicorp/terraform/pull/35884), [#36062](https://github.com/hashicorp/terraform/pull/36062)) +* `init`: Provider installation will utilise credentials configured in a `.netrc` file for the download and shasum URLs returned by provider registries. ([#35843](https://github.com/hashicorp/terraform/issues/35843)) +* New command `modules -json`: Displays a full list of all installed modules in a working directory, including whether each module is currently referenced by the working directory's configuration. ([#35884](https://github.com/hashicorp/terraform/issues/35884)) EXPERIMENTS: diff --git a/scripts/changelog.sh b/scripts/changelog.sh index f5c23c9d2381..ee79a7a12801 100755 --- a/scripts/changelog.sh +++ b/scripts/changelog.sh @@ -4,6 +4,9 @@ set -uo pipefail +set -x + +# TODO: Make all paths relative to the script location function usage { cat <<-'EOF' @@ -13,59 +16,115 @@ Description: This script will update CHANGELOG.md with the given version and date. Commands: - prepare - prepare updates the first line in the CHANGELOG.md file with the - given version and date. - - ./changelog.sh prepare 1.0.0 "November 1, 2021" - - cleanup - cleanup prepends a new section to the CHANGELOG.md file with the given - version and (Unreleased) as the date. If the released version contains a - pre-release tag, the next version will replace the top line instead of - inserting a new section. + generate + generate will create a new section in the CHANGELOG.md file for the given release + type. The release type should be one of "dev", "alpha", "release", or "patch". + `dev`: will update the changelog with the latest unreleased changes. + `alpha`: will generate a new section with an alpha version for today. + `release`: will make the initial minor release for this branch. + `patch`: will generate a new patch release + + + nextminor + Run this to get a new release branch for the next minor version. EOF } -function prepare { - VERSION="${1:-}" - DATE="${2:-}" - - if [[ -z "$VERSION" || -z "$DATE" ]]; then - echo "missing at least one of [, ] arguments" - usage - exit 1 - fi - - sed -i '' -e "1s/.*/## $VERSION ($DATE)/" CHANGELOG.md +function generate { + RELEASE_TYPE="${1:-}" + + if [[ -z "$RELEASE_TYPE" ]]; then + echo "missing argument" + usage + exit 1 + fi + + case "$RELEASE_TYPE" in + + dev) + LATEST_VERSION=$(npx -y changie@1.21.0 latest -r --skip-prereleases) + COMPLETE_VERSION="$LATEST_VERSION-dev" + + echo "LASTEST_VERSION: $LATEST_VERSION" + + npx -y changie@1.21.0 merge -u "## $LATEST_VERSION (Unreleased)" + + # If we have no changes yet, the changelog is empty now, so we need to add a header + if [[ ! -s CHANGELOG.md ]]; then + echo "## $LATEST_VERSION (Unreleased)" > CHANGELOG.md + echo "" >> CHANGELOG.md + fi + ;; + + alpha) + PRERELEASE_VERSION=$(date +"alpha%Y%m%d") + LATEST_VERSION=$(npx -y changie@1.21.0 latest -r --skip-prereleases) + HUMAN_DATE=$(date +"%B %d, %Y") # Date in Janurary 1st, 2022 format + COMPLETE_VERSION="$LATEST_VERSION-$PRERELEASE_VERSION" + + npx -y changie@1.21.0 merge -u "## $COMPLETE_VERSION ($HUMAN_DATE)" + ;; + patch) + COMPLETE_VERSION=$(npx -y changie@1.21.0 next patch) + COMPLETE_VERSION=${COMPLETE_VERSION:1} # remove the v prefix + npx -y changie@1.21.0 batch patch + npx -y changie@1.21.0 merge + ;; + + release) + # This is the first release of the branch, releasing the new minor version + COMPLETE_VERSION=$(npx -y changie@1.21.0 latest -r --skip-prereleases) + # We currently keep a file that looks like this release to ensure the alphas and dev versions are generated correctly + rm ./.changes/$COMPLETE_VERSION.md + + npx -y changie@1.21.0 batch $COMPLETE_VERSION + npx -y changie@1.21.0 merge + ;; + + *) + echo "invalid argument" + usage + exit 1 + + ;; + esac + + # Set version/VERSION to the to be released version + echo "$COMPLETE_VERSION" > version/VERSION + + # Add footer to the changelog + cat ./.changes/experiments.md >> CHANGELOG.md + echo "" >> CHANGELOG.md + cat ./.changes/previous-releases.md >> CHANGELOG.md } -function cleanup { - RELEASED_VERSION="${1:-}" - NEXT_VERSION="${2:-}" - - if [[ -z "$RELEASED_VERSION" || -z "$NEXT_VERSION" ]]; then - echo "missing at least one of [, ] arguments" - usage - exit 1 - fi - - if [[ "$RELEASED_VERSION" == *-* ]]; then - # then we have a pre-release version, so we should replace the top line - sed -i '' -e "1s/.*/## $NEXT_VERSION (Unreleased)/" CHANGELOG.md - else - sed -i '' -e "1s/^/## $NEXT_VERSION (Unreleased)\n\n/" CHANGELOG.md - fi +function nextminor { + LATEST_VERSION=$(npx -y changie@1.21.0 latest -r --skip-prereleases) + LATEST_VERSION=${LATEST_VERSION%.*} # Remove the patch version + CURRENT_FILE_CONTENT=$(cat ./.changes/previous-releases.md) + # Prepend the latest version to the previous releases + echo "- [v$LATEST_VERSION](https://github.com/hashicorp/terraform/blob/v$LATEST_VERSION/CHANGELOG.md)" > ./.changes/previous-releases.md + echo "$CURRENT_FILE_CONTENT" >> ./.changes/previous-releases.md + + NEXT_VERSION=$(npx -y changie@1.21.0 next minor) + # Remove all existing per-release changelogs + rm ./.changes/*.*.*.md + # Remove all unreleased changes + rm ./.changes/unreleased/*.yaml + # Create a new empty version file for the next minor version + touch ./.changes/$NEXT_VERSION.md + + generate "dev" } function main { case "$1" in - prepare) - prepare "${@:2}" + generate) + generate "${@:2}" ;; - cleanup) - cleanup "${@:2}" + nextminor) + nextminor "${@:2}" ;; *)