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

Added cancel build endpoint #7605

Merged
merged 41 commits into from
Jun 13, 2024
Merged

Added cancel build endpoint #7605

merged 41 commits into from
Jun 13, 2024

Conversation

vermakhushboo
Copy link
Member

What does this PR do?

Add an endpoint to cancel a build and kill the container.

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

app/controllers/api/functions.php Outdated Show resolved Hide resolved
src/Appwrite/Platform/Workers/Builds.php Outdated Show resolved Hide resolved
@eldadfux eldadfux added product / functions Fixes and upgrades for the Appwrite Functions. version / 1.6 labels Feb 18, 2024
app/config/collections.php Outdated Show resolved Hide resolved
app/controllers/api/functions.php Outdated Show resolved Hide resolved
app/controllers/api/functions.php Outdated Show resolved Hide resolved
src/Appwrite/Platform/Workers/Builds.php Outdated Show resolved Hide resolved
Comment on lines 198 to 201
$build = $dbForProject->getDocument('builds', $buildId);
if ($build->getAttribute('status') === 'cancelled') {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this check above, do we need to duplicate it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see duplication in other places too

Copy link
Member Author

Choose a reason for hiding this comment

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

The duplication is intentional, since cancellation can happen at any stage and we should save compute by capturing it before time consuming tasks.

@christyjacob4 christyjacob4 changed the base branch from main to 1.6.x April 26, 2024 08:58
@vermakhushboo
Copy link
Member Author

TODO: Check how to compute duration for cancelled build

@christyjacob4 christyjacob4 merged commit 83d6061 into 1.6.x Jun 13, 2024
23 checks passed
@christyjacob4 christyjacob4 deleted the feat-cancel-build-deployment branch June 13, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / functions Fixes and upgrades for the Appwrite Functions.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants