Skip to content

Commit

Permalink
Merge pull request #791 from AlmaLinux/fix-modules-release-plan
Browse files Browse the repository at this point in the history
Fix release plan for modular builds
  • Loading branch information
Korulag authored Apr 17, 2024
2 parents 7e53763 + 2c529d0 commit dab7949
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions alws/release_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ async def get_pulp_packages(
)
)
build_result = await self.db.execute(builds_q)
modules_to_release = defaultdict(list)
modules_to_release = defaultdict(dict)
for build in build_result.scalars().all():
build_rpms = [
build_rpm
Expand Down Expand Up @@ -320,7 +320,9 @@ async def get_pulp_packages(
source_name = artifact_name
pkg_info["source"] = source_name
pulp_packages.append(pkg_info)

for task in build.tasks:
skip_modules_processing = True
if task.rpm_modules and task.id in build_tasks:
for module in task.rpm_modules:
key = (
Expand All @@ -329,8 +331,10 @@ async def get_pulp_packages(
module.version,
module.arch,
)
if key in modules_to_release:
continue
if key not in modules_to_release:
skip_modules_processing = False
if skip_modules_processing:
continue
module_repo = next(
build_repo
for build_repo in task.build.repos
Expand All @@ -346,9 +350,15 @@ async def get_pulp_packages(
if template:
module_index = IndexWrapper.from_template(template)
for module in module_index.iter_modules():
key = (
module.name,
module.stream,
str(module.version),
module.arch,
)
# in some cases we have also devel module in template,
# we should add all modules from template
modules_to_release[key].append({
modules_to_release[key] = {
"build_id": build.id,
"name": module.name,
"stream": module.stream,
Expand All @@ -362,12 +372,9 @@ async def get_pulp_packages(
"context": module.context,
"arch": module.arch,
"template": module.render(),
})
pulp_rpm_modules = [
module_dict
for module_list in modules_to_release.values()
for module_dict in module_list
]
}

pulp_rpm_modules = list(modules_to_release.values())
return pulp_packages, src_rpm_names, pulp_rpm_modules

async def get_final_release(self, release_id: int) -> models.Release:
Expand Down

0 comments on commit dab7949

Please sign in to comment.