Skip to content

Commit 55a3dda

Browse files
committed
Merge branch 'main' of github.com:hashicorp/terraform-provider-archive into checksums
2 parents ba86e08 + 69d18a7 commit 55a3dda

39 files changed

+2162
-610
lines changed

.github/CONTRIBUTING.md

Lines changed: 99 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,129 @@
1-
# Contributing to `terraform-provider-archive`
1+
# Contributing
22

3-
**First:** if you're unsure or afraid of _anything_, just ask or submit the issue describing the problem you're aiming to solve.
3+
Thank you for investing your time and energy by contributing to our project: please ensure you are familiar
4+
with the [HashiCorp Code of Conduct](https://github.com/hashicorp/.github/blob/master/CODE_OF_CONDUCT.md).
45

5-
The `archive` provider is a HashiCorp *standard library* provider, which means we consider it part of the core Terraform experience. Our priority is stability and correctness, and any bug fix or feature has to be considered in the context of this provider's many users and the wider Terraform ecosystem.
6-
This is great as your contribution can have a big positive impact, but we have to assess potential negative impact too.
6+
This provider is a HashiCorp **utility provider**, which means any bug fix and feature
7+
has to be considered in the context of the thousands/millions of configurations in which this provider is used.
8+
This is great as your contribution can have a big positive impact, but we have to assess potential negative impact too
9+
(e.g. breaking existing configurations). _Stability over features_.
710

8-
To provide some safety to the Terraform ecosystem, we strictly follow [semantic versioning](https://semver.org/) and any changes that could be considered as breaking will only be released as part of a major release.
11+
To provide some safety to the wider provider ecosystem, we strictly follow
12+
[semantic versioning](https://semver.org/) and HashiCorp's own
13+
[versioning specification](https://www.terraform.io/plugin/sdkv2/best-practices/versioning#versioning-specification).
14+
Any changes that could be considered as breaking will only be included as part of a major release.
15+
In case multiple breaking changes need to happen, we will group them in the next upcoming major release.
916

10-
## Table of Contents
17+
## Asking Questions
1118

12-
- [I just have a question](#i-just-have-a-question)
13-
- [I want to report a vulnerability](#i-want-to-report-a-vulnerability)
14-
- [New Issue](#new-issue)
15-
- [New Pull Request](#new-pull-request)
19+
For questions, curiosity, or if still unsure what you are dealing with,
20+
please see the HashiCorp [Terraform Providers Discuss](https://discuss.hashicorp.com/c/terraform-providers/31)
21+
forum.
1622

17-
## I just have a question
23+
## Reporting Vulnerabilities
1824

19-
> **Note:** We use GitHub for tracking bugs and feature requests only.
25+
Please disclose security vulnerabilities responsibly by following the
26+
[HashiCorp Vulnerability Reporting guidelines](https://www.hashicorp.com/security#vulnerability-reporting).
2027

21-
For questions, please see relevant channels at https://www.terraform.io/community.html
28+
## Understanding the design
2229

23-
## I want to report a vulnerability
30+
Before proceeding with raising issues or submitting pull requests, it will probably help to familiarise yourself with
31+
the [design principles](../DESIGN.md) of this provider. This will aid your proposals, and help understand
32+
why we took certain decisions during development.
2433

25-
Please disclose security vulnerabilities responsibly by following the procedure
26-
described at https://www.hashicorp.com/security#vulnerability-reporting
34+
## Raising Issues
2735

28-
## New Issue
29-
30-
We welcome issues of all kinds including feature requests, bug reports or documentation suggestions. Below are guidelines for well-formed issues of each type.
36+
We welcome issues of all kinds including feature requests, bug reports or documentation suggestions.
37+
Below are guidelines for well-formed issues of each type.
3138

3239
### Bug Reports
3340

34-
- **Test against latest release**: Make sure you test against the latest avaiable version of both Terraform and the provider.
35-
It is possible we already fixed the bug you're experiencing.
36-
37-
- **Search for duplicates**: It's helpful to keep bug reports consolidated to one thread, so do a quick search on existing bug reports to check if anybody else has reported the same thing. You can scope searches by the label `bug` to help narrow things down.
38-
39-
- **Include steps to reproduce**: Provide steps to reproduce the issue, along with code examples (both HCL and Go, where applicable) and/or real code, so we can try to reproduce it. Without this, it makes it much harder (sometimes impossible) to fix the issue.
41+
* [ ] **Test against latest release**: Make sure you test against the latest available version of Terraform and the provider.
42+
It is possible we may have already fixed the bug you're experiencing.
43+
* [ ] **Search for duplicates**: It's helpful to keep bug reports consolidated to one thread, so do a quick search
44+
on existing bug reports to check if anybody else has reported the same thing.
45+
You can scope searches by the label `bug` to help narrow things down.
46+
* [ ] **Include steps to reproduce**: Provide steps to reproduce the issue, along with code examples and/or real code,
47+
so we can try to reproduce it. Without this, it makes it much harder (sometimes impossible) to fix the issue.
4048

4149
### Feature Requests
4250

43-
- **Search for possible duplicate requests**: It's helpful to keep requests consolidated to one thread, so do a quick search on existing requests to check if anybody else has reported the same thing. You can scope searches by the label `enhancement` to help narrow things down.
44-
45-
- **Include a use case description**: In addition to describing the behavior of the feature you'd like to see added, it's helpful to also lay out the reason why the feature would be important and how it would benefit the wider Terraform ecosystem. Use case in context of 1 provider is good, wider context of more providers is better.
51+
* [ ] **Search for possible duplicate requests**: It's helpful to keep requests consolidated to one thread,
52+
so do a quick search on existing requests to check if anybody else has reported the same thing.
53+
You can scope searches by the label `enhancement` to help narrow things down.
54+
* [ ] **Include a use case description**: In addition to describing the behavior of the feature you'd like to see added,
55+
it's helpful to also make a case for why the feature would be important and how it would benefit
56+
the provider and, potentially, the wider Terraform ecosystem.
4657

4758
## New Pull Request
4859

4960
Thank you for contributing!
5061

51-
We are happy to review pull requests without associated issues, but we highly recommend starting by describing and discussing your problem or feature and attaching use cases to an issue first before raising a pull request.
62+
We are happy to review pull requests without associated issues,
63+
but we **highly recommend** starting by describing and discussing
64+
your problem or feature and attaching use cases to an issue first
65+
before raising a pull request.
66+
67+
* [ ] **Early validation of idea and implementation plan**: provider development is complicated enough that there
68+
are often several ways to implement something, each of which has different implications and tradeoffs.
69+
Working through a plan of attack with the team before you dive into implementation will help ensure that you're
70+
working in the right direction.
71+
* [ ] **Tests**: It may go without saying, but every new patch should be covered by tests wherever possible.
72+
For bug-fixes, tests to prove the fix is valid. For features, tests to exercise the new code paths.
73+
* [ ] **Go Modules**: We use [Go Modules](https://github.com/golang/go/wiki/Modules) to manage and version our dependencies.
74+
Please make sure that you reflect dependency changes in your pull requests appropriately
75+
(e.g. `go get`, `go mod tidy` or other commands).
76+
Refer to the [dependency updates](#dependency-updates) section for more information about how
77+
this project maintains existing dependencies.
78+
* [ ] **Changelog**: Refer to the [changelog](#changelog) section for more information about how to create changelog entries.
79+
80+
### Dependency Updates
81+
82+
Dependency management is performed by [Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates).
83+
Where possible, dependency updates should occur through that system to ensure all Go module files are appropriately
84+
updated and to prevent duplicated effort of concurrent update submissions.
85+
Once available, updates are expected to be verified and merged to prevent latent technical debt.
86+
87+
### Changelog
88+
89+
HashiCorp’s open-source projects have always maintained user-friendly, readable `CHANGELOG`s that allow
90+
practitioners and developers to tell at a glance whether a release should have any effect on them,
91+
and to gauge the risk of an upgrade.
92+
93+
We follow Terraform Plugin
94+
[changelog specifications](https://www.terraform.io/plugin/sdkv2/best-practices/versioning#changelog-specification).
95+
96+
#### Entry format
97+
98+
Entries that are specific to _resources_ or _data sources_, they should look like:
99+
100+
```markdown
101+
* resource/RESOURCE_NAME: ENTRY DESCRIPTION ([#PR_NUMBER](PR_URL)).
102+
103+
* data-source/DATA-SOURCE_NAME: ENTRY DESCRIPTION ([#PR_NUMBER](PR_URL)).
104+
```
52105

53-
- **Early validation of idea and implementation plan**: Terraform's SDK is complicated enough that there are often several ways to implement something, each of which has different implications and tradeoffs. Working through a plan of attack with the team before you dive into implementation will help ensure that you're working in the right direction.
106+
#### Which changes should appear in the `CHANGELOG`?
54107

55-
- **Acceptance Tests**: It may go without saying, but every new patch should be covered by tests wherever possible.
108+
The `CHANGELOG` is intended to show developer-impacting changes to the codebase for a particular version.
109+
If every change or commit to the code resulted in an entry, the `CHANGELOG` would become less useful for developers.
110+
The lists below are general guidelines to decide whether a change should have an entry.
56111

57-
- **Go Modules**: We use [Go Modules](https://github.com/golang/go/wiki/Modules) to manage and version all our dependencies. Please make sure that you reflect dependency changes in your pull requests appropriately (e.g. `go get`, `go mod tidy` or other commands). Where possible it is better to raise a separate pull request with just dependency changes as it's easier to review such PR(s).
112+
##### Changes that _should not_ have a `CHANGELOG` entry
58113

59-
### Cosmetic changes, code formatting, and typos
114+
* Documentation updates
115+
* Testing updates
116+
* Code refactoring
60117

61-
In general we do not accept PRs containing only the following changes:
118+
##### Changes that _may_ have a `CHANGELOG` entry
62119

63-
- Correcting spelling or typos
64-
- Code formatting, including whitespace
65-
- Other cosmetic changes that do not affect functionality
66-
67-
While we appreciate the effort that goes into preparing PRs, there is always a tradeoff between benefit and cost. The costs involved in accepting such contributions include the time taken for thorough review, the noise created in the git history, and the increased number of GitHub notifications that maintainers must attend to.
120+
* Dependency updates: If the update contains relevant bug fixes or enhancements that affect developers,
121+
those should be called out.
68122

69-
#### Exceptions
123+
##### Changes that _should_ have a `CHANGELOG` entry
70124

71-
We belive that one should "leave the campsite cleaner than you found it", so you are welcome to clean up cosmetic issues in the neighbourhood when submitting a patch that makes functional changes or fixes.
125+
* Major features
126+
* Bug fixes
127+
* Enhancements
128+
* Deprecations
129+
* Breaking changes and removals

.github/SUPPORT.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Support
22

3-
Terraform is a mature project with a growing community. There are active, dedicated people willing to help you through various mediums.
4-
5-
Take a look at those mediums listed at https://www.terraform.io/community.html
3+
* Project [README](../README.md).
4+
* Official [Documentation](https://registry.terraform.io/providers/hashicorp/archive/latest/docs).
5+
* Provider [Discussion forums](https://discuss.hashicorp.com/c/terraform-providers/31).
6+
* Terraform [Community](https://www.terraform.io/community.html).

.github/workflows/add-content-to-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: "Set Issue to 'Priority = Triage Next'"
22-
uses: leonsteinhaeuser/[email protected].0
22+
uses: leonsteinhaeuser/project-beta-automations@7f947733020ee03daa363d16ea1223717b132f11 # v2.0.1
2323
if: github.event_name == 'issues'
2424
with:
2525
gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
@@ -29,7 +29,7 @@ jobs:
2929
operation_mode: custom_field
3030
custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'
3131
- name: "Set Pull Request to 'Priority = Triage Next'"
32-
uses: leonsteinhaeuser/[email protected].0
32+
uses: leonsteinhaeuser/project-beta-automations@7f947733020ee03daa363d16ea1223717b132f11 # v2.0.1
3333
if: github.event_name == 'pull_request_target'
3434
with:
3535
gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}

.github/workflows/issue-comment-created.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
issue_comment_triage:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions-ecosystem/action-remove-labels@v1
11+
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
1212
with:
1313
labels: |
1414
stale

.github/workflows/issue-opened.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
issue_triage:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
12-
- uses: github/issue-labeler@v2
11+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
12+
- uses: github/issue-labeler@6ca237433dbbb8e475241b7f38f4600d9e296c57 # v2.5
1313
with:
1414
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1515
configuration-path: .github/labeler-issue-triage.yml

.github/workflows/pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
triage:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/labeler@v4
14+
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4 # v4.0.2
1515
with:
1616
configuration-path: .github/labeler-pull-request-triage.yml
1717
repo-token: "${{ secrets.GITHUB_TOKEN }}"
18-
- uses: CodelyTV/pr-size-labeler@v1
18+
- uses: CodelyTV/pr-size-labeler@54ef36785e9f4cb5ecf1949cfc9b00dbb621d761 # v1.8.1
1919
with:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
xs_label: 'size/XS'

.github/workflows/release.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,23 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
go-version:
13-
runs-on: ubuntu-latest
14-
outputs:
15-
version: ${{ steps.go-version.outputs.version }}
16-
steps:
17-
- uses: actions/checkout@v3
18-
- id: go-version
19-
run: echo "::set-output name=version::$(cat ./.go-version)"
2012
release-notes:
2113
runs-on: ubuntu-latest
2214
steps:
23-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
2416
with:
2517
fetch-depth: 0
2618
- name: Generate Release Notes
2719
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt
28-
- uses: actions/upload-artifact@v3
20+
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2921
with:
3022
name: release-notes
3123
path: release-notes.txt
3224
retention-days: 1
3325
terraform-provider-release:
3426
name: 'Terraform Provider Release'
35-
needs: [go-version, release-notes]
36-
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v2
27+
needs: [release-notes]
28+
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@106e6d08159ccec423310cc2c706bae59f46c09c # v2.2.0
3729
secrets:
3830
hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}'
3931
hc-releases-host-staging: '${{ secrets.HC_RELEASES_HOST_STAGING }}'
@@ -46,6 +38,6 @@ jobs:
4638
signore-client-secret: '${{ secrets.SIGNORE_CLIENT_SECRET }}'
4739
with:
4840
release-notes: true
49-
setup-go-version: '${{ needs.go-version.outputs.version }}'
41+
setup-go-version-file: 'go.mod'
5042
# Product Version (e.g. v1.2.3 or github.ref_name)
5143
product-version: '${{ github.ref_name }}'

.github/workflows/test.yml

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,58 +19,70 @@ jobs:
1919
timeout-minutes: 5
2020
steps:
2121

22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
24+
2225
- name: Set up Go
23-
uses: actions/setup-go@v3
26+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
2427
with:
25-
go-version: '1.18'
28+
go-version-file: 'go.mod'
2629
id: go
2730

28-
- name: Check out code into the Go module directory
29-
uses: actions/checkout@v3
31+
- name: Run linters
32+
uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # v3.3.1
33+
with:
34+
version: latest
3035

31-
- name: Go fmt
32-
run: |
33-
make fmt
36+
- name: Generate
37+
run: make generate
3438

35-
- name: Go vet
39+
- name: Confirm no diff
3640
run: |
37-
make vet
41+
git diff --compact-summary --exit-code || \
42+
(echo "*** Unexpected differences after code generation. Run 'make generate' and commit."; exit 1)
3843
3944
- name: Build
40-
run: |
41-
go build -v .
42-
45+
run: make build
46+
4347

44-
# run acceptance tests in a matrix with Terraform core versions
48+
# run acceptance tests in a matrix with Terraform core versions
4549
test:
46-
name: Matrix Test
50+
name: 'Acc. Tests (OS: ${{ matrix.os }} / TF: ${{ matrix.terraform }})'
4751
needs: build
4852
runs-on: ${{ matrix.os }}
4953
timeout-minutes: 15
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
os: [macos-latest, windows-latest, ubuntu-latest]
57+
os:
58+
- macos-latest
59+
- windows-latest
60+
- ubuntu-latest
5461
terraform:
55-
- '0.12.31'
56-
- '0.13.7'
57-
- '0.14.11'
58-
- '0.15.1'
62+
- '0.12.*'
63+
- '0.13.*'
64+
- '0.14.*'
65+
- '0.15.*'
66+
- '1.0.*'
67+
- '1.1.*'
68+
- '1.2.*'
69+
- '1.3.*'
5970
steps:
6071

61-
- name: Set up Go
62-
uses: actions/setup-go@v3
63-
with:
64-
go-version: '1.18'
65-
id: go
72+
- name: Check out code
73+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
6674

67-
- name: Check out code into the Go module directory
68-
uses: actions/checkout@v3
75+
- name: Setup Go
76+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
77+
with:
78+
go-version-file: 'go.mod'
79+
check-latest: true
6980

70-
- name: TF acceptance tests
71-
timeout-minutes: 10
72-
env:
73-
TF_ACC: "1"
74-
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
75-
run: |
76-
go test -v -cover ./internal/provider/
81+
- name: Setup Terraform ${{ matrix.terraform }}
82+
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
83+
with:
84+
terraform_version: ${{ matrix.terraform }}
85+
terraform_wrapper: false
86+
87+
- name: Run acceptance test
88+
run: make testacc

.go-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)