Skip to content

fix(debugfile): Recognize chunk-uploaded Proguard files#81131

Merged
szokeasaurusrex merged 1 commit intomasterfrom
szokeasaurusrex/fix-proguard-chunk-upload
Nov 22, 2024
Merged

fix(debugfile): Recognize chunk-uploaded Proguard files#81131
szokeasaurusrex merged 1 commit intomasterfrom
szokeasaurusrex/fix-proguard-chunk-upload

Conversation

@szokeasaurusrex
Copy link
Copy Markdown
Member

@szokeasaurusrex szokeasaurusrex commented Nov 21, 2024

The detect_dif_from_path function does not correctly identify Proguard files which are chunk uploaded because these files have a randomly-assigned temporary path, and the logic tries to guess whether the file is a Proguard file based on its path. However, the detect_dif_from_path function also takes an optional name option, which for chunk-uploaded files, is the file name that is specified by the client making the assemble call. This has not been a problem yet, since Sentry CLI does not support chunk uploading Proguard files, but we are adding support in getsentry/sentry-cli#2196, and so we need to fix the backend to allow chunk uploads of Proguard files.

Here, we update the logic to check both the path and the name for potentially matching a Proguard file.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 21, 2024
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-proguard-chunk-upload branch from 7f18af5 to 2556e35 Compare November 21, 2024 17:36
@szokeasaurusrex
Copy link
Copy Markdown
Member Author

@asottile-sentry I updated the tests per your suggestion. Please let me know whether this looks good now

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 21, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
323 1 322 9
View the top 1 failed tests by shortest run time
::tests.sentry.models.test_debugfile
Stack Traces | 0s run time
No failure message available

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

The `detect_dif_from_path` function does not correctly identify Proguard files which are chunk uploaded because these files have a randomly-assigned temporary path, and the logic tries to guess whether the file is a Proguard file based on its path. However, the `detect_dif_from_path` function also takes an optional `name` option, which for chunk-uploaded files, is the file name that is specified by the client making the assemble call. This has not been a problem yet, since Sentry CLI does not support chunk uploading Proguard files, but we are adding support in getsentry/sentry-cli#2196, and so we need to fix the backend to allow chunk uploads of Proguard files.

Here, we update the logic to check both the `path` and the `name` for potentially matching a Proguard file.
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-proguard-chunk-upload branch from 5aba8a5 to 9b53f32 Compare November 21, 2024 19:02
Copy link
Copy Markdown
Contributor

@asottile-sentry asottile-sentry left a comment

Choose a reason for hiding this comment

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

could make them real paths with tmp_path if you wanted but this seems good enough to me

I have no stake in this particular model / implementation so you may want to get sign off from the actual owners

Copy link
Copy Markdown
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@szokeasaurusrex
Copy link
Copy Markdown
Member Author

I have no stake in this particular model / implementation so you may want to get sign off from the actual owners

Agreed, do you know who the owners might be @asottile-sentry? There is no code owner assigned in GitHub, and it doesn't look like this file gets edited very often

@asottile-sentry
Copy link
Copy Markdown
Contributor

I have no stake in this particular model / implementation so you may want to get sign off from the actual owners

Agreed, do you know who the owners might be @asottile-sentry? There is no code owner assigned in GitHub, and it doesn't look like this file gets edited very often

have no idea -- which sdk generates these types of files? that would be my guess having no context (beyond probably reformatting this or fixing the types)

@szokeasaurusrex
Copy link
Copy Markdown
Member Author

I added @loewenheim and @Swatinem since these files get sent by Sentry CLI, and they were the previous maintainers before I took over. Looks like they have touched the file before

szokeasaurusrex added a commit to getsentry/sentry-cli that referenced this pull request Nov 21, 2024
Introduce an experimental chunk uploading feature for the `sentry-cli upload-proguard` command. The feature can be activated by setting the `SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD` environment variable to `1`. The feature is only activated when users opt in via this environment variable.

The experimental chunk uploading feature is not backwards compatible. We attempt the upload regardless of whether the server supports receiving chunk-uploaded Proguard files. Server-side support will only be available once getsentry/sentry#81131 is released. The goal here was to create something that works, so some optimizations that we use for other chunk uploaded file types (e.g. first checking whether any chunks are present on the server, and only uploading the missing ones), are not implemented for Proguard.

Ref #2196
szokeasaurusrex added a commit to getsentry/sentry-cli that referenced this pull request Nov 21, 2024
Introduce an experimental chunk uploading feature for the `sentry-cli upload-proguard` command. The feature can be activated by setting the `SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD` environment variable to `1`. The feature is only activated when users opt in via this environment variable.

The experimental chunk uploading feature is not backwards compatible. We attempt the upload regardless of whether the server supports receiving chunk-uploaded Proguard files. Server-side support will only be available once getsentry/sentry#81131 is released. The goal here was to create something that works, so some optimizations that we use for other chunk uploaded file types (e.g. first checking whether any chunks are present on the server, and only uploading the missing ones), are not implemented for Proguard.

