Skip to content

Commit d2553f2

Browse files
authored
Update GitHub Actions workflows. (#844)
This PR was automatically generated by the update-workflows-ecosystem-providers workflow in the pulumi/ci-mgmt repo, from commit 8cd3e071977b4ff31101bf05e489d4e2d2eedae5.
1 parent 36508c9 commit d2553f2

25 files changed

+463
-68
lines changed

.github/actions/esc-action/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var stream = fs.createWriteStream(file, { flags: "a" });
55

66
for (const [name, value] of Object.entries(process.env)) {
77
try {
8-
stream.write(`${name}=${value}\n`);
8+
stream.write(`${name}<<EEEOOOFFF\n${value}\nEEEOOOFFF\n`); // << syntax accommodates multiline strings.
99
} catch (err) {
1010
console.log(`error: failed to set output for ${name}: ${err.message}`);
1111
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ runs:
5959

6060
- name: Setup Node
6161
if: inputs.tools == 'all' || contains(inputs.tools, 'nodejs')
62-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
62+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
6363
with:
6464
node-version: 20.x
6565
registry-url: https://registry.npmjs.org
6666

6767
- name: Setup DotNet
6868
if: inputs.tools == 'all' || contains(inputs.tools, 'dotnet')
69-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
69+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
7070
with:
7171
dotnet-version: 8.0.x
7272

7373
- name: Setup Python
7474
if: inputs.tools == 'all' || contains(inputs.tools, 'python')
75-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
75+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
7676
with:
7777
python-version: 3.11.8
7878

.github/copilot-instructions.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Pulumi mongodbatlas Provider
2+
3+
The Pulumi mongodbatlas provider is a Go-based Pulumi resource provider that bridges the Terraform provider to Pulumi. It generates SDKs for TypeScript/JavaScript, Python, .NET, Go, and Java. The provider uses the Terraform provider as an upstream source via git submodules.
4+
5+
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
6+
7+
## Working Effectively
8+
9+
### Prerequisites and Environment Setup
10+
- All required dependencies are automatically installed via the `.github/workflows/copilot-setup-steps.yml` workflow
11+
- This includes Go, Node.js, Python, .NET, Gradle, and all necessary Pulumi tools
12+
13+
### Initial Repository Setup
14+
- Initialize the upstream submodule: `make upstream`
15+
16+
### Build Process
17+
- **ALWAYS use `make` targets** - Never run custom commands unless explicitly told to
18+
- **NEVER work directly in the `sdk/` folder** - All SDK generation and building is automated through `make`
19+
- If a `make` target fails, there is something wrong with the environment setup, not the target itself
20+
21+
### Available Make Targets
22+
23+
#### Primary Build Targets:
24+
- `make build` -- Build the provider and all SDKs
25+
- `make provider` -- Build the provider binary
26+
- `make schema` -- Generate the provider schema
27+
- `make tfgen` -- Generate SDKs from schema
28+
- `make upstream` -- Initialize upstream submodule
29+
30+
#### SDK Targets:
31+
- `make build_sdks` -- Build all SDK packages
32+
- `make generate_sdks` -- Generate all SDK source code
33+
- `make build_nodejs` -- Build TypeScript/Node.js SDK
34+
- `make build_python` -- Build Python SDK
35+
- `make build_dotnet` -- Build .NET SDK
36+
- `make build_go` -- Build Go SDK
37+
- `make build_java` -- Build Java SDK
38+
39+
#### Development Targets:
40+
- `make lint_provider` -- Lint provider Go code
41+
- `make test_provider` -- Run provider unit tests
42+
43+
### Build Guidelines:
44+
- **NEVER CANCEL** any build command once started - builds may take several minutes
45+
- Set timeouts to 300+ seconds for build operations
46+
- **DO NOT run tests in `examples/`** - They require cloud credentials and will run in PR workflows
47+
48+
## Repository Structure
49+
50+
### Key Directories:
51+
- `provider/` -- Go provider implementation
52+
- `sdk/` -- Generated SDKs for all languages
53+
- `upstream/` -- Git submodule with the Terraform provider
54+
- `scripts/` -- Build and utility scripts
55+
- `examples/` -- Example Pulumi programs (test framework available but skipped)
56+
57+
### Important Files:
58+
- `Makefile` -- Primary build orchestration with all available targets
59+
- `provider/go.mod` -- Provider dependencies
60+
- `.github/workflows/copilot-setup-steps.yml` -- Environment setup for AI coding agents
61+
- `.github/workflows/` -- CI/CD pipelines
62+
63+
## Development Workflow
64+
65+
### Making Code Changes:
66+
1. Initialize repository: `make upstream`
67+
2. Make changes to provider code in `provider/`
68+
3. Validate with: `make lint_provider`
69+
4. Test with: `make test_provider`
70+
5. Build provider: `make provider`
71+
6. Generate and build SDKs: `make build_sdks`
72+
73+
### Validation Steps:
74+
- Always use `make lint_provider` to lint provider code
75+
- Use `make test_provider` to run provider unit tests
76+
- Use `make build` to validate the full build process
77+
78+
### Working with SDKs:
79+
- **NEVER work directly in `sdk/` folders** - All SDK operations are automated via `make` targets
80+
- All SDKs are generated and built through `make` commands
81+
- TypeScript SDK: Use `make build_nodejs`
82+
- Python SDK: Use `make build_python`
83+
- .NET SDK: Use `make build_dotnet`
84+
- Go SDK: Use `make build_go`
85+
- Java SDK: Use `make build_java`
86+
87+
## Validation Scenarios
88+
89+
### Code Quality Validation:
90+
- Use `make lint_provider` to lint provider Go code
91+
- Use `make test_provider` to run provider unit tests
92+
- Use `make build` to validate full build process
93+
94+
### Manual Code Review:
95+
- Check Go code follows standard patterns
96+
- Validate resource definitions in `provider/resources.go`
97+
- Ensure imports and dependencies are correct
98+
99+
## Common Tasks Reference
100+
101+
### Repository Root Contents:
102+
```
103+
.ci-mgmt.yaml -- CI management configuration
104+
.devcontainer/ -- Dev container setup
105+
.github/ -- GitHub workflows and templates
106+
.gitmodules -- Git submodule configuration
107+
.golangci.yml -- Go linter configuration
108+
.mise.toml -- Mise tool configuration
109+
CONTRIBUTING.md -- Contribution guidelines
110+
Makefile -- Build orchestration with all available targets
111+
README.md -- Project documentation
112+
devbox.json -- Development environment
113+
provider/ -- Go provider implementation
114+
scripts/ -- Build utilities
115+
sdk/ -- Generated SDKs (managed via make targets)
116+
upstream/ -- Terraform provider submodule
117+
```
118+
119+
### Common File Operations:
120+
- **Provider source**: `provider/resources.go` -- Resource definitions
121+
- **Provider tests**: `provider/resources_test.go` -- Unit tests
122+
- **Generated SDKs**: All in `sdk/` directory, managed via `make` targets only
123+
124+
### Common Development Tasks:
125+
- Run provider tests: `make test_provider`
126+
- Build provider: `make provider`
127+
- Generate schema: `make schema`
128+
- Build all SDKs: `make build_sdks`
129+
130+
## Build Expectations
131+
132+
- Provider builds: 1-3 minutes depending on system
133+
- SDK generation: 2-5 minutes for all SDKs
134+
- Individual SDK builds: 30 seconds to 2 minutes each
135+
- Full build (`make build`): 5-10 minutes total
136+
137+
Set timeouts of 300+ seconds for build operations and NEVER CANCEL running builds.
138+
139+
## Critical Reminders
140+
141+
- **ALWAYS** use `make` targets - never run custom commands unless explicitly instructed
142+
- **NEVER** work directly in `sdk/` folders - use `make` targets for all SDK operations
143+
- **DO NOT** run tests in `examples/` - they require cloud credentials
144+
- **FOCUS** on `make` targets for all development, building, and validation tasks

.github/workflows/build_provider.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
- name: Checkout Repo
3939
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4040
with:
41-
persist-credentials: false
41+
persist-credentials: false
42+
- id: esc-secrets
43+
name: Map environment to ESC outputs
44+
uses: ./.github/actions/esc-action
4245
# Without ldid cross-compiling Node binaries on a Linux worker intended to work on darwin-arm64 fails to sign the
4346
# binaries properly and they do not work as expected. See https://github.com/pulumi/pulumi-awsx/issues/1490
4447
- uses: MOZGIII/install-ldid-action@v1
@@ -83,11 +86,11 @@ jobs:
8386
- name: Build provider
8487
run: make "provider-${{ matrix.platform.os }}-${{ matrix.platform.arch }}"
8588
env:
86-
AZURE_SIGNING_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }}
87-
AZURE_SIGNING_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }}
88-
AZURE_SIGNING_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }}
89-
AZURE_SIGNING_KEY_VAULT_URI: ${{ secrets.AZURE_SIGNING_KEY_VAULT_URI }}
90-
SKIP_SIGNING: ${{ secrets.AZURE_SIGNING_CLIENT_ID == '' && secrets.AZURE_SIGNING_CLIENT_SECRET == '' && secrets.AZURE_SIGNING_TENANT_ID == '' && secrets.AZURE_SIGNING_KEY_VAULT_URI == '' }}
89+
AZURE_SIGNING_CLIENT_ID: ${{ steps.esc-secrets.outputs.AZURE_SIGNING_CLIENT_ID }}
90+
AZURE_SIGNING_CLIENT_SECRET: ${{ steps.esc-secrets.outputs.AZURE_SIGNING_CLIENT_SECRET }}
91+
AZURE_SIGNING_TENANT_ID: ${{ steps.esc-secrets.outputs.AZURE_SIGNING_TENANT_ID }}
92+
AZURE_SIGNING_KEY_VAULT_URI: ${{ steps.esc-secrets.outputs.AZURE_SIGNING_KEY_VAULT_URI }}
93+
SKIP_SIGNING: ${{ steps.esc-secrets.outputs.AZURE_SIGNING_CLIENT_ID == '' && secrets.AZURE_SIGNING_CLIENT_SECRET == '' && secrets.AZURE_SIGNING_TENANT_ID == '' && secrets.AZURE_SIGNING_KEY_VAULT_URI == '' }}
9194

9295
- name: Package provider
9396
run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }}

.github/workflows/build_sdk.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ on:
1010
type: string
1111

1212
env:
13+
AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID: ${{ secrets.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }}
14+
AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY: ${{ secrets.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }}
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1316
MONGODB_ATLAS_ORG_ID: ${{ secrets.MONGODB_ATLAS_ORG_ID }}
1417
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY }}
1518
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY }}
1619
PULUMI_API: https://api.pulumi-staging.io
20+
PULUMI_BOT_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
1721
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
1822
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
23+
RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }}
24+
RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }}
25+
S3_COVERAGE_BUCKET_NAME: ${{ secrets.S3_COVERAGE_BUCKET_NAME }}
26+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1927
TF_APPEND_USER_AGENT: pulumi
2028
PROVIDER_VERSION: ${{ inputs.version }}
2129

@@ -38,7 +46,10 @@ jobs:
3846
- name: Checkout Repo
3947
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4048
with:
41-
persist-credentials: false
49+
persist-credentials: false
50+
- id: esc-secrets
51+
name: Map environment to ESC outputs
52+
uses: ./.github/actions/esc-action
4253
- name: Cache examples generation
4354
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
4455
with:
@@ -105,7 +116,7 @@ jobs:
105116
106117
# Push with pulumi-bot credentials to trigger a re-run of the
107118
# workflow. https://github.com/orgs/community/discussions/25702
108-
git push https://pulumi-bot:${{ secrets.PULUMI_BOT_TOKEN }}@github.com/${{ github.repository }} \
119+
git push https://pulumi-bot:${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}@github.com/${{ github.repository }} \
109120
"HEAD:$HEAD_REF"
110121
env:
111122
# head_ref is untrusted so it's recommended to pass via env var to

