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

Gitops promotion workflows #1043

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

NimRegev
Copy link
Contributor

first draft of promotion workflows

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

A Promotion Workflow is run as part of a Promotion Policy, and can be executed before or after the Promotion Action as a Pre-Action or a Post-Action Workflow. The Promotion Action is the action that implements the changes to the environment, for example, commit.
TBD - maybe add examples

##### Pre-commit dry run validation

Choose a reason for hiding this comment

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

it's not really a dry run. when clicking on "run", it will actually run the Argo Workflow in the cluster. if the workflow has any side-effects (sending a message to slack/email, running any post-action tests, or pre-action validations) - they will actually run, and may fail or succeed, and cause those effects.
when clicking on "run", only the "promotion workflow" itself will run, so if it was pre or post action workflow - the action and the other parts that together create the entire promotion release, will not run.

At the simplest levels, you can display the details from the parameters in notifications. In more advanced scenarios, you can customize the Workflow execution based on specific parameters.

{: .table .table-bordered .table-hover}
| Parameters | Description | Passed in<br>Pre- or Post-Action Workflow |
Copy link

@ATGardner ATGardner Aug 26, 2024

Choose a reason for hiding this comment

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

i think the table should have a separate column for pre-action and post-action, with a check-mark wherever a specific argument exists.
image

Choose a reason for hiding this comment

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

any pre-action promotion workflow should have exactly these arguments:

spec:
  arguments:
    parameters:
    - name: APP_NAMESPACE
    - name: APP_NAME
    - name: REPO_URL
    - name: BRANCH
    - name: PATH

any post-action promotion workflow should have exactly these arguments:

spec:
  arguments:
    parameters:
    - name: APP_NAMESPACE
    - name: APP_NAME
    - name: REPO_URL
    - name: BRANCH
    - name: PATH
    - name: COMMIT_SHA
      value: ""
    - name: COMMIT_MESSAGE
      value: ""
    - name: COMMIT_AUTHOR
      value: ""
    - name: COMMIT_DATE
      value: ""

Choose a reason for hiding this comment

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

@idan-codefresh - similarly to how we have an annotation of workflow-origin: promotion, we should enforce an annotation of promotion-stage: pre-action or promotion-stage: post-action
and according to the value - validate the arguments list to match exactly the requirement. and also - have the drop-downs suggest only the correct wftmpls when selecting a pre or post action

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree about two separate columns for Pre and Post but md doesn't allow merging cells so will have an icon indication in both

Implemented feedback comments from Dev
@codefresh-git-integration
Copy link

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.

4 participants