@@ -697,3 +697,41 @@ def test_get_pr_environment_summary_includes_warnings_and_errors(
697697 )
698698 assert "> [!WARNING]\n >\n > Warning 1\n " in error_summary
699699 assert "> [!CAUTION]\n >\n > Error 1" in error_summary
700+
701+
702+ def test_pr_comment_deploy_indicator_includes_command_namespace (
703+ mocker : MockerFixture ,
704+ github_client ,
705+ make_mock_issue_comment ,
706+ make_controller : t .Callable [..., GithubController ],
707+ ):
708+ mock_repo = github_client .get_repo ()
709+
710+ created_comments = []
711+ mock_issue = mock_repo .get_issue ()
712+ mock_issue .create_comment = mocker .MagicMock (
713+ side_effect = lambda comment : make_mock_issue_comment (
714+ comment = comment , created_comments = created_comments
715+ )
716+ )
717+ mock_issue .get_comments = mocker .MagicMock (side_effect = lambda : created_comments )
718+
719+ controller = make_controller (
720+ "tests/fixtures/github/pull_request_synchronized.json" ,
721+ github_client ,
722+ mock_out_context = False ,
723+ bot_config = GithubCICDBotConfig (
724+ enable_deploy_command = True ,
725+ merge_method = MergeMethod .SQUASH ,
726+ command_namespace = "#SQLMesh" ,
727+ ),
728+ )
729+
730+ _update_pr_environment (controller )
731+
732+ assert len (created_comments ) > 0
733+
734+ comment = created_comments [0 ].body
735+
736+ assert "To **apply** this PR's plan to prod, comment:\n - `/deploy`" not in comment
737+ assert "To **apply** this PR's plan to prod, comment:\n - `#SQLMesh/deploy`" in comment
0 commit comments