.github/workflows/command-dispatch.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt
22

33
env:
4+
AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID: ${{ secrets.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }}
5+
AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY: ${{ secrets.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }}
6+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
47
MONGODB_ATLAS_ORG_ID: ${{ secrets.MONGODB_ATLAS_ORG_ID }}
58
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY }}
69
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY }}
710
PULUMI_API: https://api.pulumi-staging.io
11+
PULUMI_BOT_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
812
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
913
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
14+
RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }}
15+
RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }}
16+
S3_COVERAGE_BUCKET_NAME: ${{ secrets.S3_COVERAGE_BUCKET_NAME }}
17+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1018
TF_APPEND_USER_AGENT: pulumi
19+
1120
jobs:
1221
command-dispatch-for-testing:
1322
name: command-dispatch-for-testing
@@ -16,7 +25,10 @@ jobs:
1625
- name: Checkout Repo
1726
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1827
with:
19-
persist-credentials: false
28+
persist-credentials: false
29+
- id: esc-secrets
30+
name: Map environment to ESC outputs
31+
uses: ./.github/actions/esc-action
2032
- uses: peter-evans/slash-command-dispatch@13bc09769d122a64f75aa5037256f6f2d78be8c4 # v4
2133
with:
2234
commands: |
@@ -26,7 +38,7 @@ jobs:
2638
permission: write
2739
reaction-token: ${{ secrets.GITHUB_TOKEN }}
2840
repository: pulumi/pulumi-mongodbatlas
29-
token: ${{ secrets.PULUMI_BOT_TOKEN }}
41+
token: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}
3042
name: command-dispatch
3143
on:
3244
issue_comment:

