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: API changes to support cancelling tasks #3112

Merged
merged 5 commits into from
Jul 17, 2023
Merged

Conversation

timclifford
Copy link
Contributor

@timclifford timclifford commented Apr 8, 2022

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

This adds support to the API to be able to cancel tasks. There is a permission split to do by production and development environment, and the roles are configured by default to be developer can cancel development environment tasks, and maintainer can cancel production and development environment tasks.

The cancelTask mutation can be called like so

mutation cancelTask {
  cancelTask(input:{
    task: {
      taskName: "lagoon-task-pt2pp5"
      environment: {
        id: 3
        project:{
          id: 18
        }
      }
    }
  })
}

Changes to the UI will be required to support the cancellation of tasks in https://github.com/uselagoon/lagoon-ui

Closing issues

closes #3106

@shreddedbacon
Copy link
Member

I like, but theres some things I think we can do better to better handle cancelling tasks (the controller needs to be updated too, but we should add the initial support into core before we expose task cancelling in the api)

@rocketeerbkw
Copy link
Member

Would close #3106

@tobybellwood
Copy link
Member

Now that the controller can cancel tasks - the approach needs revisiting. @shreddedbacon to assess refactor/rewrite

@shreddedbacon shreddedbacon changed the title WIP: API and UI changes to introduce 'cancel task' feat: API changes to support cancelling tasks Jul 4, 2023
@shreddedbacon shreddedbacon removed their request for review July 4, 2023 05:26
@shreddedbacon shreddedbacon force-pushed the feature/cancel-tasks branch 2 times, most recently from 9e144e4 to 5d97468 Compare July 5, 2023 00:29
Copy link
Contributor

@bomoko bomoko left a comment

Choose a reason for hiding this comment

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

Looks good, and should all work - just added a couple comments/questions. Nice PR!

services/api/src/resources/task/resolvers.ts Outdated Show resolved Hide resolved
services/api/src/resources/task/helpers.ts Outdated Show resolved Hide resolved
services/api/src/resources/task/helpers.ts Show resolved Hide resolved
services/api/src/resources/task/helpers.ts Outdated Show resolved Hide resolved
services/api/src/resources/task/resolvers.ts Show resolved Hide resolved
services/api/src/resources/task/resolvers.ts Outdated Show resolved Hide resolved
@tobybellwood tobybellwood merged commit 5cdbb52 into main Jul 17, 2023
@tobybellwood tobybellwood deleted the feature/cancel-tasks branch July 17, 2023 23:10
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.

Ability to cancel tasks
5 participants