Skip to content

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented Jul 28, 2025

depends on #427

we have to store the individual commit shas in the aggregate to be able to
get an accurate number, otherwise we might double count and inflate the number

so we have to re-define the CAs to use an array_agg(distinct ...) then use our
custom array_merge_dedup aggregate function in the query that's run against the
CAs and we end up with a list of all the commit shas where there were failures

then we take the cardinality and coalesce with 0 in case a null appeared at any
point of the computation

@joseph-sentry joseph-sentry changed the title fix: commits where fail number calculation fix: "commits where fail" number calculation Jul 28, 2025
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.17%. Comparing base (5f7dee6) to head (e04b4b6).
⚠️ Report is 13 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/django_apps/migration_utils.py 28.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
- Coverage   94.17%   94.17%   -0.01%     
==========================================
  Files        1270     1272       +2     
  Lines       47088    47102      +14     
  Branches     1497     1497              
==========================================
+ Hits        44344    44356      +12     
- Misses       2438     2440       +2     
  Partials      306      306              
Flag Coverage Δ
sharedintegration 39.98% <11.76%> (-0.04%) ⬇️
sharedunit 88.93% <70.58%> (-0.01%) ⬇️
workerintegration 60.67% <ø> (ø)
workerunit 90.72% <ø> (ø)

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 Jul 28, 2025

Codecov Report

❌ Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/django_apps/migration_utils.py 28.57% 5 Missing ⚠️

❌ Your patch status has failed because the patch coverage (70.58%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

📢 Thoughts on this report? Let us know!

Copy link

codspeed-hq bot commented Jul 28, 2025

CodSpeed Performance Report

Merging #354 will not alter performance

Comparing joseph/ta-fix-commits-failed (e04b4b6) with main (5f7dee6)

Summary

✅ 9 untouched benchmarks

@joseph-sentry joseph-sentry force-pushed the joseph/ta-fix-commits-failed branch from 63e52d5 to 37e6ae9 Compare July 30, 2025 14:10
@joseph-sentry joseph-sentry marked this pull request as ready for review July 30, 2025 14:15
@joseph-sentry joseph-sentry requested a review from a team as a code owner July 30, 2025 14:15
@joseph-sentry joseph-sentry force-pushed the joseph/ta-fix-commits-failed branch from 37e6ae9 to 872724d Compare July 30, 2025 21:56
@joseph-sentry joseph-sentry force-pushed the joseph/ta-fix-commits-failed branch 4 times, most recently from fb3963b to fdb706f Compare August 5, 2025 20:55
@joseph-sentry joseph-sentry force-pushed the joseph/ta-fix-commits-failed branch 3 times, most recently from 4752941 to e8d4189 Compare August 20, 2025 22:37
I made a mistake in a previous migration where i wanted to run the creation of
an index using timescale's with transaction_per_chunk, which is its alternative
to create index concurrently, and since we let the hypertables be managed by
django i created the index on the model, but django's state was never updated.

so i introduce ts_create_index_on_managed_hypertable to avoid this situation in
the future and introduce a migration to fix the mistake i had made before
this contains the update to the application logic that uses the new CAs we
defined in the previous commit

we're also improving the filtering of skipped tests by using information from
the CAs which allows us to avoid doing more expensive queries during every API
call

we also use window function to calculate slow tests instead of subqueries

I also choose to refactor the code out into modules for each type of data
and a utils module for code reuse
@joseph-sentry joseph-sentry force-pushed the joseph/ta-fix-commits-failed branch from e8d4189 to e04b4b6 Compare August 22, 2025 22:08
@joseph-sentry joseph-sentry requested a review from a team August 26, 2025 14:51
Copy link
Collaborator

@michelletran-sentry michelletran-sentry left a comment

Choose a reason for hiding this comment

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

LGTM

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