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

Introduce Job approach and JobDependency #183

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

fepitre
Copy link
Member

@fepitre fepitre commented Feb 18, 2025

No description provided.

@fepitre fepitre force-pushed the devel20250213 branch 4 times, most recently from 0f08475 to def4697 Compare February 18, 2025 15:05
@fepitre fepitre force-pushed the devel20250213 branch 4 times, most recently from 9a876e0 to eb4032a Compare February 19, 2025 08:25
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 91.92399% with 34 lines in your changes missing coverage. Please review.

Project coverage is 78.74%. Comparing base (7437576) to head (7c12b4d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
qubesbuilder/plugins/__init__.py 86.50% 17 Missing ⚠️
qubesbuilder/plugins/installer/__init__.py 68.75% 10 Missing ⚠️
qubesbuilder/plugins/template/__init__.py 89.65% 3 Missing ⚠️
qubesbuilder/plugins/fetch/__init__.py 81.81% 2 Missing ⚠️
qubesbuilder/cli/cli_repository.py 92.30% 1 Missing ⚠️
qubesbuilder/config.py 97.67% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
+ Coverage   78.21%   78.74%   +0.52%     
==========================================
  Files          47       47              
  Lines        5413     5388      -25     
==========================================
+ Hits         4234     4243       +9     
+ Misses       1179     1145      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

for distribution in distributions:
for component in components:
for plugin in plugins:
if "DistributionComponentPlugin" in [
Copy link
Member

Choose a reason for hiding this comment

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

Using isinstance() here would lead to cyclic imports, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that was the issue, I can double check.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just remind that the problem is because plugins inherit from multiple classes and it looks like isinstance does not find parent class type.

@@ -75,7 +75,7 @@ def _get_plugin_entities(self):

return entities

def _get_instances_with_attr(self, module_attr, **kwargs):
def _get_instances_with_attr(self, module_attr):
Copy link
Member

Choose a reason for hiding this comment

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

This no longer return instances, but plugin classes.

if dependency.builder_object == "component":
if dependency.builder_object == "plugin":
if (
dependency.builder_object == "plugin"
Copy link
Member

Choose a reason for hiding this comment

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

redundant

Copy link
Member Author

Choose a reason for hiding this comment

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

yes copy paste..

)
if not component:
raise PluginError(
f"Cannot find component '{dependency}' in configuration file."
)
if not self.config.sources_dir / dependency.name:
if not self.config.sources_dir / dependency.reference:
Copy link
Member

Choose a reason for hiding this comment

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

missing .exists()?

"""
Run plugin for given stage.
"""

if stage != "fetch":
if self.stage != "fetch":
Copy link
Member

Choose a reason for hiding this comment

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

Is this still necessary with stages defined at the class level?


if stage != "sign" or not self.has_component_packages("sign"):
if self.stage != "sign" or not self.has_component_packages("sign"):
Copy link
Member

Choose a reason for hiding this comment

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

and here


if stage != "prep" or not self.has_component_packages("prep"):
if self.stage != "prep" or not self.has_component_packages("prep"):
Copy link
Member

Choose a reason for hiding this comment

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

and here


if stage != "prep" or not self.has_component_packages("prep"):
if self.stage != "prep" or not self.has_component_packages("prep"):
Copy link
Member

Choose a reason for hiding this comment

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

and here


if stage != "prep" or not self.has_component_packages("prep"):
if self.stage != "prep" or not self.has_component_packages("prep"):
Copy link
Member

Choose a reason for hiding this comment

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

and here

def run(self, stage: str, repository_publish: str = None):
if stage != "upload":
def run(self, repository_publish: Optional[str] = None):
if self.stage != "upload":
Copy link
Member

Choose a reason for hiding this comment

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

and here

@marmarek
Copy link
Member

Looks good now I think. Can you schedule a pipeline with QubesOS/qubes-builderv2-github#23 on this PR?

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