Ref #2196
szokeasaurusrex added a commit to getsentry/sentry-cli that referenced this pull request Nov 21, 2024
Introduce an experimental chunk uploading feature for the `sentry-cli upload-proguard` command. The feature can be activated by setting the `SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD` environment variable to `1`. The feature is only activated when users opt in via this environment variable.

The experimental chunk uploading feature is not backwards compatible. We attempt the upload regardless of whether the server supports receiving chunk-uploaded Proguard files. Server-side support will only be available once getsentry/sentry#81131 is released. The goal here was to create something that works, so some optimizations that we use for other chunk uploaded file types (e.g. first checking whether any chunks are present on the server, and only uploading the missing ones), are not implemented for Proguard.

Ref #2196
@szokeasaurusrex szokeasaurusrex merged commit 7c7e79f into master Nov 22, 2024
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/fix-proguard-chunk-upload branch November 22, 2024 13:09
szokeasaurusrex added a commit to getsentry/sentry-cli that referenced this pull request Nov 22, 2024
Introduce an experimental chunk uploading feature for the `sentry-cli upload-proguard` command. The feature can be activated by setting the `SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD` environment variable to `1`. The feature is only activated when users opt in via this environment variable.

The experimental chunk uploading feature is not backwards compatible. We attempt the upload regardless of whether the server supports receiving chunk-uploaded Proguard files. Server-side support will only be available once getsentry/sentry#81131 is released. The goal here was to create something that works, so some optimizations that we use for other chunk uploaded file types (e.g. first checking whether any chunks are present on the server, and only uploading the missing ones), are not implemented for Proguard.

Ref #2196
szokeasaurusrex added a commit to getsentry/sentry-cli that referenced this pull request Nov 22, 2024
Introduce an experimental chunk uploading feature for the `sentry-cli
upload-proguard` command. The feature can be activated by setting the
`SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD` environment variable to `1`.
The feature is only activated when users opt in via this environment
variable.

The experimental chunk uploading feature is not backwards compatible. We
attempt the upload regardless of whether the server supports receiving
chunk-uploaded Proguard files. Server-side support will only be
available once getsentry/sentry#81131 is
released. The goal here was to create something that works, so some
optimizations that we use for other chunk uploaded file types (e.g.
first checking whether any chunks are present on the server, and only
uploading the missing ones), are not implemented for Proguard.

Ref #2196
iamrajjoshi pushed a commit that referenced this pull request Nov 24, 2024
The `detect_dif_from_path` function does not correctly identify Proguard
files which are chunk uploaded because these files have a
randomly-assigned temporary path, and the logic tries to guess whether
the file is a Proguard file based on its path. However, the
`detect_dif_from_path` function also takes an optional `name` option,
which for chunk-uploaded files, is the file name that is specified by
the client making the assemble call. This has not been a problem yet,
since Sentry CLI does not support chunk uploading Proguard files, but we
are adding support in
getsentry/sentry-cli#2196, and so we need to
fix the backend to allow chunk uploads of Proguard files.

Here, we update the logic to check both the `path` and the `name` for
potentially matching a Proguard file.
harshithadurai pushed a commit that referenced this pull request Nov 25, 2024
The `detect_dif_from_path` function does not correctly identify Proguard
files which are chunk uploaded because these files have a
randomly-assigned temporary path, and the logic tries to guess whether
the file is a Proguard file based on its path. However, the
`detect_dif_from_path` function also takes an optional `name` option,
which for chunk-uploaded files, is the file name that is specified by
the client making the assemble call. This has not been a problem yet,
since Sentry CLI does not support chunk uploading Proguard files, but we
are adding support in
getsentry/sentry-cli#2196, and so we need to
fix the backend to allow chunk uploads of Proguard files.

Here, we update the logic to check both the `path` and the `name` for
potentially matching a Proguard file.
evanh pushed a commit that referenced this pull request Nov 25, 2024
The `detect_dif_from_path` function does not correctly identify Proguard
files which are chunk uploaded because these files have a
randomly-assigned temporary path, and the logic tries to guess whether
the file is a Proguard file based on its path. However, the
`detect_dif_from_path` function also takes an optional `name` option,
which for chunk-uploaded files, is the file name that is specified by
the client making the assemble call. This has not been a problem yet,
since Sentry CLI does not support chunk uploading Proguard files, but we
are adding support in
getsentry/sentry-cli#2196, and so we need to
fix the backend to allow chunk uploads of Proguard files.

Here, we update the logic to check both the `path` and the `name` for
potentially matching a Proguard file.
andrewshie-sentry pushed a commit that referenced this pull request Dec 2, 2024
The `detect_dif_from_path` function does not correctly identify Proguard
files which are chunk uploaded because these files have a
randomly-assigned temporary path, and the logic tries to guess whether
the file is a Proguard file based on its path. However, the
`detect_dif_from_path` function also takes an optional `name` option,
which for chunk-uploaded files, is the file name that is specified by
the client making the assemble call. This has not been a problem yet,
since Sentry CLI does not support chunk uploading Proguard files, but we
are adding support in
getsentry/sentry-cli#2196, and so we need to
fix the backend to allow chunk uploads of Proguard files.

Here, we update the logic to check both the `path` and the `name` for
potentially matching a Proguard file.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants