Skip to content

Bug: Hardcoded stage count in console output #5207

@Detectronic-PB

Description

@Detectronic-PB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions