Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Jan 26, 2024
1 parent 866f32c commit fd04a4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion bert_e/workflow/gitwaterflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from bert_e import exceptions as messages
from bert_e.job import handler, CommitJob, PullRequestJob, QueuesJob
from bert_e.jobs.delete_queues import delete_queues
from bert_e.lib.cli import confirm
from bert_e.reactor import Reactor, NotFound, NotPrivileged, NotAuthored
from ..git_utils import push, clone_git_repo
Expand Down
1 change: 0 additions & 1 deletion bert_e/workflow/gitwaterflow/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ def delete(self):
queue.remove(do_push=True)



class BranchCascade(object):
def __init__(self):
self._cascade = OrderedDict()
Expand Down
19 changes: 13 additions & 6 deletions bert_e/workflow/gitwaterflow/queueing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@

from ..git_utils import clone_git_repo, consecutive_merge, robust_merge, push
from ..pr_utils import send_comment
from .branches import (BranchCascade, DevelopmentBranch, GWFBranch, IntegrationBranch,
QueueBranch, QueueCollection, QueueIntegrationBranch,
branch_factory, build_queue_collection)
from .branches import (BranchCascade, DevelopmentBranch, GWFBranch,
IntegrationBranch, QueueBranch, QueueCollection,
QueueIntegrationBranch, branch_factory,
build_queue_collection)
from .integration import get_integration_branches
from typing import List
LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -208,11 +209,16 @@ def close_queued_pull_request(job, pr_id, cascade):
# not critical
pass

def is_needed(job: PullRequestJob, wbranches: List[GWFBranch], queues: QueueCollection):

def is_needed(
job: PullRequestJob,
wbranches: List[GWFBranch],
queues: QueueCollection):
"""Determine if queuing is required to merge the given PR.
Queuing a pull request should only be done if:
- The PR or the integration branches are not up to date with the destination branch.
- The PR or the integration branches are not up to date
with the destination branch.
- Other PRs are already in the queue.
Returns:
Expand All @@ -225,7 +231,8 @@ def is_needed(job: PullRequestJob, wbranches: List[GWFBranch], queues: QueueColl
len(queues.queued_prs) > 0):
return True

if not job.git.src_branch.includes_commit(job.git.dst_branch.get_latest_commit()):
if not job.git.src_branch.includes_commit(
job.git.dst_branch.get_latest_commit()):
return True
# Check if the wbranches all contain the commits in the dst branches
for branch, dst_branch in zip(wbranches, job.git.cascade.dst_branches):
Expand Down

0 comments on commit fd04a4b

Please sign in to comment.