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

Continue updating PRs if a merge fails #102

Merged
merged 2 commits into from
Jan 27, 2021

Conversation

anarast
Copy link
Collaborator

@anarast anarast commented Jan 21, 2021

This might need some more testing/another test case - let me know if you have any ideas

@anarast anarast force-pushed the continue-if-pr-fails branch from 5b7a7f5 to 03360cd Compare January 21, 2021 19:46
@codecov
Copy link

codecov bot commented Jan 21, 2021

Codecov Report

Merging #102 (ba4c102) into master (e467e67) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
+ Coverage   98.83%   98.86%   +0.02%     
==========================================
  Files           3        3              
  Lines         431      439       +8     
  Branches       64       89      +25     
==========================================
+ Hits          426      434       +8     
+ Misses          5        0       -5     
- Partials        0        5       +5     
Impacted Files Coverage Δ
src/autoupdater.ts 98.44% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e467e67...ba4c102. Read the comment docs.

@chinthakagodawita
Copy link
Owner

Nice one, I'll give it a squiz this weekend. Probably need this to be logged as an error too, not info.

@chinthakagodawita chinthakagodawita self-assigned this Jan 22, 2021
Adds a test that throws a 403 half-way through a list of PRs that need
updating to confirm that autoupdate continues to the next PR in line.
@chinthakagodawita
Copy link
Owner

@anarast could you take a look? Added a more stringent test: ba4c102

@@ -604,4 +604,77 @@ describe('test `merge`', () => {

expect(scope.isDone()).toEqual(true);
});

test('continue if merging throws an error', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is what i wanted to do! i couldn't figure out how to make multiple scopes work

ghCore.error(
`Caught error running merge, skipping and continuing with remaining PRs`,
);
ghCore.setFailed(e);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is this necessary if we're already logging out the error in the merge method?

Choose a reason for hiding this comment

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

Yea - setFailed sets the process exitcode which marks this run as failed (which in turn sends an email to the repository / PR owner)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cool lgtm

@chinthakagodawita chinthakagodawita merged commit 40a3722 into master Jan 27, 2021
@chinthakagodawita chinthakagodawita deleted the continue-if-pr-fails branch January 27, 2021 05:23
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