Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor StackSelector for public interface #32706

Closed
mrgrain opened this issue Jan 1, 2025 · 2 comments
Closed

Refactor StackSelector for public interface #32706

mrgrain opened this issue Jan 1, 2025 · 2 comments
Assignees
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@mrgrain
Copy link
Contributor

mrgrain commented Jan 1, 2025

Within the new programmatic toolkit, StackSelector will become part of the public interface. However the current API and implementation is not ideal.

Goal

StackSelector and all related options should adhere to the interface as defined here:

export interface StackSelector {
/**
* A list of patterns to match the stack hierarchical ids
*/
patterns: string[];
/**
* Extend the selection to upstream/downstream stacks
* @default ExtendedStackSelection.None only select the specified stacks.
*/
extend?: ExtendedStackSelection;
/**
* The behavior if if no selectors are provided.
*/
strategy: StackSelectionStrategy;
}

Steps

  1. In CloudAssembly, merge StackSelector with SelectStacksOptions so that selectStacks() only takes a StackSelector.
  2. In existing CdkToolkit, change all selectStacksFor* helper methods to take a single stack selector only with now other options. In other words, unify the syntax to always take a CloudAssembly and StackSelector. Merge other options into the stack selector.
  3. In CdkToolkit for actions synth, diff, deploy, watch & destroy - merge the exclusively flag into StackSelector because that is the only place it is used.
  4. Start reducing the now extended options:
  • exclusively should map directly to ExtendedStackSelection.None
  • autoValidate ???
  • ignoreNoStacks should map to a StackSelectionStrategy.None
@mrgrain mrgrain added the p2 label Jan 1, 2025
@ashishdhingra ashishdhingra added feature-request A feature should be added or improved. effort/medium Medium work item – several days of effort labels Jan 2, 2025
@mrgrain mrgrain closed this as completed Jan 16, 2025
@mrgrain mrgrain assigned mrgrain and unassigned kaizencc Jan 16, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Jan 16, 2025

Completed in #32928

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants