Skip to content

Commit 7650262

Browse files
authored
Support of development/x major version (#187)
1 parent cc862bd commit 7650262

File tree

11 files changed

+868
-409
lines changed

11 files changed

+868
-409
lines changed

CHANGELOG

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

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

88
# Added
99
- Bert-E's status notifications through a build status check.
10+
- Support of development branches with only major version: `development/x`.
11+
12+
# Changed
13+
- Integration queue branches pattern is now `q/w/{pr.id}/{integration.branch}`
14+
instead of `q/{pr.id}/{integration.branch}`.
1015

1116
## [3.12.0] - 2024-02-26
1217
# Added

bert_e/jobs/delete_queues.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ def delete_queues(job: DeleteQueuesJob):
4949
if not queue_branches:
5050
raise exceptions.JobSuccess()
5151

52-
branch_factory(
53-
repo,
54-
'development/{}.{}'.format(queue_branches[0].major,
55-
queue_branches[0].minor)
56-
).checkout()
52+
queue_branch = queue_branches[0]
53+
if queue_branch.minor is None:
54+
repo.checkout(f"development/{queue_branch.major}")
55+
else:
56+
repo.checkout(f"development/{queue_branch.major}.{queue_branch.minor}")
5757

5858
for branch in queue_branches:
5959
branch.remove(do_push=False)

bert_e/lib/versions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def version_key(version):
2+
"""Key function to sort versions in descending order."""
3+
parts = version.split('.')
4+
parts = tuple(int(part) for part in parts)
5+
# Convert parts to integers and fill missing parts with float('inf')
6+
return parts + (float('inf'),) * (4 - len(parts))

bert_e/server/status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""This module defines the server status page."""
1616
import logging
1717
from flask import Blueprint, current_app, render_template, request
18+
from bert_e.lib.versions import version_key
1819

1920
from ..git_host.cache import BUILD_STATUS_CACHE
2021

@@ -44,8 +45,7 @@ def display():
4445
for version, _ in queued_commits:
4546
versions.add(version)
4647

47-
versions = sorted(versions, reverse=True)
48-
48+
versions = sorted(versions, key=version_key, reverse=True)
4949
for pr_id, queued_commits in queue_data.items():
5050
if int(pr_id) in [i['id'] for i in merged_prs]:
5151
continue

0 commit comments

Comments
 (0)