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

[INTERNAL] Task createDebugFiles checks path before writes #43

Merged
merged 1 commit into from
Jul 2, 2018

Conversation

stopcoder
Copy link
Member

  • The debugFileCreator processor checks whether the debug file path
    is used and only writes the content to the path when it's not
    used yet.

  • The debug file path can be used, for example, by the createBundle
    task which may create a specific bundle for the debug version of
    another bundle. In this case, the debugFileCreator shouldn't
    overwrite the created debug bundle.

@coveralls
Copy link

coveralls commented Jun 28, 2018

Pull Request Test Coverage Report for Build 222

  • 13 of 14 (92.86%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 66.941%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/processors/debugFileCreator.js 12 13 92.31%
Totals Coverage Status
Change from base Build 212: 0.2%
Covered Lines: 633
Relevant Lines: 870

💛 - Coveralls

@stopcoder
Copy link
Member Author

This solves the first point in issue #36

@stopcoder
Copy link
Member Author

Build time comparison with openui5-sample-app:

master

time ui5 build -all
[...]
ui5 build --all 71.30s user 6.79s system 130% cpu 59.818 total

debug_file_check_existence_before_write

time ui5 build -all
[...]
ui5 build --all 71.02s user 6.80s system 130% cpu 59.563 total

Summary

The extra check of path existence in the workspace doesn't prolong the build time.

@stopcoder stopcoder requested a review from matz3 June 28, 2018 20:59
@RandomByte
Copy link
Member

Could you squash those commits into one?

@stopcoder stopcoder force-pushed the debug_file_check_existence_before_write branch from 461a8ea to eced8b5 Compare July 2, 2018 09:03
@stopcoder
Copy link
Member Author

Somehow the squash doesn't work well, I am working on it.

@stopcoder stopcoder force-pushed the debug_file_check_existence_before_write branch from eced8b5 to e45a0db Compare July 2, 2018 09:27
@stopcoder
Copy link
Member Author

I forgot git add -u after a soft reset 😅

Now everything should be OK.

// previous tasks
return stat(resource.getPath().replace(options.pattern, options.replacement))
.then(
// if the file can be found, it should be filtered out from createing debug file
Copy link
Member

Choose a reason for hiding this comment

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

createing => creating

Copy link
Member Author

Choose a reason for hiding this comment

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

done

}
);
})
).then((stats) => {
Copy link
Member

Choose a reason for hiding this comment

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

What about results instead of stats, as the array doesn't contain any stat info?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

return stats.filter((stat) => {
return !!stat;
});
}).then((filteredResource) => {
Copy link
Member

Choose a reason for hiding this comment

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

filteredResource => filteredResources

Copy link
Member Author

Choose a reason for hiding this comment

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

done

- The debugFileCreator processor checks whether the debug file path
  is used and only writes the content to the path when it's not
  used yet.

- The debug file path can be used, for example, by the createBundle
  task which may create a specific bundle for the debug version of
  another bundle. In this case, the debugFileCreator shouldn't
  overwrite the created debug bundle.
@stopcoder stopcoder force-pushed the debug_file_check_existence_before_write branch from e45a0db to e9db432 Compare July 2, 2018 09:38
@stopcoder stopcoder merged commit 57427c8 into master Jul 2, 2018
@stopcoder stopcoder deleted the debug_file_check_existence_before_write branch July 2, 2018 09:42
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