Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

Pulumi stack output queries are slow. This adds caching to avoid repeated CLI invocations.

Changes

  • Cache storage: .webiny/caches/stack-output/{appName}-{env}-{region}-{variant}.json
  • Added skipCache parameter to PulumiGetStackOutputService.Params to bypass/refresh cache
  • Auto-refresh on deploy: DeployApp now calls the service with skipCache: true after successful deployments
  • Implementation: Async file I/O, handles race conditions with recursive mkdir, graceful cache miss handling

Usage

// Normal usage - reads from cache if available
const output = await pulumiGetStackOutputService.execute(app);

// Force refresh - skips cache and updates it
const output = await pulumiGetStackOutputService.execute(app, { skipCache: true });

Cache is automatically updated after each deployment and properly isolated by environment/region/variant context.

Original prompt

let's add caching in packages/project/src/services/PulumiGetStackOutputService/PulumiGetStackOutputService.ts
we want the cache to be stored in .webiny/caches/stack-output.
cache key must take env / region / variant into consideration.
in PulumiGetStackOutputService.Params, we need to add skipCache option, which will skip cache and update the cache in .webiny folder again.
finally, this option must be used when the deploy is done in packages/project/src/features/DeployApp/DeployApp.ts. We ca add it between

    // Promise is returned so that the caller can await it if needed.
    await pulumiProcess;
    await output;

The user has attached the following files from their workspace:

  • packages/project/src/features/DeployApp/DeployApp.ts

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add caching to PulumiGetStackOutputService Add caching to PulumiGetStackOutputService with skipCache option Jan 6, 2026
Copilot AI requested a review from adrians5j January 6, 2026 13:41
@Pavel910 Pavel910 added this to the 6.0.0 milestone Jan 6, 2026
@adrians5j adrians5j marked this pull request as ready for review January 9, 2026 12:50
@adrians5j adrians5j merged commit 636d3c6 into next Jan 9, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants