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

retry change detection #598

Merged
merged 26 commits into from
Mar 7, 2023
Merged

retry change detection #598

merged 26 commits into from
Mar 7, 2023

Conversation

trajan0x
Copy link
Contributor

Description

Add retry change detection

@github-actions github-actions bot added the go Pull requests that update Go code label Feb 28, 2023
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01234 ⚠️

Comparison is base (263a80f) 44.22765% compared to head (3b382da) 44.21531%.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master        #598         +/-   ##
===================================================
- Coverage   44.22765%   44.21531%   -0.01234%     
===================================================
  Files            469         469                 
  Lines          39412       39423         +11     
  Branches         183         183                 
===================================================
  Hits           17431       17431                 
- Misses         19874       19885         +11     
  Partials        2107        2107                 
Flag Coverage Δ
explorer 44.31101% <ø> (ø)
git-changes-action 60.74313% <0.00000%> (-1.09898%) ⬇️
omnirpc 50.00000% <ø> (ø)
scribe 33.71408% <ø> (ø)

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

Impacted Files Coverage Δ
contrib/git-changes-action/detector/ref.go 20.54795% <0.00000%> (-3.64560%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -81,7 +95,7 @@ func getChangedFilesFromAPI(ctx context.Context, ghContext *actionscore.Context,
}
}

if page == res.LastPage {
if res.NextPage == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure this will work? Keeping it res.LastPage worked for me in the messaging branch that had multiple pages.

Copy link
Contributor Author

@trajan0x trajan0x Mar 7, 2023

Choose a reason for hiding this comment

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

image

I ran it w/ a fmt.Println and you can see the last page detection not working here https://github.com/synapsecns/sanguine/actions/runs/4309209034/jobs/7516328981

It'd get to 12 and then reset to 1. res.LastPage can be 0 when the cursor is lost


files, res, err = client.PullRequests.ListFiles(reqCtx, repoOwner, repoName, prNumber, &github.ListOptions{
Page: page,
PerPage: 100,
Copy link
Contributor

Choose a reason for hiding this comment

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

In master, I now changed this to PerPage: 20 and it worked after not working for a long time. Not sure if I just ended up getting lucky with that, but maybe just use 20 since that worked for me?

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 max is 100, 20 will cause rate limit hits during high commit times

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, just slacked you before seeing this.
My thing failed getting page 2. Definitely leave at 100.

@@ -14,6 +14,7 @@ require (
github.com/coinbase/rosetta-sdk-go v0.8.1
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.26
github.com/hedzr/log v1.6.3
Copy link
Contributor

Choose a reason for hiding this comment

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

I spent so much time on this :-)

@github-actions github-actions bot added the M-ci Module: CI label Mar 7, 2023
if err != nil {
return nil, fmt.Errorf("could not get files for repoOwner %s, repoName %s, prNumber %d, page number %d with page size %d: %w",
repoOwner, repoName, prNumber, page, perPage, err)
return nil, fmt.Errorf("could not get files after %d retries: %w", retryCount, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe include the information I had in my log about the page number and repoName and prNumber and repoOwner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done and wrapped above

@trajan0x trajan0x marked this pull request as ready for review March 7, 2023 20:07
@trajan0x trajan0x merged commit 425de25 into master Mar 7, 2023
@trajan0x trajan0x deleted the feat/retry-changes branch March 7, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code M-ci Module: CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants