Dynamically generate `requires` elements?


Is it possible to dynamically refer to other jobs in the require list by something generated instead of their static names?

I.e. instead of

      - publish-images:
          <<: *something
          name: Build and publish builder images (<< matrix.version >>)
                - main

      - deploy-to-prod-clusters:
          name: Approve Production deployment
            - Build and publish builder images (7.0)
            - Build and publish builder images (6.0)
          type: approval

You could generate something dynamic for requires that points to publish-images as well as all permutations of that?

Not a blocking issue, but I’d like to automate this instead of manually updating things everywhere whenever I add new elements to the matrix.

Thank you in advance.

Sadly no.

The processing of the config.yml file is done at the start of the pipeline job, so everything becomes a static expression of the work to be carried out and the pre-processor does not provide any tools to manipulate the file, beyond basic yaml features such as <<:.

To do anything more complicated you have to use the continuation orb which allows the main config.yml file to create a new .yml file at runtime and then pass control over to it. This could allow you to dynamically expand the requires list based on your current matrix.

Circleci seems to have done a lot of work on this feature, but using it seems to require a very strong understanding of yaml and its supporting tools.