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

feat: fail to apply the promise if there are duplicated workflow names #91

Open
SaphMB opened this issue Mar 7, 2024 · 3 comments
Open
Labels
debuggability Tickets that are focussed on making the debugging & building of promises easier enhancement New feature or request R&D Denotes work that qualifies for R&D tax credits

Comments

@SaphMB
Copy link
Member

SaphMB commented Mar 7, 2024

A promise cannot contain workflows with duplicated names, like in the example below:

apiVersion: platform.kratix.io/v1alpha1
kind: Promise
metadata:
  name: jenkins
spec:
  # ...
  workflows:
    resource: # or promise:
      configure: # or delete
      - apiVersion: platform.kratix.io/v1alpha1
        kind: Pipeline
        metadata:
          name: my-pipeline  # <<<< duplicated
        spec:
          containers:
          - image: ghcr.io/syntasso/kratix-marketplace/a-configure-pipeline:v0.1.0
            name: configure-pipeline-1
          - image: ghcr.io/syntasso/kratix-marketplace/b-configure-pipeline:v0.1.0
            name: configure-pipeline-2
      - apiVersion: platform.kratix.io/v1alpha1
        kind: Pipeline
        metadata:
          name: my-pipeline  # <<<< duplicated
        spec:
          containers:
          - image: ghcr.io/syntasso/kratix-marketplace/b-configure-pipeline:v0.1.0
            name: configure-pipeline

That's because the pipeline name is used in the Work that's created by the pipeline.

However, when the user applies this promise, Kratix accepts it. The user will only find out the problem much later, and even so it will be a bit obscure for them to find out whats wrong.

A better experience would be to fail the apply, and output a message with the reason why.

@SaphMB SaphMB added this to the multiple-workflows milestone Mar 7, 2024
@SaphMB SaphMB added enhancement New feature or request R&D Denotes work that qualifies for R&D tax credits labels Mar 7, 2024
@kirederik

This comment was marked as resolved.

@SaphMB

This comment was marked as resolved.

@kirederik

This comment was marked as resolved.

@richcooper95 richcooper95 removed this from the multiple-workflows milestone Apr 25, 2024
@kirederik kirederik changed the title Feat: Inform users when they use a non-unique configure pipeline name and fail feat: fail to apply the promise if there are duplicated workflow names Apr 30, 2024
@catmo-syntasso catmo-syntasso added the debuggability Tickets that are focussed on making the debugging & building of promises easier label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debuggability Tickets that are focussed on making the debugging & building of promises easier enhancement New feature or request R&D Denotes work that qualifies for R&D tax credits
Projects
None yet
Development

No branches or pull requests

4 participants