Skip to content

Commit dedf93f

Browse files
committed
Merge branch 'main' into can-push-deploy-keys
# Conflicts: # docs/resources/deploy_key.md
2 parents 93c8331 + b7d4d4f commit dedf93f

File tree

323 files changed

+18280
-5290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+18280
-5290
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: 🐞 Bug Report
2+
description: File a bug report
3+
labels: ["bug", "needs-triage"]
4+
# assignees:
5+
# - octocat
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Hi there 👋,
11+
12+
Thank you for reporting the bug! Completing all sections of this form will help us find a solution quickly.
13+
14+
If the problem is a missing feature, then please use a [Feature Request](https://github.com/gitlabhq/terraform-provider-gitlab/issues/new?template=FEATURE_REQUEST.yml) instead.
15+
- type: input
16+
id: provider-version
17+
attributes:
18+
label: GitLab Provider version
19+
description: What version of the `gitlabhq/gitlab` provider are you using? (This is usually found in any `terraform` command output.)
20+
placeholder: "X.X.X"
21+
validations:
22+
required: false
23+
- type: input
24+
id: gitlab-version
25+
attributes:
26+
label: GitLab version
27+
description: What version and edition of GitLab are you using? (This can be found in the "Help" section in GitLab.)
28+
placeholder: "GitLab XXXXX Edition X.X"
29+
validations:
30+
required: false
31+
- type: input
32+
id: terraform-version
33+
attributes:
34+
label: Terraform version
35+
description: What version of terraform are you using?
36+
placeholder: "Please paste the output of `terraform -v` here"
37+
validations:
38+
required: false
39+
- type: textarea
40+
id: configuration
41+
attributes:
42+
label: Relevant Terraform Configuration
43+
description: Please copy and paste the relevant Terraform Configuration here. This will be automatically formatted into code, so no need for backticks.
44+
render: hcl
45+
validations:
46+
required: false
47+
- type: textarea
48+
id: logs
49+
attributes:
50+
label: Relevant log output
51+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
52+
render: shell
53+
- type: textarea
54+
id: problem-description
55+
attributes:
56+
label: Description
57+
description: |
58+
Please describe the problem you are experiencing and what you would have expected to see.
59+
Make sure to include important factoids or special steps someones needs to reproduce the issue.
60+
validations:
61+
required: false
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: ✨ Feature Request
2+
description: Request a new feature
3+
labels: ["enhancement", "needs-triage"]
4+
# assignees:
5+
# - octocat
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Hi there 👋,
11+
12+
Thank you for requesting a new feature!
13+
- type: textarea
14+
id: description
15+
attributes:
16+
label: Feature Description
17+
description: Please describe your feature ideas in as much detail as possible, including an example configuration.
18+
validations:
19+
required: true
20+
- type: checkboxes
21+
id: contribution-willingness
22+
attributes:
23+
label: Do you want to implement this?
24+
options:
25+
- label: I would like to implement this myself 👷
26+
required: false

.github/labeler-pr-triage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ linter:
1616

1717
provider:
1818
- '.go-version'
19-
- 'gitlab/**/*'
19+
- 'internal/provider/**/*'
2020
- 'main.go'
2121

2222
resource:
23-
- 'gitlab/resource_*.go'
23+
- 'internal/provider/resource_*.go'
2424

2525
data-source:
26-
- 'gitlab/data_source_*.go'
26+
- 'internal/provider/data_source_*.go'
2727

2828
tests:
2929
- '**/*_test.go'

.github/pull_request_template.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
<!-- Which issue/s does this PR close? Is there any more context you can give the reviewer? -->
44

5-
## PR Checklist
5+
### PR Checklist Acknowledgement
66

7-
<!-- For a smooth review process, please run through this checklist before submitting a PR. -->
7+
<!-- For a smooth review process, please run through this checklist before submitting a PR, and check the box when done. -->
88

9-
- [ ] Resource attributes match 1:1 the names and structure of the API resource in [the GitLab API documentation](https://docs.gitlab.com/ee/api/).
10-
- [ ] [Examples](/examples) are updated with:
9+
- [ ] I acknowledge that all of the following items are true, where applicable:
10+
- Resource attributes match 1:1 the names and structure of the API resource in [the GitLab API documentation](https://docs.gitlab.com/ee/api/).
11+
- [Examples](https://github.com/gitlabhq/terraform-provider-gitlab/tree/main/examples) are updated with:
1112
- A \*.tf file for the resource/s with at least one usage example
1213
- A \*.sh file for the resource/s with an import example (if applicable)
13-
- [ ] New resources have at minimum a basic test with three steps:
14+
- New resources have at minimum a basic test with three steps:
1415
- Create the resource
1516
- Update the attributes
1617
- Import the resource
17-
- [ ] No new `//lintignore` comments that came from copied code. Linter rules are meant to be enforced on new code.
18+
- No new `//lintignore` comments were copied from existing code. (Linter rules are meant to be enforced on new code.)

.github/terraform_logo.svg

Lines changed: 7 additions & 0 deletions
Loading

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ permissions:
1212
jobs:
1313
remove-labels:
1414
runs-on: ubuntu-latest
15+
# This job contains steps which are expected to fail.
16+
continue-on-error: true
1517
steps:
18+
- name: Is comment from a collaborator?
19+
uses: octokit/[email protected]
20+
with:
21+
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
# Only remove labels if they are NOT a collaborator.
25+
# Reason being, a collaborator may post a comment and add a waiting-response label.
1626
- uses: actions-ecosystem/action-remove-labels@v1
27+
if: ${{ failure() }}
1728
with:
1829
labels: |
1930
stale

.github/workflows/issue-opened.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@ permissions:
1212
jobs:
1313
add-labels:
1414
runs-on: ubuntu-latest
15+
# This job contains steps which are expected to fail.
16+
continue-on-error: true
1517
steps:
16-
- uses: actions/checkout@v2
18+
- name: Is opened by a collaborator?
19+
uses: octokit/[email protected]
20+
with:
21+
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
# Only add triage labels if they are NOT a collaborator.
25+
# This prevents the needs-triage label from being added.
26+
- uses: actions/checkout@v3
27+
if: ${{ failure() }}
1728
- uses: github/[email protected]
29+
if: ${{ failure() }}
1830
with:
1931
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2032
configuration-path: .github/labeler-issue-triage.yml
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow runs acceptance tests on pull requests (CE)
2+
3+
name: pr-acceptance-ce
4+
5+
on:
6+
pull_request:
7+
# Acceptance tests are unnecessary to run on some types of PRs.
8+
paths-ignore:
9+
- 'docs/**'
10+
- 'examples/**'
11+
- 'README.md'
12+
- 'CHANGELOG.md'
13+
- 'CONTRIBUTING.md'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
go-version:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
go-version: ${{ steps.go-version.outputs.go-version }}
24+
steps:
25+
- uses: actions/checkout@v3
26+
# Read the .go-version file and output it for other jobs to use.
27+
- id: go-version
28+
run: echo "::set-output name=go-version::$(cat .go-version)"
29+
30+
acceptance-ce:
31+
timeout-minutes: 60
32+
runs-on: ubuntu-latest
33+
needs: [go-version]
34+
steps:
35+
- uses: actions/setup-go@v2
36+
with:
37+
go-version: ${{ needs.go-version.outputs.go-version }}
38+
- uses: actions/checkout@v3
39+
# Cache the Go modules.
40+
- uses: actions/cache@v3
41+
with:
42+
path: ~/go/pkg/mod
43+
key: ${{ github.job }}-${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'GNUMakefile') }}
44+
- run: make testacc-up
45+
- run: make testacc
Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# This workflow runs acceptance tests on pull requests (both CE and EE). It needs to be run in the
1+
# This workflow runs acceptance tests on pull requests (EE). It needs to be run in the
22
# target project instead of the fork in order to use secrets. This is why the actions/checkout
33
# action regularly has to specify the pull request sha.
44
#
55
# SECURITY ADVISORY
66
# Be careful while making changes to this file.
77
# See: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
8+
#
9+
# We are using "persist-credentials: false" on all checkout actions in this workflow as a
10+
# precaution.
811

9-
name: pr-acceptance
12+
name: pr-acceptance-ee
1013

1114
on:
1215
# The pull_request_target event type fires for pull requests, but in the context of the target
@@ -20,6 +23,9 @@ on:
2023
- 'CHANGELOG.md'
2124
- 'CONTRIBUTING.md'
2225

26+
# Disable permissions on the GITHUB_TOKEN for all scopes.
27+
permissions: {}
28+
2329
concurrency:
2430
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
2531
cancel-in-progress: true
@@ -31,9 +37,10 @@ jobs:
3137
go-version: ${{ steps.go-version.outputs.go-version }}
3238
steps:
3339
# Check out the pull request code (as opposed to the target project).
34-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v3
3541
with:
3642
ref: ${{ github.event.pull_request.head.sha }}
43+
persist-credentials: false
3744
# Read the .go-version file and output it for other jobs to use.
3845
- id: go-version
3946
run: echo "::set-output name=go-version::$(cat .go-version)"
@@ -51,28 +58,6 @@ jobs:
5158
if: ${{ env.LICENSE_ENCRYPTION_PASSWORD != '' }}
5259
run: echo "::set-output name=defined::true"
5360

54-
acceptance-ce:
55-
timeout-minutes: 60
56-
runs-on: ubuntu-latest
57-
needs: [go-version]
58-
steps:
59-
- uses: actions/setup-go@v2
60-
with:
61-
go-version: ${{ needs.go-version.outputs.go-version }}
62-
# Check out the pull request code (as opposed to the target project).
63-
- uses: actions/checkout@v2
64-
with:
65-
ref: ${{ github.event.pull_request.head.sha }}
66-
# Cache the Go modules.
67-
- uses: actions/cache@v2
68-
with:
69-
path: ~/go/pkg/mod
70-
key: ${{ github.job }}-${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'GNUMakefile') }}
71-
# CAUTION: EXECUTING UNTRUSTED CODE.
72-
# This is made safe because we have not referenced any secrets or GitHub tokens.
73-
- run: make testacc-up
74-
- run: make testacc
75-
7661
acceptance-ee:
7762
# Only run EE tests if the LICENSE_ENCRYPTION_PASSWORD secret exists, so that the workflow
7863
# doesn't fail when code is pushed to a fork.
@@ -86,7 +71,10 @@ jobs:
8671
go-version: ${{ needs.go-version.outputs.go-version }}
8772
# Check out the target project (as opposed to the pull request code).
8873
# Yes, this is intentional. We are using trusted code while working with the GitLab license.
89-
- uses: actions/checkout@v2
74+
- uses: actions/checkout@v3
75+
with:
76+
ref: ${{ github.event.repository.default_branch }}
77+
persist-credentials: false
9078
- name: Decrypt license
9179
run: |
9280
openssl version
@@ -95,15 +83,17 @@ jobs:
9583
# Check out the pull request code (as opposed to the target project).
9684
# This overwrites the entire directory and deleted the unencrypted GitLab license file. The
9785
# service has already started and continues using the license even though the file is deleted.
98-
- uses: actions/checkout@v2
86+
- uses: actions/checkout@v3
9987
with:
10088
ref: ${{ github.event.pull_request.head.sha }}
89+
persist-credentials: false
10190
# Cache the Go modules.
102-
- uses: actions/cache@v2
91+
- uses: actions/cache@v3
10392
with:
10493
path: ~/go/pkg/mod
10594
key: ${{ github.job }}-${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'GNUMakefile') }}
10695
# CAUTION: EXECUTING UNTRUSTED CODE.
10796
# This is made safe because we have already cleaned up the unencrypted GitLab license file,
10897
# we have no other secrets, and we are not using GitHub tokens.
10998
- run: make testacc
99+

0 commit comments

Comments
 (0)