-
Notifications
You must be signed in to change notification settings - Fork 35
Allow rebase of branches during migration #7447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4e1bb27
7157fa1
9fe20cf
0e76288
dd04fa4
505d93b
1ca016e
3500ea0
915cf28
17b9c80
f85be21
773d113
018c2a8
f1c44ef
b86d627
262e920
4c98e39
668c41c
3a0fe94
6908ed4
2e907b3
4be9884
e092d8f
16f60c2
d59be63
40aa298
91de062
48fb7c4
3c70090
c814786
8e6c259
45564b2
6325348
74fd90d
33c9bb5
260586c
18beba6
17ead5c
dcbdf7d
6e06543
770308a
d92dfc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,8 @@ | |
| from pydantic import Field, field_validator | ||
|
|
||
| from infrahub.core.branch.enums import BranchStatus | ||
| from infrahub.core.constants import ( | ||
| GLOBAL_BRANCH_NAME, | ||
| ) | ||
| from infrahub.core.constants import GLOBAL_BRANCH_NAME | ||
| from infrahub.core.graph import GRAPH_VERSION | ||
| from infrahub.core.models import SchemaBranchHash # noqa: TC001 | ||
| from infrahub.core.node.standard import StandardNode | ||
| from infrahub.core.query import QueryType | ||
|
|
@@ -46,6 +45,7 @@ class Branch(StandardNode): | |
| is_isolated: bool = True | ||
| schema_changed_at: Optional[str] = None | ||
| schema_hash: Optional[SchemaBranchHash] = None | ||
| graph_version: int | None = None | ||
|
|
||
| _exclude_attrs: list[str] = ["id", "uuid", "owner"] | ||
|
|
||
|
|
@@ -261,6 +261,10 @@ def get_branches_and_times_for_range( | |
|
|
||
| return start, end | ||
|
|
||
| async def create(self, db: InfrahubDatabase) -> bool: | ||
| self.graph_version = GRAPH_VERSION | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One question here is how we manage this number after a rebase operation. Do we then bump the graph version? (I haven't yet checked if we already do this, just commenting some thoughts) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This number only changes in the |
||
| return await super().create(db=db) | ||
|
Comment on lines
+264
to
+266
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set
self.branched_from = at.to_string()
self.status = BranchStatus.OPEN
+ self.graph_version = GRAPH_VERSION
await self.save(db=db)Also applies to: 476-493 🤖 Prompt for AI Agents |
||
|
|
||
| async def delete(self, db: InfrahubDatabase) -> None: | ||
| if self.is_default: | ||
| raise ValidationError(f"Unable to delete {self.name} it is the default branch.") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.