Test stack, e2e workflow, and new commands for pulumi.yml#1
Test stack, e2e workflow, and new commands for pulumi.yml#1ryan-williams wants to merge 3 commits intov1from
Conversation
✅ pulumi-v1-test: pulumi preview (142d39b)Outputwarning: using pulumi-language-python from $PATH at /usr/local/bin/pulumi-language-python
Previewing update (test):
warning: using pulumi-language-python from $PATH at /usr/local/bin/pulumi-language-python
+ pulumi:pulumi:Stack
+ [urn=urn:pulumi:test::pulumi-v1-test::pulumi:pulumi:Stack::pulumi-v1-test-test]
+ tls:index/privateKey:PrivateKey
+ [urn=urn:pulumi:test::pulumi-v1-test::tls:index/privateKey:PrivateKey::test-key]
+ [provider=urn:pulumi:test::pulumi-v1-test::pulumi:providers:tls::default_5_3_0::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
+ algorithm: "ED25519"
+ aws:cloudwatch/logGroup:LogGroup
+ [urn=urn:pulumi:test::pulumi-v1-test::aws:cloudwatch/logGroup:LogGroup::test-log-group]
+ [provider=urn:pulumi:test::pulumi-v1-test::pulumi:providers:aws::default_7_20_0::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
+ name : "/pulumi-v1/test/test"
+ region : "us-east-1"
+ retentionInDays: 1
+ skipDestroy : false
+ tagsAll : {}
+ aws:iam/role:Role
+ [urn=urn:pulumi:test::pulumi-v1-test::aws:iam/role:Role::test-role]
+ [provider=urn:pulumi:test::pulumi-v1-test::pulumi:providers:aws::default_7_20_0::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
+ assumeRolePolicy : {
+ Statement: [
+ [0]: {
+ Action : "sts:AssumeRole"
+ Effect : "Deny"
+ Principal: {
+ Service: "none.amazonaws.com"
+ }
+ }
+ ]
+ Version : "2012-10-17"
+ }
+ forceDetachPolicies: false
+ maxSessionDuration : 3600
+ name : "pulumi-v1-test-test"
+ path : "/"
+ tagsAll : {}
+ aws:ec2/keyPair:KeyPair
+ [urn=urn:pulumi:test::pulumi-v1-test::aws:ec2/keyPair:KeyPair::test-key-pair]
+ [provider=urn:pulumi:test::pulumi-v1-test::pulumi:providers:aws::default_7_20_0::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
+ keyName : "pulumi-v1-test-test"
+ publicKey : [unknown]
+ region : "us-east-1"
+ tagsAll : {}
--outputs:--
+ key_pair_name : "pulumi-v1-test-test"
+ log_group_name: "/pulumi-v1/test/test"
+ role_arn : [unknown]
Resources:
+ 5 to create |
New commands for full lifecycle management: - `init`: create a new stack, with optional `--secrets-provider` - `destroy`: tear down all resources - `stack-rm`: remove a stack entirely Also fix grep warning: use bracket expression `[`]+` instead of `\`+` for matching backtick runs in the dynamic fence logic.
Test stack (`test/`) with lightweight free AWS resources (EC2 key pair, IAM role, CloudWatch log group) to exercise `pulumi preview --patch` diff output, job summaries, and PR comments. Workflows: - `test.yml`: manual dispatch for individual commands against `test` stack - `e2e.yml`: full lifecycle smoketest with run-ID stack isolation: init → preview → up → preview (nop) → destroy → preview (recreate) → stack-rm
Callers can pass a passphrase for stack encryption; when unset, defaults to empty string, which satisfies Pulumi's passphrase check on self-managed backends (GCS, S3, local) without requiring callers to explicitly set it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a lightweight Pulumi “test” project plus GitHub Actions workflows to exercise and validate the reusable pulumi.yml workflow end-to-end, including new stack-management commands and secrets encryption options.
Changes:
- Introduces a
test/Pulumi Python project that provisions minimal AWS resources for workflow smoke testing. - Adds
test.yml(manual caller) ande2e.yml(multi-step smoketest) workflows that run the reusablepulumi.yml. - Extends
.github/workflows/pulumi.ymlwithinit,destroy, andstack-rmcommands plus an optionalsecrets-providerandPULUMI_CONFIG_PASSPHRASEsupport.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/requirements.txt | Adds Pulumi + AWS/TLS provider deps for the new test stack. |
| test/Pulumi.yaml | Defines the new test Pulumi project and its backend configuration. |
| test/Pulumi.test.yaml | Adds basic stack config (AWS region) for the test stack. |
| test/main.py | Implements the test stack resources (EC2 key pair, IAM role, log group) and exports outputs. |
| .github/workflows/test.yml | Adds a manual-dispatch “caller” workflow to invoke the reusable workflow against test/. |
| .github/workflows/pulumi.yml | Expands the reusable workflow with new commands and secrets-provider/passphrase handling. |
| .github/workflows/e2e.yml | Adds an end-to-end smoketest workflow with run-id-based stack isolation and lifecycle coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import pulumi_aws as aws | ||
| import pulumi_tls as tls | ||
|
|
||
| config = pulumi.Config() |
There was a problem hiding this comment.
config = pulumi.Config() is declared but never used in this stack; if it’s not needed, remove it to avoid unused-variable lint noise, or use it to read required test configuration.
| config = pulumi.Config() |
| public_key=key.public_key_openssh, | ||
| ) | ||
|
|
||
| # IAM Role (no trust policy; just exists for diff testing) |
There was a problem hiding this comment.
The comment says the IAM role has “no trust policy”, but assume_role_policy is explicitly set. Please either adjust the comment to match the code, or change the role definition to align with the intent (e.g., a minimal/valid trust policy for a dummy role).
| # IAM Role (no trust policy; just exists for diff testing) | |
| # IAM Role (deny-all trust policy; just exists for diff testing) |
| backend: | ||
| url: gs://oa-pulumi |
There was a problem hiding this comment.
This project hardcodes a GCS backend (gs://oa-pulumi). That makes the new test/ stack and the reusable workflows non-portable unless that bucket + GCP auth vars exist. Consider making the backend configurable (e.g., omit it here and rely on pulumi login/env in CI, or document the required backend setup for contributors).
| backend: | |
| url: gs://oa-pulumi |
| ${{ inputs.secrets-provider && format('--secrets-provider="{0}"', inputs.secrets-provider) || '' }} | ||
| exit 0 | ||
| ;; | ||
| stack-rm) | ||
| pulumi stack rm ${{ inputs.stack }} --yes --force | ||
| exit 0 |
There was a problem hiding this comment.
init and stack-rm exit before writing pulumi-output.txt, so the “Summary and PR comment” step will always be skipped for these commands. If these commands are intended to be first-class workflow commands, consider capturing their output to pulumi-output.txt (and letting the summary step run) to aid debugging/visibility.
| ${{ inputs.secrets-provider && format('--secrets-provider="{0}"', inputs.secrets-provider) || '' }} | |
| exit 0 | |
| ;; | |
| stack-rm) | |
| pulumi stack rm ${{ inputs.stack }} --yes --force | |
| exit 0 | |
| ${{ inputs.secrets-provider && format('--secrets-provider="{0}"', inputs.secrets-provider) || '' }} \ | |
| 2>&1 | tee pulumi-output.txt | |
| exit ${PIPESTATUS[0]} | |
| ;; | |
| stack-rm) | |
| pulumi stack rm ${{ inputs.stack }} --yes --force \ | |
| 2>&1 | tee pulumi-output.txt | |
| exit ${PIPESTATUS[0]} |
Summary
test/) with lightweight free AWS resources (EC2 key pair, IAM role, CW log group)test.ymlcaller workflow for manual dispatch against the reusable workflowe2e.ymlsmoketest: init → preview → up → preview (nop) → destroy → preview (recreate) → stack-rmpulumi.yml:init,destroy,stack-rmsecrets-providerinput for GCP KMS (or other) secrets encryptionPULUMI_CONFIG_PASSPHRASEas optional secret input (defaults to empty string for self-managed backends)Test plan
--patchdiff output, project prefix, commit link🤖 Generated with Claude Code