Skip to content

Jerry test may 21 #165

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Jerry test may 21 #165

wants to merge 5 commits into from

Conversation

JerrySentry
Copy link
Contributor

No description provided.

joseph-sentry and others added 4 commits May 16, 2025 12:55
the serializer was looking for the wrong fields, so this endpoint was
not passing the build_url and job to the upload task which meant
test result uploads have been missing that information
@codecov codecov deleted a comment from seer-by-sentry bot May 21, 2025
@codecov codecov deleted a comment from seer-by-sentry bot May 21, 2025
Copy link

overwatch-beta bot commented May 21, 2025

Sentry detected 5 potential issues in your recent changes

Tokenless upload handlers expect `job`, but API expects `code`, causing server crashes due to missing field.
  • Description: Tokenless upload handlers still expect the job field, but the API now expects code. When users upload data using the new field name code, the tokenless upload handlers will look for job which will be missing. In handlers like TokenlessAzureHandler and TokenlessAppveyorHandler, there are explicit checks that will raise NotFound exceptions if the job field is missing. In the Azure handler, self.job = self.upload_params.get("job") is used to store the job ID, which is then used in subsequent API calls. If this is None, it will cause server errors. The error isn't gracefully handled - when tokenless upload verification fails due to the missing job parameter, it will result in HTTP 404 errors for users.
  • Code location: apps/codecov-api/upload/tokenless/github_actions.py:28
  • Suggested fix: Update all tokenless upload handlers to use the new field name code instead of job when accessing upload parameters.
Inconsistent field names between `test_results.py` and `bundle_analysis.py` may cause crashes due to unexpected `None` values.
  • Description: The BundleAnalysisView expects buildURL and job fields, while clients might send buildUrl and code based on updates in test_results.py. This inconsistency will cause the bundle analysis uploads to not properly capture these values, resulting in None values when accessed with data.get("buildURL") and data.get("job"). If any subsequent code in the worker tasks expects these values to be non-None, it could cause a crash. For example, if a client sends {"buildUrl": "some_url", "code": "some_code"}, the BundleAnalysisView will receive {"buildURL": None, "job": None}. If a downstream process attempts to use buildURL.upper() without checking for None, it will crash.
  • Code location: apps/codecov-api/upload/views/bundle_analysis.py:179~180
  • Suggested fix: Update bundle_analysis.py to use the new field names (buildUrl and code) to match test_results.py.
`bundle_analysis.py` still uses old field names, causing bundle analysis uploads to fail.
  • Description: The code change in apps/codecov-api/upload/views/test_results.py renamed the fields from buildURL to buildUrl and from job to code, but these changes weren't applied to apps/codecov-api/upload/views/bundle_analysis.py, which still uses the old field names. Since the serializer in bundle_analysis.py still expects buildURL and job, but clients will now send buildUrl and code (based on the updated schema in test_results.py), the bundle analysis uploads will not properly capture these values. The fields will be None when accessed with data.get("buildURL") and data.get("job").
  • Code location: apps/codecov-api/upload/tokenless/circleci.py:35
  • Suggested fix: Update bundle_analysis.py to use the new field names (buildUrl and code) to match test_results.py.
The bundle analysis view uses `job` instead of `code`, potentially causing server crashes due to missing data.
  • Description: The bundle analysis view (bundle_analysis.py) still uses the old field name job while the test results view (test_results.py) has been updated to use the new field name code. When a client uses code instead of job (as they would be expected to do after this change), the bundle analysis system won't be able to find the job code information. This missing data could propagate through the system. The job field is marked as required=False, allow_null=True in the serializer, which means it won't raise a validation error if missing, but downstream processes might still expect a value to be present. If downstream processing expects the job code to be available and doesn't handle the case where it's None, this could result in a server crash. The system might try to generate URLs or perform database operations using the job code, and if it's not properly handling the None case, this could result in a server crash.
  • Code location: apps/codecov-api/upload/views/bundle_analysis.py:51
  • Suggested fix: Update the bundle analysis view to use the same field names as the test results view (code instead of job) to ensure consistency.
The bundle analysis view uses `buildURL` instead of `buildUrl`, potentially causing server crashes due to missing data.
  • Description: The bundle analysis view (bundle_analysis.py) still uses the old field name buildURL while the test results view (test_results.py) has been updated to use the new field name buildUrl. When a client uses buildUrl instead of buildURL (as they would be expected to do after this change), the bundle analysis system won't be able to find the build URL information. This missing data could propagate through the system. If downstream processing expects the build URL to be available and doesn't handle the case where it's None, this could result in a server crash. The system might try to generate URLs or perform database operations using the build URL, and if it's not properly handling the None case, this could result in a server crash.
  • Code location: apps/codecov-api/upload/views/bundle_analysis.py:50
  • Suggested fix: Update the bundle analysis view to use the same field names as the test results view (buildUrl instead of buildURL) to ensure consistency.

Did you find this useful? React with a 👍 or 👎

Copy link

codecov bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.27%. Comparing base (1cf18ac) to head (9b4cd5a).
Report is 18 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
+ Coverage   94.26%   94.27%   +0.01%     
==========================================
  Files        1197     1199       +2     
  Lines       44760    44841      +81     
  Branches     1431     1431              
==========================================
+ Hits        42193    42274      +81     
  Misses       2261     2261              
  Partials      306      306              
Flag Coverage Δ
apiunit 96.39% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@JerrySentry
Copy link
Contributor Author

bugbot run verbose=true

1 similar comment
@JerrySentry
Copy link
Contributor Author

bugbot run verbose=true

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