Skip to content

Do not create CI scan job when CI image is not built#9267

Merged
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/update-ci-scan-rules
Sep 26, 2023
Merged

Do not create CI scan job when CI image is not built#9267
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/update-ci-scan-rules

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented Sep 26, 2023

🛠 Summary of changes

This PR fixes a bug in #9231 where the build-ci-image is not added to the pipeline but the ecr-scan-ci is in the pipeline and depends on it. There is no built-in functionality to not run a job if it depends on a job that is not being run. This PR attempts to fix it by using the same rules for both jobs.

Unable to create pipeline
  'ecr-scan-ci' job needs 'build-ci-image' job, but 'build-ci-image' is not in any previous stage

changelog: Internal, Continuous Integration, Do not create CI image scan job when CI image is not built
Copy link
Contributor

@timothy-spencer timothy-spencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh, I like this.

@timothy-spencer
Copy link
Contributor

Another way to solve this is to not have dependencies on jobs, and just rely on stages to ensure that what is required gets done before it gets to this job. It's a bit less fast, but it's easier when the pipeline is somewhat complex like we have.

@mitchellhenke
Copy link
Contributor Author

Another way to solve this is to not have dependencies on jobs, and just rely on stages to ensure that what is required gets done before it gets to this job. It's a bit less fast, but it's easier when the pipeline is somewhat complex like we have.

I couldn't quite figure out a way to "group" the two jobs together and share a set of rules for running (in a distinct stage or otherwise). Would very much like to simplify, so very much open to suggestions!

@mitchellhenke mitchellhenke merged commit 42a9497 into main Sep 26, 2023
@mitchellhenke mitchellhenke deleted the mitchellhenke/update-ci-scan-rules branch September 26, 2023 20:36
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.

2 participants