Commit graph

141 commits

Author SHA1 Message Date
Daniel Schmidt
7f41ab095c add date 2025-07-16 12:14:48 +02:00
Daniel Schmidt
5289b0cf6f ensure changelog script can handle empty alpha releases 2025-07-16 12:14:48 +02:00
Daniel Schmidt
11981797ad clean up old changeloge entries 2025-02-18 13:51:23 +01:00
Daniel Schmidt
0b300afe5a add helper to identify PRs with changelog entries 2025-02-18 13:51:23 +01:00
Daniel Schmidt
ab4e604d1d remove accidental rename 2025-02-18 13:51:23 +01:00
Daniel Schmidt
bac54da23e make changes dirs reflect the version 2025-02-18 13:51:23 +01:00
Daniel Schmidt
6ad27e2aa7 changelog scripting needs to handle tripple-split 2025-02-18 13:51:23 +01:00
James Bardin
d96b0d0c71 update scripts to use go tool 2025-02-12 12:26:03 -05:00
Daniel Schmidt
e7dd314e25 handle dev releases without changes on non-empty changelogs 2025-02-04 14:55:27 +01:00
Daniel Schmidt
122e5c7482 fix typo
Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
2025-01-16 11:55:48 +01:00
Daniel Schmidt
4ffa625403 rename to firstbeta 2025-01-16 11:55:48 +01:00
Daniel Schmidt
0526f59f06 add usage comment 2025-01-16 11:55:48 +01:00
Daniel Schmidt
4a5acd7ba1 remove old backported changes 2025-01-16 11:55:48 +01:00
Daniel Schmidt
3e714f6139 setup script for maintenance branch
By changing the folder changie uses for the changelog we can
make sure that users can put the changelog entries into a specific
folder based on if the change will be backported. This way it will
only appear in the patch release of the maintenance branch and not
in the changelog of the current development branch.
2025-01-16 11:55:48 +01:00
Daniel Schmidt
a5bfa39b9a only include experiments in dev and alpha releases 2025-01-16 11:55:48 +01:00
Daniel Schmidt
4c3acef273 fix dev release build to set VERSION correctly 2025-01-08 14:12:21 +01:00
Liam Cervante
b59439b9c3
Fix changelog generation for patch releases (#36286) 2025-01-08 11:13:13 +01:00
Daniel Schmidt
d3bbb448e8 increment patch version on dev 2025-01-07 16:40:49 +01:00
Daniel Schmidt
4415ddd735 handle beta releases 2025-01-07 12:41:23 +01:00
Daniel Schmidt
bd8cb41bef handle rc releases 2025-01-07 12:41:23 +01:00
Daniel Schmidt
2a0ee07d03 setup changie 2025-01-07 12:41:23 +01:00
Liam Cervante
27159db98c
Add changelog and version scripts to automate releases (#36099)
* Add changelog and version scripts to automate releases

* not always replacing the first line

* make copyrightfix
2024-11-27 13:08:47 +01:00
Martin Atkins
5811be26f8 go.mod: Separate modules at code ownership boundaries
Historically it's been hard for us to keep on top of dependency upgrades
as a matter of course because it's unclear which code owners might be
affected by or responsible for an upgrade of each module.

After trying a few different techniques to try to mitigate this, the most
promising one seems to be to tell the Go toolchain that each of these
components is a separate Go module, but then to stitch them all back
together again using replace directives so that we can mostly ignore these
module boundaries in everyday development.

The one case where we _do_ need to pay attention to these boundaries is
also the case where the separation is useful: upgrading a dependency of
any one of these modules might potentially force upgrading it for another
module too, and so the Go toolchain will help us notice that interaction
and we can immediately which code owners might need to be involved in
reviewing and testing that particular upgrade.

To make that process less onerous, this adds a new makefile target
"make syncdeps" which runs "go mod tidy" in all of the modules at once
and thus forces the toolchain to align their dependencies to the extent
required for them all to be linked together successfully, and to generate
go.mod and/or go.sum diffs that will match our configured code ownership
paths to trigger the appropriate code review requests.

Hopefully before too long we'll be able to move all the backends out into
provider plugins and delete the "legacy" module entirely and then this
oddness won't be needed anymore, but as long as we're all trying to play
together in this same sandbox this is a small amount of extra ceremony in
return for hopefully reducing the level of anxiety involved in keeping the
system's dependencies up to date more consistently.
2024-03-11 08:34:46 -07:00
Radek Simko
0c509183d1
ci: Add test for license headers (#34624)
* ci: Add test for copyright headers

* replace GHA workflow with make target (copyright)

This makes it reusable for outside of CI, such that anyone cloning the repo locally can still easily verify compliance before raising a PR.

* remove go:generate for copywrite

This should no longer be needed as we leverage copywrite via a shell script now.

* introduce make copyrightfix
2024-02-14 07:53:39 +00:00
jaykishan mutkawoa
f21d34a7f8 Exit CD when fail for a variety of reasons 2023-10-27 17:06:39 -04:00
Nick Fagerlund
af441abeda
Add staticcheck.conf to reduce unactionable noise in IDEs (#34036)
Since we already specify a list of staticcheck rules to ignore in the
scripts/staticcheck.sh wrapper script, this hoists those preferences up to the
top of the package tree, so they also affect the staticcheck integration in
editors like VSCode. This avoids unnecessary yellow-squiggles for capitalized
error messages, and makes integrated linting much more useful.
2023-10-12 11:01:12 -07:00
hashicorp-copywrite[bot]
53c34ff49c
Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
CJ Horton
11a68eaa40 set useDevelopmentVersion correctly for release builds 2023-07-17 11:11:35 -07:00
hashicorp-copywrite[bot]
325d18262e [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
kmoe
755757e8b2
build: exclude .go-version from imports check (#32141) 2022-11-02 15:49:01 +00:00
Martin Atkins
746bd49723 build: Exclude .pb.go files from goimports checking
protoc-gen-go generates non-style-compliant import directives, but since
those files are just generated anyway we don't need to worry too much
about what style they are in: the style that protoc-gen-go generates is
the canonical style for these ones.
2022-08-26 11:02:52 -07:00
Martin Atkins
443d470a86 build: FIXME to make goimportscheck.sh work on Bash 3 maybe 2022-08-26 09:47:30 -07:00
Martin Atkins
c2ec25e359 build: goimports check relative to PR base branch
At the risk of a little bit of hidden spooky action at a distance, this
will slightly change the behavior of the "goimports check" to compare
against the base branch of a PR rather than to origin/main if we happen
to find one of the environment variables that GitHub Actions sets
automatically in its runners. This is targeting our "checks.yml" workflow
in particular.

The intention here is to avoid misreporting files that haven't actually
changed when a PR is targeting a branch other than the main branch, such
as directly targeting a historical release branch.

We'll still run against origin/main when we're not running in GitHub
Actions, since that's _typically_ the correct branch to use for new
work, even if it will eventually get backported to a release branch.
2022-08-26 09:47:30 -07:00
Martin Atkins
246686813d build: goimports check supports any number of changed files
The previous implementation of this check tried to accumulate all of the
changed files into a single big string and then run goimports once with
all of them, but that approach ran into problems for changesets of a
certain (platform-specific) size due to limits on maximum command line
length.

This new version instead uses bash arrays and runs goimports separately
for each of the files which appear to have changed relative to the
base branch. This is likely to be slower to complete for changesets that
have many different changed files, but it's better for it to be slow than
to return an error and fail to check some of the files.
2022-08-26 09:47:30 -07:00
Martin Atkins
f6cc907166 build: Disable errors for deprecated functions in staticcheck
Because we maintain multiple versions of Terraform across different
release branches, we aim to avoid creating needless differences between
the branches to maximize the chance of successful automatic backporting.

Part of that policy is that we don't make cross-cutting changes to respond
to deprecation of functions in upstream packages and instead we respond
to them gradually over time when we'd be changing the nearby code anyway,
or when new work requires using the replacement APIs.

In recognition of that, this turns of the staticcheck rule that would
otherwise force us to resolve all deprecations before moving forward with
any other change.
2022-08-22 10:59:12 -07:00
Liam Cervante
c4e223c7a0
Only perform the importscheck on added or modified files (#31605) 2022-08-09 16:50:54 +01:00
Liam Cervante
985325a0fc
Remove -local flag from goimports check (#31555) 2022-08-02 15:08:38 +01:00
Liam Cervante
afd273d636
Add goimports as a check to the Github commit actions (#31432)
* Add goimports as a check to the Github commit actions

* check diff against main instead of last commit

* goimports should fix the problems

* fix up conditionals and wildcard matching

* specify origin/main in diff

* fetch main branch when checkout

* back to origin main
2022-07-19 10:14:28 +01:00
Klaus Frank
39bbcf2f9c
Fix for newer go version (#30889)
go get for compiling and installing is deprecated. Updating it to the new "go install"
2022-04-22 14:30:35 +01:00
Martin Atkins
9210ce6cdd build: GitHub Actions "Quick Checks" workflow
This is intended to eventually replace the CircleCI-based checks we use
as part of the PR process in this repository. We're already using GitHub
Actions for various other processes in this repository, so this change is
motivated by consistency of having all of our automation running in the
same system and written in the same language.

This is not a complete replacement for our CircleCI workflow yet, and
probably won't ever be because the CircleCI workflow contains some steps
that are arguably redundant with other processes we follow elsewhere.
However, the CircleCI workflow remains for now and won't be removed until
we're satisfied that enough of it is replicated by this GitHub Actions
workflow.
2022-04-04 08:12:44 -07:00
James Bardin
f031fcaa97 no need for TF_FORK=0 2021-10-28 11:51:39 -04:00
Martin Atkins
965c0f3f91 build: Run staticcheck with "go run"
Running the tool this way ensures that we'll always run the version
selected by our go.mod file, rather than whatever happened to be available
in $GOPATH/bin on the system where we're running this.

This change caused some contexts to now be using a newer version of
staticcheck with additional checks, and so this commit also includes some
changes to quiet the new warnings without any change in overall behavior.
2021-10-12 11:42:17 -07:00
Alisdair McDiarmid
e09bad76ff build: Add exhaustive switch statement lint
For now, only check the JSON views package, since this was the instance
that most recently tripped us up. There are a few dozen failures
elsewhere in Terraform which would need to be addressed before expanding
this to other packages.
2021-09-24 15:12:44 -04:00
James Bardin
a3fb07d008 add staticcheck make target
cleanup the old fmtcheck script while we're in here
2021-09-01 11:36:21 -04:00
Martin Atkins
ce96d82de0 build: Centralize our protobuf compilation steps
We have a few different .proto files in this repository that all need to
get recompiled into .pb.go files each time we change them, but we were
previously handling that with some scripts that just assumed that protoc
and the relevant plugins were already installed on the system somewhere,
at the right versions.

In practice we've been constantly flopping between different versions of
these tools due to folks having different versions installed in their
development environments. In particular, the state of the .pb.go files
in the prior commit wasn't reproducible by any single version of the tools
because they've all slightly diverged from one another.

In the interests of being more consistent here and avoiding accidental
inconsistencies, we'll now centralize the protocol buffer compile steps
all into a single tool that knows how to fetch and install the expected
versions of the various tools we need and then run those tools with the
right options to get a stable result.

If we want to upgrade to either a newer protoc or a newer protoc-gen-go
in future then we'll do that in a central location and update all of the
.pb.go files at the same time, so that we're always consistently tracking
the same version of protocol buffers everywhere.

While doing this I attempted to keep as close as possible to the toolchain
we'd most recently used, but since they were not consistent with each
other they've now all changed which version numbers they record at minimum,
and the planproto stub in particular now also has a slightly different
descriptor serialization but is otherwise offering the same API.
2021-08-20 16:18:48 -07:00
Pam Selle
83e6703bf7 Remove revision from version command
The revision field is only populated on dev builds so this means
most releases of Terraform have an empty "terraform_revision" field
in the JSON output. Since we recommend developers use go tooling
to `go build` this tool when developing, the revision is not useful
data and so it is removed.
2021-01-12 16:35:30 -05:00
James Bardin
1032db4f9d remove generate-plugins script and test
We no longer use internal plugins.
2020-12-02 12:45:00 -05:00
Pam Selle
e39e0e3d04 Remove vendor provisioners and add fmt Make target
Remove chef, habitat, puppet, and salt-masterless provsioners,
which follows their deprecation. Update the documentatin for these
provisioners to clarify that they have been removed from later versions
of Terraform. Adds the fmt Make target back and updates fmtcheck script
for correctness.
2020-11-17 11:22:03 -05:00
Kristin Laemmert
bad0adb996
build: remove unused scripts (#26484)
* build: remove unused build scripts
2020-10-06 13:26:38 -04:00
Alvin Huang
b52715a8f7 use alpine:latest as the base image for terraform docker containers 2020-07-01 16:03:06 -04:00