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

Update deployments PATCH endpoint to make more targeted updates with slugs #17027

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Feb 6, 2025

This PR updates the PATCH /deployments/{id} route to handle targeted updates to deployment schedules via the newly introduced deployment schedule slugs.

If not all existing schedules have slugs then we'll fall back to the existing logic where are schedules are recreated to match the request.

If the existing schedules have slugs, but not all provided schedules have slugs, then we'll return a 422 to avoid accidentally blowing away schedules.

Otherwise, we'll use the existing slugs and the provided slugs to make targeted updates to the deployment's schedules.

This update will allow us to use the PATCH endpoint in the SDK, which will prevent the updates made from the SDK from blasting away changes made in the UI (related to #14973).

Copy link

codspeed-hq bot commented Feb 6, 2025

CodSpeed Performance Report

Merging #17027 will not alter performance

Comparing patch-schedules (92eeefa) with main (e38b549)

Summary

✅ 2 untouched benchmarks

@desertaxle desertaxle changed the title Update deployments patch endpoint to make more targeted updates with slugs Update deployments PATCH endpoint to make more targeted updates with slugs Feb 7, 2025
@desertaxle desertaxle marked this pull request as ready for review February 7, 2025 03:39
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

this LGTM! left one optional suggestion for names

@cicdw
Copy link
Member

cicdw commented Feb 7, 2025

Test flake should be fixed with #17044

@desertaxle desertaxle merged commit e93ae0f into main Feb 7, 2025
47 of 48 checks passed
@desertaxle desertaxle deleted the patch-schedules branch February 7, 2025 17:34
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.

2 participants