Skip to content

feat: create ta_finish_upload #1193

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

Merged
merged 4 commits into from
Apr 16, 2025
Merged

feat: create ta_finish_upload #1193

merged 4 commits into from
Apr 16, 2025

Conversation

joseph-sentry
Copy link
Contributor

this module is responsible for the new implementation of the TA finisher and it gets its test run and flake information from timescale and the new postgres flake table

@joseph-sentry joseph-sentry requested a review from a team March 31, 2025 16:25
Copy link
Contributor

sentry-autofix bot commented Mar 31, 2025

🚨 Sentry detected 2 potential issues in your recent changes 🚨

Lower risk findings
  • Line 240, services/test_analytics/ta_finish_upload.py: Incompatible types in assignment (expression has type "TestResultsNotificationPayload[bytes]", variable has type "TestResultsNotificationPayload[str] | None")

    • Type incompatibility in notifier.payload assignment.
  • Line 115, services/seats.py

    • activate_seat_info.owner_id and activate_seat_info.author_id are not checked for None before being used.

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

Copy link

codecov bot commented Mar 31, 2025

Codecov Report

Attention: Patch coverage is 99.57265% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.74%. Comparing base (c949122) to head (e6fffd8).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/test_analytics/ta_finish_upload.py 98.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1193      +/-   ##
==========================================
+ Coverage   97.70%   97.74%   +0.03%     
==========================================
  Files         457      459       +2     
  Lines       37089    37294     +205     
==========================================
+ Hits        36238    36453     +215     
+ Misses        851      841      -10     
Flag Coverage Δ
integration 42.72% <25.21%> (-0.10%) ⬇️
unit 90.81% <99.14%> (+0.29%) ⬆️

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 Mar 31, 2025

Codecov Report

Attention: Patch coverage is 99.57265% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/test_analytics/ta_finish_upload.py 98.87% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

log = logging.getLogger(__name__)


def get_upload_ids(commitid: str) -> dict[int, ReportSession]:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe get "successful" upload ids? Or something to differentiate this from a generic get by id



def get_upload_error(upload_ids: list[int]) -> ErrorPayload | None:
error = UploadError.objects.filter(report_session_id__in=upload_ids).first()
Copy link
Contributor

Choose a reason for hiding this comment

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

so if there's multiple errors, we'd just return the first one? And is this deterministic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so if there's multiple errors, we'd just return the first one
yes
And is this deterministic
good point

celery_app.send_task(
cache_test_rollups_task_name,
kwargs={
"repoid": repo.repoid,
Copy link
Contributor

Choose a reason for hiding this comment

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

is it too late to change this kwarg param to be repo_id to match the process_flakes_task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think i'll do that as part of a separate change

Copy link
Contributor

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

lgtm, but might be worth checking the naming again.

process_flakes_task_name,
kwargs={
"repo_id": repo.repoid,
"commit_id": commit.commitid,
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to the comment below, commitid and commit_id is confusing.
the first one is actually the commit_sha, and the X_id looks a lot like a primary key id, though it isn’t in this case.

)


def check_seat_activation(db_session: Session, pull: EnrichedPull) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if such a function already exists someplace else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

factored it out 👍

@joseph-sentry joseph-sentry added this pull request to the merge queue Apr 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 14, 2025
since all callers are using repo_id by this point we no longer have
to accept repoid as an arg
this module is responsible for the new implementation of the TA
finisher and it gets its test run and flake information from timescale
and the new postgres flake table
@joseph-sentry joseph-sentry added this pull request to the merge queue Apr 16, 2025
Merged via the queue into main with commit 799fb2d Apr 16, 2025
27 of 29 checks passed
@joseph-sentry joseph-sentry deleted the joseph/ta-finisher branch April 16, 2025 13:40
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.

3 participants