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

Bug: Hardcoded stage count in console output #5207

Closed
Detectronic-PB opened this issue May 26, 2023 · 2 comments
Closed

Bug: Hardcoded stage count in console output #5207

Detectronic-PB opened this issue May 26, 2023 · 2 comments
Labels
stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/bug

Comments

@Detectronic-PB
Copy link

Description:

When using a custom template with more than 2 stages, the output still shows:

2 stage(s) were detected, matching the template requirements.

This is due to the hardcoded value on this line.

Steps to reproduce:

  1. Copy the contents of two-stage-pipeline-template into a new repository
  2. Modify metadata.json to: { "number_of_stages": 3 }
  3. Commit changes
  4. Run sam pipeline init
  5. Select '2 - Custom Pipeline Template Location'
  6. Enter repository path

Observed result:

sam pipeline init generates a pipeline configuration file that your CI/CD system
can use to deploy serverless applications using AWS SAM.
We will guide you through the process to bootstrap resources for each stage,
then walk through the details necessary for creating the pipeline config file.

Please ensure you are in the root folder of your SAM application before you begin.

Select a pipeline template to get started:
        1 - AWS Quick Start Pipeline Templates
        2 - Custom Pipeline Template Location
Choice: 2
Template Git location: https://github.com/xxxxxxx/test-aws-pipeline-template

Cloning from https://github.com/xxxxxxx/test-aws-pipeline-template (process may take a moment)
You are using the 3-stage pipeline template.
 _________    _________    _________
|         |  |         |  |         |
| Stage 1 |->| Stage 2 |->| Stage 3 |
|_________|  |_________|  |_________|

Checking for existing stages...

2 stage(s) were detected, matching the template requirements. If these are incorrect, delete .aws-sam/pipeline/pipelineconfig.toml and rerun

Expected result:

sam pipeline init generates a pipeline configuration file that your CI/CD system
can use to deploy serverless applications using AWS SAM.
We will guide you through the process to bootstrap resources for each stage,
then walk through the details necessary for creating the pipeline config file.

Please ensure you are in the root folder of your SAM application before you begin.

Select a pipeline template to get started:
        1 - AWS Quick Start Pipeline Templates
        2 - Custom Pipeline Template Location
Choice: 2
Template Git location: https://github.com/xxxxxxx/test-aws-pipeline-template

Cloning from https://github.com/xxxxxxx/test-aws-pipeline-template (process may take a moment)
You are using the 3-stage pipeline template.
 _________    _________    _________
|         |  |         |  |         |
| Stage 1 |->| Stage 2 |->| Stage 3 |
|_________|  |_________|  |_________|

Checking for existing stages...

3 stage(s) were detected, matching the template requirements. If these are incorrect, delete .aws-sam/pipeline/pipelineconfig.toml and rerun
@Detectronic-PB Detectronic-PB added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label May 26, 2023
@moelasmar moelasmar added type/bug and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels May 26, 2023
@moelasmar
Copy link
Contributor

thanks @Detectronic-PB for raising this issue. I pushed a PR to resolve this issue, and should be released in the next SAM CLI release.

@moelasmar moelasmar added the stage/waiting-for-release Fix has been merged to develop and is waiting for a release label May 27, 2023
@github-actions
Copy link
Contributor

Patch is released in v1.85.0. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/bug
Projects
None yet
Development

No branches or pull requests

2 participants