-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(preprod): Add preprod artifact upload endpoint #92528
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #92528 +/- ##
========================================
Coverage 87.89% 87.89%
========================================
Files 10239 10241 +2
Lines 587377 587712 +335
Branches 22809 22809
========================================
+ Hits 516275 516594 +319
- Misses 70672 70688 +16
Partials 430 430 |
"type": "array", | ||
"items": {"type": "string", "pattern": "^[0-9a-f]{40}$"}, | ||
}, | ||
# Optional metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this where we might need Git sha or other git info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, after writing this doc, I think it's most likely that we'd just include the git info in the request body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we end up creating a 'prepod' app folder? is there any reason why the endpoint and task can't live there instead of the catchall folders?
good catch, I can move the endpoint into it. The task file already existed though (just adding a method into it), so I'll plan to leave it as is assuming that's kosher 🙏 |
ah yup that makes sense. thanks! also feel free to define your own urls file and import them into the main one like here:
|
104af77
to
9a61bbf
Compare
|
||
@region_silo_endpoint | ||
class ProjectPreprodArtifactAssembleEndpoint(ProjectEndpoint): | ||
owner = ApiOwner.OWNERS_INGEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be for our team.
"file_name": data.get("file_name"), | ||
"sha": data.get("sha"), | ||
"build_configuration": data.get("build_configuration"), | ||
"extras": data.get("extras"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extras
shouldn't be part of the external API, these are more for our own internal use. We had a few use-cases in Emerge that were locked down to org42, but let's try to avoid that here if possible for as long as we can.
src/sentry/tasks/assemble.py
Outdated
# 4. Update state to PROCESSED when done (also update the date_built value to reflect when the artifact was built, among other fields) | ||
|
||
except Exception as e: | ||
logger.exception("Failed to assemble preprod artifact") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you record the project/org?
"project_id": project.id, | ||
"checksum": checksum, | ||
"chunks": chunks, | ||
"file_name": data.get("file_name"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we removed filename in our API a while back, do you think the UUID is fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, it's still in our docs. yea I talked w hector about this and neither of us felt strongly. We can just auto-gen a file name and remove this param 👍
"checksum": checksum, | ||
"chunks": chunks, | ||
"file_name": data.get("file_name"), | ||
"sha": data.get("sha"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since this assemble api is doing some checksum stuff, maybe this should be git_sha
?
Upload endpoint described in the emerge size integration proposal
Most of the logic is pretty similar to the debug file and sourcemap upload endpoints
in addition to the unit tests, I've manually tested uploading works via my test sentry-cli branch