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

Feature/workflows #3045

Merged
merged 39 commits into from
Mar 15, 2022
Merged

Feature/workflows #3045

merged 39 commits into from
Mar 15, 2022

Conversation

bomoko
Copy link
Contributor

@bomoko bomoko commented Feb 23, 2022

The following PR introduces the "Workflows" feature to Lagoon.

Essentially this is an extension of the custom task system that allows users to specify tasks that respond to standard Lagoon events. Post deployment, for instance, we may need to run some custom image based task in the namespace.

API Changes

This introduces changes to the api to add/remove/resolve workflows, as well as making some changes to the custom task system (as well as their associated type changes):

  • addWorkflow
  • updateWorkflow
  • deleteWorkflow
  • workflowsForEnvironment
  • getWorkflowsByEnvironmentId
  • resolveAdvancedTaskDefinitionsForWorkflow

Perhaps most important is the structure of the workflow.

 type Workflow {
    id: Int
    name: String
    event: String
    project: Int
    advancedTaskDefinition: AdvancedTaskDefinition
  }

The important point here is the "event" type. Currently the events recognized are defined here https://github.com/uselagoon/lagoon/blob/14fd77347ad940e3aee2a4d8ce2d878fec328f0b/services/workflows/internal/lagoonclient/eventClassification.go

New service introduced

This PR also introduces the service ("workflows") that watches the "lagoon-log" queue for incoming events. On an event, workflows will query the API to determine if there is an associated workflow for the project and, if there's a match, it will invoke workflow.

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for changelog and subsystem label(s) applied

Explain the details for making this change. What existing problem does the pull request solve?

Closing issues

Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

bomoko and others added 30 commits September 2, 2021 13:22
…tionResolvers

updating advanced task resolver and permissions
…teWorkflowsAPIchanges

Workflows/add and update workflows ap ichanges
@bomoko bomoko changed the base branch from feature/workflows to main February 23, 2022 00:15
@bomoko bomoko added the on-hold on-hold pending other tasks label Feb 23, 2022
@bomoko bomoko removed the on-hold on-hold pending other tasks label Feb 28, 2022
@tobybellwood tobybellwood requested a review from timclifford March 4, 2022 05:17
@@ -616,3 +671,74 @@ const getAdvancedTaskTarget = advancedTask => {
}
};

// const advancedTaskFunctions = sqlClientPool => {
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: commented out code

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.

3 participants