Skip to content

Commit 426e13d

Browse files
authoredJul 3, 2024··
chore: run upstream provider-lint (#4120)
This adds a step for running the upstream `provider-lint` make target. As part of this I had to fix some of the patches which violated some lint rules. **0009-Add-ECR-credentials_data_source.patch** - `ForceNew` does not apply to data sources **0032-DisableTagSchemaCheck-for-PF-provider.patch** - Schema have to have a `Type` - Also needed to add a ignore for `S013` which forces `Computed`, `Optional` or `Required` to be set. Looks like it can't recognize the `tagsComputed` var **0034-Fail-fast-when-PF-resources-are-dropped.patch** - Added a lint ignore for a rule which doesn't allow panics **0050-Normalize-retentionDays-in-aws_controltower_landing_.patch** - This test doesn't actually need a region or partition so replacing with a placeholder closes #4110
1 parent 0e9e84b commit 426e13d

30 files changed

+489
-766
lines changed
 

‎.ci-mgmt.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,33 @@ extraTests:
8686
env:
8787
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8888

89+
upstream_lint:
90+
name: Run upstream provider-lint
91+
runs-on: ubuntu-latest
92+
timeout-minutes: 60
93+
steps:
94+
- name: Free Disk Space (Ubuntu)
95+
uses: jlumbroso/free-disk-space@main
96+
with:
97+
swap-storage: false
98+
tool-cache: false
99+
- name: Checkout Repo
100+
uses: actions/checkout@v4
101+
with:
102+
ref: ${{ env.PR_COMMIT_SHA }}
103+
submodules: true
104+
- name: Install Go
105+
uses: actions/setup-go@v5
106+
with:
107+
go-version: "1.22.x"
108+
cache: false
109+
- name: Make upstream
110+
run: make upstream
111+
- name: upstream lint
112+
run: |
113+
cd upstream
114+
make provider-lint
115+
89116
test_oidc:
90117
name: test_oidc
91118
needs: build_sdk
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Download binary assets
2+
description: Downloads the provider and tfgen binaries to `bin/`.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Download provider + tfgen binaries
8+
uses: actions/download-artifact@v4
9+
with:
10+
name: aws-provider.tar.gz
11+
path: ${{ github.workspace }}/bin
12+
- name: Untar provider binaries
13+
shell: bash
14+
run: |
15+
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
16+
find ${{ github.workspace }} -name "pulumi-*-aws" -print -exec chmod +x {} \;
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Download SDK asset
2+
description: Restores the SDK asset for a language.
3+
4+
inputs:
5+
language:
6+
required: true
7+
description: One of nodejs, python, dotnet, go, java
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Download ${{ inputs.language }} SDK
13+
uses: actions/download-artifact@v4
14+
with:
15+
name: ${{ inputs.language }}-sdk.tar.gz
16+
path: ${{ github.workspace}}/sdk/
17+
- name: Uncompress SDK folder
18+
shell: bash
19+
run: tar -zxf ${{ github.workspace }}/sdk/${{ inputs.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ inputs.language }}

‎.github/actions/setup-tools/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ runs:
2626
cache-dependency-path: |
2727
provider/*.sum
2828
upstream/*.sum
29+
sdk/*.sum
2930
3031
- name: Install pulumictl
3132
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumictl')

‎.github/actions/upload-bin/action.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Upload bin assets
2+
description: Uploads the provider and tfgen binaries to `bin/`.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Tar provider binaries
8+
shell: bash
9+
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-aws pulumi-tfgen-aws
10+
- name: Upload artifacts
11+
uses: actions/upload-artifact@v4
12+
with:
13+
name: aws-provider.tar.gz
14+
path: ${{ github.workspace }}/bin/provider.tar.gz
15+
retention-days: 30

‎.github/actions/upload-sdk/action.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Upload SDK asset
2+
description: Upload the SDK for a specific language as an asset for the workflow.
3+
4+
inputs:
5+
language:
6+
required: true
7+
description: One of nodejs, python, dotnet, go, java
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Compress SDK folder
13+
shell: bash
14+
run: tar -zcf sdk/${{ inputs.language }}.tar.gz -C sdk/${{ inputs.language }} .
15+
- name: Upload artifacts
16+
uses: actions/upload-artifact@v4
17+
with:
18+
name: ${{ inputs.language }}-sdk.tar.gz
19+
path: ${{ github.workspace}}/sdk/${{ inputs.language }}.tar.gz
20+
retention-days: 30

‎.github/workflows/build_sdk.yml

+5-19
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ env:
2626
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
2727
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
2828
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
29-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3029
TF_APPEND_USER_AGENT: pulumi
3130
PROVIDER_VERSION: ${{ inputs.version }}
3231

@@ -58,17 +57,8 @@ jobs:
5857
uses: ./.github/actions/setup-tools
5958
with:
6059
tools: pulumictl, pulumicli, go, node, dotnet, python, java
61-
- name: Download provider + tfgen binaries
62-
uses: actions/download-artifact@v4
63-
with:
64-
name: aws-provider.tar.gz
65-
path: ${{ github.workspace }}/bin
66-
- name: Untar provider binaries
67-
run: >-
68-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
69-
github.workspace}}/bin
70-
71-
find ${{ github.workspace }} -name "pulumi-*-aws" -print -exec chmod +x {} \;
60+
- name: Download bin
61+
uses: ./.github/actions/download-bin
7262
- name: Install plugins
7363
run: make install_plugins
7464
- name: Update path
@@ -84,11 +74,7 @@ jobs:
8474
sdk/go/**/pulumiUtilities.go
8575
sdk/nodejs/package.json
8676
sdk/python/pyproject.toml
87-
- name: Compress SDK folder
88-
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
89-
- name: Upload artifacts
90-
uses: actions/upload-artifact@v4
77+
- name: Upload SDK
78+
uses: ./.github/actions/upload-sdk
9179
with:
92-
name: ${{ matrix.language }}-sdk.tar.gz
93-
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
94-
retention-days: 30
80+
language: ${{ matrix.language }}

‎.github/workflows/check-upstream-upgrade.yml

+4-17
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ jobs:
88
name: Check for upstream provider upgrades
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Install Go
12-
uses: actions/setup-go@v5
13-
with:
14-
go-version: "1.21.x"
15-
cache-dependency-path: |
16-
sdk/go.sum
1711
- name: Checkout Repo
1812
uses: actions/checkout@v4
1913
with:
2014
submodules: true
15+
- name: Setup tools
16+
uses: ./.github/actions/setup-tools
17+
with:
18+
tools: go
2119
- name: Install upgrade-provider
2220
run: go install github.com/pulumi/upgrade-provider@main
2321
shell: bash
@@ -34,17 +32,6 @@ jobs:
3432
env:
3533
REPO: ${{ github.repository }}
3634
shell: bash
37-
- name: Send Check Version Failure To Slack
38-
if: failure()
39-
uses: rtCamp/action-slack-notify@v2
40-
env:
41-
SLACK_CHANNEL: provider-upgrade-publish-status
42-
SLACK_COLOR: "#FF0000"
43-
SLACK_ICON_EMOJI: ":owl:"
44-
SLACK_MESSAGE: " Failed to check upstream for a new version "
45-
SLACK_TITLE: ${{ github.event.repository.name }} upstream version check
46-
SLACK_USERNAME: provider-bot
47-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
4835
name: Check upstream upgrade
4936
on:
5037
workflow_dispatch: {} #so we can run this manually if necessary.

‎.github/workflows/command-dispatch.yml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ env:
1919
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
2020
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
2121
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
22-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
2322
TF_APPEND_USER_AGENT: pulumi
2423
jobs:
2524
command-dispatch-for-testing:

‎.github/workflows/license.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ env:
2626
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
2727
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
2828
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
29-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3029
TF_APPEND_USER_AGENT: pulumi
3130

3231
jobs:
@@ -38,12 +37,10 @@ jobs:
3837
uses: actions/checkout@v4
3938
with:
4039
ref: ${{ env.PR_COMMIT_SHA }}
41-
- name: Install Go
42-
uses: actions/setup-go@v5
40+
- name: Setup tools
41+
uses: ./.github/actions/setup-tools
4342
with:
44-
cache-dependency-path: |
45-
sdk/go.sum
46-
go-version: "1.21.x"
43+
tools: go
4744
- run: make upstream
4845
- uses: pulumi/license-check-action@main
4946
with:

‎.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ env:
2525
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
2626
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
2727
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
28-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
2928
TF_APPEND_USER_AGENT: pulumi
3029

3130
jobs:

0 commit comments

Comments
 (0)