Update pipeline import to create a new version instead of patching#291
Merged
Conversation
30d0476 to
4f8eb80
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
abrahamy
previously approved these changes
Dec 5, 2025
abrahamy
reviewed
Dec 5, 2025
Comment on lines
+396
to
+399
| version_body = version_response.json() | ||
| latest_version = version_body["data"][0] | ||
| version_id = latest_version["version_id"] | ||
| is_draft = latest_version.get("is_draft", False) |
Contributor
There was a problem hiding this comment.
We are assuming the response is a valid response without checking. If we get another status code like, say, 401 or 403 these lines may raise an error.
Instead let's do the following:
import httpx
try:
version_response = await sef._api.get(...)
version_response.raise_for_status()
except httpx.HTTPStatusError as e:
if e.response.status_code != HTTPStatus.NOT_FOUND:
raise
# the pipeline does not exist, let's create it.
return await self._api.create_pipeline(...)
# pass the response
version_body = ...
if is_draft:
# do draft things
return
# do non-draft things
abrahamy
approved these changes
Dec 5, 2025
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.
Related Issues
Proposed Changes?
Previously, in #283, we updated the pipeline import to fetch the latest pipeline version and patch that.
Instead, we want the following behavior:
How did you test it?
Changes in unit and integration tests.
And tried out via the import script.
Checklist