Skip to content

Commit d8ba36c

Browse files
committed
Fix: Respect the project configuration if the forward-only suffix was not set in the bot's config
1 parent 854379d commit d8ba36c

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

sqlmesh/integrations/github/cicd/config.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ class GithubCICDBotConfig(BaseConfig):
3333
pr_environment_name: t.Optional[str] = None
3434
pr_min_intervals: t.Optional[int] = None
3535
prod_branch_names_: t.Optional[str] = Field(default=None, alias="prod_branch_name")
36-
forward_only_branch_suffix_: t.Optional[str] = Field(
37-
default=None, alias="forward_only_branch_suffix"
38-
)
36+
forward_only_branch_suffix: t.Optional[str] = None
3937

4038
@model_validator(mode="before")
4139
@classmethod
@@ -76,10 +74,6 @@ def skip_pr_backfill(self) -> bool:
7674
return True
7775
return self.skip_pr_backfill_
7876

79-
@property
80-
def forward_only_branch_suffix(self) -> str:
81-
return self.forward_only_branch_suffix_ or "-forward-only"
82-
8377
FIELDS_FOR_ANALYTICS: t.ClassVar[t.Set[str]] = {
8478
"invalidate_environment_after_deploy",
8579
"enable_deploy_command",

sqlmesh/integrations/github/cicd/controller.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,13 @@ def pr_targets_prod_branch(self) -> bool:
478478
return self._pull_request.base.ref in self.bot_config.prod_branch_names
479479

480480
@property
481-
def forward_only_plan(self) -> bool:
482-
head_ref = self._pull_request.head.ref
483-
if isinstance(head_ref, str):
484-
return head_ref.endswith(self.bot_config.forward_only_branch_suffix)
485-
return False
481+
def forward_only_plan(self) -> t.Optional[bool]:
482+
if self.bot_config.forward_only_branch_suffix is not None:
483+
head_ref = self._pull_request.head.ref
484+
if isinstance(head_ref, str):
485+
return head_ref.endswith(self.bot_config.forward_only_branch_suffix)
486+
return False
487+
return None
486488

487489
@classmethod
488490
def _append_output(cls, key: str, value: str) -> None:

0 commit comments

Comments
 (0)