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

Split download, prebuild check and build phases #535

Merged
merged 4 commits into from
Jan 18, 2019

Conversation

joachimmetz
Copy link
Member

Split download, prebuild check and build phases

@codecov
Copy link

codecov bot commented Dec 27, 2018

Codecov Report

Merging #535 into master will decrease coverage by 0.01%.
The diff coverage is 4.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #535      +/-   ##
==========================================
- Coverage   26.64%   26.63%   -0.02%     
==========================================
  Files          48       48              
  Lines        4548     4562      +14     
==========================================
+ Hits         1212     1215       +3     
- Misses       3336     3347      +11
Impacted Files Coverage Δ
l2tdevtools/build_helpers/pkg.py 0% <0%> (ø) ⬆️
l2tdevtools/build_helpers/source.py 0% <0%> (ø) ⬆️
l2tdevtools/build_helpers/rpm.py 0% <0%> (ø) ⬆️
l2tdevtools/build_helpers/msi.py 0% <0%> (ø) ⬆️
l2tdevtools/build_helpers/osc.py 0% <0%> (ø) ⬆️
l2tdevtools/build_helpers/dpkg.py 22.36% <4.76%> (-0.27%) ⬇️
l2tdevtools/build_helpers/interface.py 90% <50%> (-4.45%) ⬇️
l2tdevtools/source_helper.py 21.26% <7.14%> (+0.21%) ⬆️

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 8f9058f...baf88fa. Read the comment docs.

Copy link
Contributor

@Onager Onager left a comment

Choose a reason for hiding this comment

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

It looks like your branch is out of sync with the log2timeline repo - please rebase

return missing_packages

def CheckProjectConfiguration(self):
"""Checks if the project configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the sentence got cut off here, please fix.

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

@@ -54,3 +54,11 @@ def CheckBuildRequired(self, unused_source_helper_object):
bool: True if a build is required, False otherwise.
"""
return True

def CheckProjectConfiguration(self):
"""Checks if the project configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please complete the docstring.

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

l2tdevtools/source_helper.py Show resolved Hide resolved
l2tdevtools/build_helpers/dpkg.py Show resolved Hide resolved
l2tdevtools/build_helpers/rpm.py Show resolved Hide resolved
tools/build.py Outdated

def _BuildProject(self, download_helper_object, project_definition):
"""Builds a project.
def _BuildProjectForDistribution(
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the docstring, and perhaps rename to method to indicate that this also builds projects for which there is no distribution. Could you refactor to make distribution an optional arg, to make this clearer?

Copy link
Member Author

@joachimmetz joachimmetz Jan 17, 2019

Choose a reason for hiding this comment

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

Let's do not do an additional refactor in this CL, seeing it already affects a significant part of the code base.

Also your comment sounds to me like ambiguity on the semantics of "distribution" let's have this discussion outside of this CL before making changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

This method is being added in this PR, so I don't know what you mean by "additional refactor". The refactor is happening here, now.

I don't know what you mean about the semantics of distribution - per the docstring this is the "name of the distribution", and is None for every build target except dpkg-source.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack, per conversation, which was not clear from the initial review comment, reverted the name change of the method

tools/build.py Outdated
for disabled_package in disabled_projects:
undefined_projects.remove(disabled_package)

check_configuration = set()
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to misconfigured_builds to be consistent with the other sets here.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

tools/build.py Outdated
missing_build_dependencies.update(dependencies)

if not project_builder.CheckProjectConfiguration(project_definition):
print('Detected inconsistency in configuration of: {0:s}'.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this "detected error in configuration of: {0:s}"? I don't know what the configuration is supposed to be consistent with.

Copy link
Member Author

Choose a reason for hiding this comment

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

if that is more clear to you, I can change inconsistency into error


logging.info('Processing: {0:s}'.format(project_definition.name))
print('Failed downloading: {0:s}'.format(project_definition.name))
failed_downloads.add(project_definition.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why continue here? If a project can't be downloaded, don't we want to abort by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, build.py is supposed to continue with other builds. What happens is the next steps (build prep and build) for that project are skipped instead.

tools/build.py Show resolved Hide resolved
tools/build.py Show resolved Hide resolved
tools/build.py Outdated
source_helper_object.project_name,
build_helper_object.LOG_FILENAME)
def CheckProjectConfiguration(self, project_definition):
"""Checks if the project configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

This hasn't been addressed.

tools/build.py Outdated
self, build_helper_object, source_helper_object, distribution):
"""Builds a project for a specific distribution.
def CheckBuildDependencies(self, project_definition):
"""Checks if the build dependencies a project are met.
Copy link
Contributor

Choose a reason for hiding this comment

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

This hasn't been addressed.

tools/build.py Outdated
@@ -178,7 +192,29 @@ def Build(self, project_definition):
raise ValueError('Unsupported download URL: {0:s}.'.format(
project_definition.download_url))

return self._BuildProject(download_helper_object, project_definition)
# TODO: implement
Copy link
Contributor

Choose a reason for hiding this comment

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

This hasn't been addressed.

tools/build.py Show resolved Hide resolved
tools/build.py Show resolved Hide resolved
tools/build.py Outdated

def _BuildProject(self, download_helper_object, project_definition):
"""Builds a project.
def _BuildProjectForDistribution(
Copy link
Contributor

Choose a reason for hiding this comment

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

This method is being added in this PR, so I don't know what you mean by "additional refactor". The refactor is happening here, now.

I don't know what you mean about the semantics of distribution - per the docstring this is the "name of the distribution", and is None for every build target except dpkg-source.

Copy link
Contributor

@Onager Onager left a comment

Choose a reason for hiding this comment

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

It looks your branch has diverged from master - can you rebase please?

@Onager Onager merged commit 17e583e into log2timeline:master Jan 18, 2019
@joachimmetz joachimmetz deleted the bsplit branch January 18, 2019 19:01
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