Skip to content
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

feat: trigger PR sync #655

Merged
merged 1 commit into from
Jul 5, 2024
Merged

feat: trigger PR sync #655

merged 1 commit into from
Jul 5, 2024

Conversation

giovanni-guidini
Copy link
Contributor

It's possible with a combination of not having webhooks and temporary errors when
fetching info from the git provider that a PR will be left forever open.

One solution is to make the PR view trigger a sync_pull task in the background.
Notice that for the person that is actually viewing the PR it will probably be out of date,
but if they refresh the page it will eventually be updated.

closes: https://github.com/codecov/internal-issues/issues/513

@codecov-qa
Copy link

codecov-qa bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.54%. Comparing base (1f9dcf3) to head (057cd7c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main     #655   +/-   ##
=======================================
  Coverage   91.54%   91.54%           
=======================================
  Files         621      621           
  Lines       16569    16574    +5     
=======================================
+ Hits        15168    15173    +5     
  Misses       1401     1401           
Flag Coverage Δ
unit 91.54% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.54% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
...re/commands/pull/interactors/fetch_pull_request.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

Copy link

codecov-public-qa bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.54%. Comparing base (1f9dcf3) to head (057cd7c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #655   +/-   ##
=======================================
  Coverage   91.54%   91.54%           
=======================================
  Files         621      621           
  Lines       16569    16574    +5     
=======================================
+ Hits        15168    15173    +5     
  Misses       1401     1401           
Flag Coverage Δ
unit 91.54% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.54% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
...re/commands/pull/interactors/fetch_pull_request.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Impacted file tree graph

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.94%. Comparing base (1f9dcf3) to head (057cd7c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #655   +/-   ##
===========================================
  Coverage   95.94000   95.94000           
===========================================
  Files           799        799           
  Lines         17886      17912   +26     
===========================================
+ Hits          17160      17185   +25     
- Misses          726        727    +1     
Flag Coverage Δ
unit 91.54% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.54% <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.

It's possible with a combination of not having webhooks and temporary errors when
fetching info from the git provider that a PR will be left forever open.

One solution is to make the PR view trigger a sync_pull task in the background.
Notice that for the person that is actually viewing the PR it will probably be out of date,
but if they refresh the page it will eventually be updated.

closes: codecov/internal-issues#513
@giovanni-guidini giovanni-guidini force-pushed the gio/sync-pull-on-view branch from 3c693c0 to 057cd7c Compare July 3, 2024 15:13
@giovanni-guidini giovanni-guidini requested a review from a team as a code owner July 3, 2024 15:13
@codecov-notifications
Copy link

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!

return repository.pull_requests.filter(pullid=id).first()
pull = repository.pull_requests.filter(pullid=id).first()
if self._should_sync_pull(pull):
TaskService().pulls_sync(repository.repoid, id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the pulls_sync task leave the pull syncing indefinitely? I suppose there's a hard timeout, but trying to think if this could end up in another "stale" state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well even if the task does have an issue it doesn't matter for this request in particular because the calling of it only enqueues it for the workers. It's not blocking in any way.

@giovanni-guidini giovanni-guidini added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit 2261c6d Jul 5, 2024
21 of 22 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/sync-pull-on-view branch July 5, 2024 08:50
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