Skip to content

Commit 9095c07

Browse files
committed
Revert "Fix: Respect the project configuration if the forward-only suffix was not set in the bot's config"
This reverts commit d8ba36c.
1 parent d8ba36c commit 9095c07

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

sqlmesh/integrations/github/cicd/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ 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] = None
36+
forward_only_branch_suffix_: t.Optional[str] = Field(
37+
default=None, alias="forward_only_branch_suffix"
38+
)
3739

3840
@model_validator(mode="before")
3941
@classmethod
@@ -74,6 +76,10 @@ def skip_pr_backfill(self) -> bool:
7476
return True
7577
return self.skip_pr_backfill_
7678

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

sqlmesh/integrations/github/cicd/controller.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,11 @@ 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) -> 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
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
488486

489487
@classmethod
490488
def _append_output(cls, key: str, value: str) -> None:

0 commit comments

Comments
 (0)