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

Prevent crashing when files were removed #174

Closed
wants to merge 1 commit into from
Closed

Prevent crashing when files were removed #174

wants to merge 1 commit into from

Conversation

milgner
Copy link

@milgner milgner commented Aug 15, 2016

When a file was removed in the changeset, pronto would try to open it, leading to errors like

Errno::ENOENT: No such file or directory @ rb_sysopen - ...

This patch makes sure that the method returns false as expected.

@mmozuras
Copy link
Member

@milgner could you expand on when it happens?

Because ideally, it should never happen. Pronto only cares about what was added. If a file was removed, Pronto should not try to open it.

@milgner
Copy link
Author

milgner commented Aug 20, 2016

Unfortunately I did not dig very deep into this. But one of our changesets removed a file and pronto tried to open it and crashed. The backtrace lead me to this location and after applying the patch, the error disappeared. I can try to find the output of our CI to illustrate but right now I did not find a way to quickly search all builds for a specific message.

@mmozuras
Copy link
Member

@milgner having a repro would be immensely helpful. I think that what you describe could potentially mask some greater underlying issue, which I would like to try and find.

@milgner
Copy link
Author

milgner commented Aug 22, 2016

I totally understand! Right now I just came across a situation that might be related: Pronto is annotating problems on the removed part of the changeset, saying for example "Line is too long. [81/80]" on an old view template where the updated version isn't that long anymore. If it is looking at old file versions there then it might be the same code path that tried to open a deleted file, too.

For reference, this is how we invoke Pronto from our CI script:

bundle exec pronto run -c origin/develop -f github_pr github_status

@mmozuras
Copy link
Member

mmozuras commented Aug 22, 2016

@milgner thanks for the additional info. Which version are you using?

@milgner
Copy link
Author

milgner commented Aug 22, 2016

Current version in Gemfile.lock is 0.7.0.

@mmozuras
Copy link
Member

@milgner it could be another manifestation of an already fixed bug (#149, #170) in 0.7.0. Could you update to 0.7.1 and check if it solves the issue?

@mmozuras
Copy link
Member

@milgner any news? 😄

@milgner
Copy link
Author

milgner commented Sep 1, 2016

After updating to 0.7.1 the problems seem to have been tackled. Thanks for the assist, I'll close this PR.

@milgner milgner closed this Sep 1, 2016
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.

None yet

2 participants