Skip to content

Commit

Permalink
Respect after/with-build-id parameters when rebuilding all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Feb 18, 2025
1 parent 6ecc067 commit 340f4df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/coprs_frontend/coprs/logic/builds_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def create_new(cls, user, copr, source_type, source_json, chroot_names=None, pkg
return build

@classmethod
def _setup_batch(cls, batch, after_build_id, with_build_id, user):
def setup_batch(cls, batch, after_build_id, with_build_id, user):
# those three are exclusive!
if sum([bool(x) for x in
[batch, with_build_id, after_build_id]]) > 1:
Expand Down Expand Up @@ -898,7 +898,7 @@ def add(cls, user, pkgs, copr, source_type=None, source_json=None,
user, copr,
"You don't have permissions to build in this copr.")

batch = cls._setup_batch(batch, after_build_id, with_build_id, user)
batch = cls.setup_batch(batch, after_build_id, with_build_id, user)

if not repos:
repos = copr.repos
Expand Down
14 changes: 10 additions & 4 deletions frontend/coprs_frontend/coprs/logic/packages_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,17 @@ def build_package(cls, user, copr, package, chroot_names=None, copr_dirname=None

@classmethod
def batch_build(cls, user, copr, packages, chroot_names=None,
only_package_chroots=None, **build_options):
new_builds = []
only_package_chroots=None, with_build_id=None,
after_build_id=None, **build_options):

batch = models.Batch()
db.session.add(batch)
new_builds = []
batch = builds_logic.BuildsLogic.setup_batch(None, after_build_id,
with_build_id, user)
if batch is None:
# we want to group the builds into a separate Branch no matter the
# arguments
batch = models.Batch()
db.session.add(batch)

for package in packages:
git_hashes = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def copr_rebuild_all_packages(copr):
form.selected_chroots,
enable_net=form.enable_net.data,
only_package_chroots=form.only_package_chroots.data,
with_build_id=form.with_build_id.data,
after_build_id=form.after_build_id.data,
)

except (ObjectNotFound, ActionInProgressException, NoPackageSourceException, \
Expand Down

0 comments on commit 340f4df

Please sign in to comment.