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

Avoid fail when file does not exist #175

Merged
merged 1 commit into from
Sep 4, 2020

Conversation

baturin
Copy link
Contributor

@baturin baturin commented Jul 24, 2020

Let's start sorting out issues from #141. That simple PR avoids montage from failure when importing renamed/removed/incorrect image files.

@codecov-commenter
Copy link

Codecov Report

Merging #175 into master will decrease coverage by 0.15%.
The diff coverage is 35.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
- Coverage   76.52%   76.37%   -0.16%     
==========================================
  Files          19       19              
  Lines        3766     3775       +9     
  Branches      471      474       +3     
==========================================
+ Hits         2882     2883       +1     
- Misses        643      650       +7     
- Partials      241      242       +1     
Impacted Files Coverage Δ
montage/labs.py 30.30% <0.00%> (ø)
montage/admin_endpoints.py 81.99% <20.00%> (-0.79%) ⬇️
montage/loaders.py 73.17% <36.36%> (-1.68%) ⬇️
montage/rdb.py 77.90% <100.00%> (ø)

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 a921c5d...9d1bb64. Read the comment docs.

Copy link
Member

@mahmoud mahmoud left a comment

Choose a reason for hiding this comment

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

Looks pretty good! One comment on the error message, and also one question: do you want to update the tests at all to hit these new branches? Now that we have Sentry, and this is already an exception path, I don't think it's a blocker, but figured I'd ask.

else:
warnings.append(
'file "%s" does not exist, please check that its name is spelled correctly, '
'that it has not been renamed or removed' % (filename,)
Copy link
Member

Choose a reason for hiding this comment

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

This is a good, actionable error message. However, we should keep an eye out for if there are many, many missing files. Assuming there are 0-10, I think the error display method defined in the JS above should be fine.

@baturin
Copy link
Contributor Author

baturin commented Aug 2, 2020

@mahmoud Yes, I think we should add some tests for situations like that (there are also several situations around that should be handled in a similar way). BTW, have you checked my previous test improvements #159?
As for displaying error message, that's also pretty good question, and I think yes, we should rework error display method to make it more structured and handle many errors (as there could be many files with issues like that). I'm going to think of a way once we handle all issues on backend.

@mahmoud
Copy link
Member

mahmoud commented Aug 2, 2020

Cool. So, what I'm understanding is that we can roll with this for now and will improve error display in a future PR?

As for #159, somehow I missed that! Left a comment. :)

@mahmoud
Copy link
Member

mahmoud commented Sep 3, 2020

@baturin just checking in on this, are we OK to merge + address errors in the next?

@baturin
Copy link
Contributor Author

baturin commented Sep 3, 2020

@mahmoud Yeah, let's continue improving error reporting in future PRs, and merge that one.

@mahmoud mahmoud merged commit 2f9db52 into hatnote:master Sep 4, 2020
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.

3 participants