question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(pipelines): add a way to add steps that aren't attached to stages

See original GitHub issue

We receive an error “The given Stage construct (‘foo/bar’) should contain at least one Stack” when migrating our code to the modern pipelines.

Reproduction Steps

pipeline.addStage(new cdk.Stage(scope, 'MyStage'));

What did you expect to happen?

We would like to continue adding custom stages containing only CodeBuild projects and/or Lambda Invoke actions. Not all of our stages have stacks.

Environment

  • CDK CLI Version : 1.117.0 (build 0047c98)
  • Framework Version: 1.117.0 (build 0047c98)
  • Node.js Version: v14.15.0
  • OS : macOS
  • Language (Version): TypeScript

Workaround

  const stage = new cdk.Stage(scope, 'MyStage');
  new cdk.Stack(stage, 'EmptyStackRemoveThis', {
    stackName: 'EmptyStackRemoveThis',
  });

This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
markuslcommented, Aug 9, 2021

@rix0rrr thanks, addWave works indeed.

So basically, you cannot do this:

pipeline.addStage(createInfra('dev', ...));
pipeline.addStage(createInfra('test', ...));
pipeline.addStage(createInfra('prod', ...));

// Does not deploy stacks but only runs some post-production actions (CodeBuild/Lambdas)

const postproductionStage = new cdk.Stage(scope, 'PostProduction');
// ... add actions

pipeline.addStage(postproductionStage);

Instead users can do this:

pipeline.addStage(createInfra('dev', ...));
pipeline.addStage(createInfra('test', ...));
pipeline.addStage(createInfra('prod', ...));

// Does not deploy stacks but only runs some post-production actions (CodeBuild/Lambdas)
const postproductionWave = pipeline.addWave('PostProduction');
postproductionWave.addPost(...);

I have to admit that it was not very intuitive to use addWave to add a CodePipeline stage instead of using addStage for adding a stage 😃 In general, the new API seems quite intuitive and easy to use but maybe more of these use cases could be clarified in the docs?

Br, Markus

0reactions
nnboskocommented, Aug 18, 2021

Still occurring in version 119.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stages in Azure Pipelines - Microsoft Learn
A stage is a logical boundary in the pipeline. It can be used to mark separation of concerns (for example, Build, QA, and...
Read more >
Pipeline Steps - Amazon SageMaker - AWS Documentation
Use a processing step to create a processing job for data processing. For more information on processing jobs, see Process Data and Evaluate...
Read more >
Adding pipeline stages - Lever Support
How to add pipeline stages · Pipeline and archive reasons settings page. · Arrow pointing to Add Stage button to the upper-right of...
Read more >
Add stages and jobs using the pipeline visual builder (#258970 ...
Out of scope: Needs dependencies #258971. Feedback needed! See the designs attached below and provide feedback in design comments. ⬇. Further details.
Read more >
CI/CD pipelines explained: Everything you need to know
The benefits of a CI/CD pipeline include the following: Efficient software development. Smaller iterations (steps) allow for easier and more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found