Skip to content

Commit a692887

Browse files
committed
Add need upgrade rebase branch status
1 parent 52bc383 commit a692887

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

backend/infrahub/cli/db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ async def rebase_and_migrate_branches(
427427

428428
for migration in rebase_migrations:
429429
execution_result = await migration.execute_against_branches(db=db, branches=branches)
430+
validation_result = None
430431

431432
if execution_result.success:
432433
validation_result = await migration.validate_migration(db=db)

backend/infrahub/core/branch/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
class BranchStatus(InfrahubStringEnum):
55
OPEN = "OPEN"
66
NEED_REBASE = "NEED_REBASE"
7+
NEED_UPGRADE_REBASE = "NEED_UPGRADE_REBASE"
78
CLOSED = "CLOSED"
89
DELETING = "DELETING"

backend/infrahub/core/migrations/shared.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ async def rebase_branch(self, db: InfrahubDatabase, branch: Branch) -> bool:
260260
except Exception:
261261
# NOTE: Narrow to more accurate exception
262262
console.print("failed")
263+
branch.status = BranchStatus.NEED_UPGRADE_REBASE
263264
return False
265+
finally:
266+
await branch.save(db=db)
264267

265268
return True
266269

0 commit comments

Comments
 (0)