Skip to content

Commit

Permalink
Support of development/x major version (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet authored Aug 14, 2024
1 parent cc862bd commit 7650262
Show file tree
Hide file tree
Showing 11 changed files with 868 additions and 409 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.0.0] - 2024-03-06
## [4.0.0] - 2024-08-09
# Removed
- Support of tasks as it unused to due its incompatibility with GitHub.

# Added
- Bert-E's status notifications through a build status check.
- Support of development branches with only major version: `development/x`.

# Changed
- Integration queue branches pattern is now `q/w/{pr.id}/{integration.branch}`
instead of `q/{pr.id}/{integration.branch}`.

## [3.12.0] - 2024-02-26
# Added
Expand Down
10 changes: 5 additions & 5 deletions bert_e/jobs/delete_queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def delete_queues(job: DeleteQueuesJob):
if not queue_branches:
raise exceptions.JobSuccess()

branch_factory(
repo,
'development/{}.{}'.format(queue_branches[0].major,
queue_branches[0].minor)
).checkout()
queue_branch = queue_branches[0]
if queue_branch.minor is None:
repo.checkout(f"development/{queue_branch.major}")
else:
repo.checkout(f"development/{queue_branch.major}.{queue_branch.minor}")

for branch in queue_branches:
branch.remove(do_push=False)
Expand Down
6 changes: 6 additions & 0 deletions bert_e/lib/versions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def version_key(version):
"""Key function to sort versions in descending order."""
parts = version.split('.')
parts = tuple(int(part) for part in parts)
# Convert parts to integers and fill missing parts with float('inf')
return parts + (float('inf'),) * (4 - len(parts))
4 changes: 2 additions & 2 deletions bert_e/server/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""This module defines the server status page."""
import logging
from flask import Blueprint, current_app, render_template, request
from bert_e.lib.versions import version_key

from ..git_host.cache import BUILD_STATUS_CACHE

Expand Down Expand Up @@ -44,8 +45,7 @@ def display():
for version, _ in queued_commits:
versions.add(version)

versions = sorted(versions, reverse=True)

versions = sorted(versions, key=version_key, reverse=True)
for pr_id, queued_commits in queue_data.items():
if int(pr_id) in [i['id'] for i in merged_prs]:
continue
Expand Down
Loading

0 comments on commit 7650262

Please sign in to comment.