.github/workflows/community-moderation.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt
22

3-
env:
4-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
jobs:
64
warn_codegen:
75
name: warn_codegen
@@ -10,7 +8,10 @@ jobs:
108
- name: Checkout Repo
119
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1210
with:
13-
persist-credentials: false
11+
persist-credentials: false
12+
- id: esc-secrets
13+
name: Map environment to ESC outputs
14+
uses: ./.github/actions/esc-action
1415
- id: schema_changed
1516
name: Check for diff in schema
1617
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
jobs:
17+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
18+
copilot-setup-steps:
19+
runs-on: ubuntu-latest
20+
21+
# Set the permissions to the lowest permissions possible needed for your steps.
22+
# Copilot will be given its own token for its operations.
23+
permissions:
24+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
25+
contents: read
26+
27+
# You can define any steps you want, and they will run before the agent starts.
28+
# If you do not check out your code, Copilot will do this for you.
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v5
32+
with:
33+
persist-credentials: false
34+
35+
- name: Setup tools
36+
uses: ./.github/actions/setup-tools
37+
with:
38+
tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java
39+
40+
- name: Prepare local workspace
41+
# this runs install_plugins and upstream
42+
run: make prepare_local_workspace

.github/workflows/export-repo-secrets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
app-id: 1256780 # Export Secrets GitHub App
1414
private-key: ${{ secrets.EXPORT_SECRETS_PRIVATE_KEY }}
1515
- name: Export secrets to ESC
16-
uses: pulumi/esc-export-secrets-action@v1
16+
uses: pulumi/esc-export-secrets-action@9d6485759b6adff2538ae91f1b77cc96265c9dad # v1
1717
with:
1818
organization: pulumi
1919
org-environment: imports/github-secrets

.github/workflows/license.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@ on:
77
inputs: {}
88

99
env:
10+
AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID: ${{ secrets.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }}
11+
AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY: ${{ secrets.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }}
12+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1013
MONGODB_ATLAS_ORG_ID: ${{ secrets.MONGODB_ATLAS_ORG_ID }}
1114
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY }}
1215
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY }}
1316
PULUMI_API: https://api.pulumi-staging.io
17+
PULUMI_BOT_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
1418
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
1519
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
20+
RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }}
21+
RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }}
22+
S3_COVERAGE_BUCKET_NAME: ${{ secrets.S3_COVERAGE_BUCKET_NAME }}
23+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1624
TF_APPEND_USER_AGENT: pulumi
1725

1826
jobs:

0 commit comments

Comments
 (0)