feat: Add PUT endpoint for versions and related tests#16
Merged
Conversation
d502026 to
5335864
Compare
d35998b to
121d946
Compare
Collaborator
Author
|
Thanks @immortalcodes , addressed your comment and added the following since you last looked:
I'll flag the new bits in the changed files so that it's easier as well |
mtruj013
commented
Apr 21, 2026
| {"product_slug": "does-not-exist"}, | ||
| ) | ||
|
|
||
| def test_update_version_lifecycle_date_before_release_date_returns_400(self): |
Collaborator
Author
There was a problem hiding this comment.
This and the following tests are new
mtruj013
commented
Apr 21, 2026
| ) | ||
|
|
||
|
|
||
| def validate_dates_after_release( |
mtruj013
commented
Apr 21, 2026
Comment on lines
+441
to
+478
| effective_release_date_str = (data.get("release_date", {}) or {}).get( | ||
| "date" | ||
| ) or (version.release_date or {}).get("date") | ||
|
|
||
| if effective_release_date_str: | ||
| try: | ||
| effective_release_date = date.fromisoformat( | ||
| effective_release_date_str | ||
| ) | ||
| except (TypeError, ValueError): | ||
| effective_release_date = None | ||
|
|
||
| if effective_release_date: | ||
| lifecycle_fields = { | ||
| "supported": data.get("supported", version.supported or {}), | ||
| "esm_pro_supported": data.get( | ||
| "esm_pro_supported", | ||
| version.esm_pro_supported or {}, | ||
| ), | ||
| "break_bug_pro_supported": data.get( | ||
| "break_bug_pro_supported", | ||
| version.break_bug_pro_supported or {}, | ||
| ), | ||
| "legacy_supported": data.get( | ||
| "legacy_supported", | ||
| version.legacy_supported or {}, | ||
| ), | ||
| } | ||
| errors = validate_dates_after_release( | ||
| effective_release_date, lifecycle_fields | ||
| ) | ||
| if errors: | ||
| return { | ||
| "error": { | ||
| "message": "Invalid request.", | ||
| "details": errors, | ||
| } | ||
| }, 400 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Done
QA
Issue / Card
https://warthogs.atlassian.net/browse/WD-33173