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

Fix part of #6024: Consolidate file-access #6023

Merged
merged 58 commits into from
Jan 2, 2019

Conversation

brianrodri
Copy link
Contributor

@brianrodri brianrodri commented Dec 23, 2018

Fixes part of #6024: Consolidate file-access

Currently, pre_commit_linter opens all of the files in Oppia's codebase several times to do its work.

To avoid these costly I/O accesses, this PR introduces a FileCache class which functions now (and should continue to) rely on to efficiently access the file contents.

@brianrodri brianrodri requested a review from seanlip as a code owner December 23, 2018 03:02
@brianrodri brianrodri changed the title Fix pre_commit_linter from re-opening files Fix pre_commit_linter from opening files several times Dec 23, 2018
@codecov-io
Copy link

codecov-io commented Dec 23, 2018

Codecov Report

Merging #6023 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #6023   +/-   ##
========================================
  Coverage    45.27%   45.27%           
========================================
  Files          521      521           
  Lines        30688    30688           
  Branches      4597     4597           
========================================
  Hits         13894    13894           
  Misses       16794    16794

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 ba37cc9...568916c. Read the comment docs.

@brianrodri brianrodri mentioned this pull request Dec 23, 2018
7 tasks
@brianrodri brianrodri changed the title Fix pre_commit_linter from opening files several times Fix part of #6064: Consolidate file-access Dec 23, 2018
@brianrodri brianrodri changed the title Fix part of #6064: Consolidate file-access Fix part of #6024: Consolidate file-access Dec 23, 2018
@nithusha21
Copy link
Contributor

Hi @brianrodri, thanks for the PR. Just one clarification. It does look like this PR should reduce the time taken by the linting checks. But on checking the travis log, before the PR and the PR build seems to be taking the same time (about 27 mins). Is this as expected? I thought the PR build should be significantly faster.

@brianrodri
Copy link
Contributor Author

Hmm, seems like it saves a couple of minutes but I guess it isn't the bottleneck of the work being done. We'll have to do some profiling to find what's going on.

@nithusha21
Copy link
Contributor

Sounds good. Yeah, I think something else is the bottleneck.

Also is this ready for review? If so, @apb7 do you want to take the first pass here?

@brianrodri
Copy link
Contributor Author

Yes, this is ready for review!

Copy link
Contributor

@apb7 apb7 left a comment

Choose a reason for hiding this comment

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

Hi @brianrodri, just one comment. This is looking pretty good, thanks :)

scripts/pre_commit_linter.py Show resolved Hide resolved
Copy link
Contributor

@apb7 apb7 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @brianrodri!

@kevinlee12
Copy link
Contributor

Hi @apb7, can this be merged without code owner review?

@apb7 apb7 merged commit 75fb742 into oppia:develop Jan 2, 2019
@brianrodri brianrodri deleted the modular-linter branch January 2, 2019 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants