@@ -56,23 +56,56 @@ def test_create_rc_success_first_rc(self):
5656 "**New Release Candidate Tagged!** 🐍🌿" ,
5757 comment_call_args [1 ],
5858 )
59+ self .assertIn (
60+ "tagged on branch [`release/2.0`](https://github.com/bazel-contrib/rules_python/tree/release/2.0)" ,
61+ comment_call_args [1 ],
62+ )
5963 self .assertIn (
6064 "- [Github Release 2.0.0-rc0](https://github.com/bazel-contrib/rules_python/releases/tag/2.0.0-rc0)" ,
6165 comment_call_args [1 ],
6266 )
6367 self .assertIn (
64- "- BCR Entry: [rules_python@ 2.0.0](https://registry.bazel.build/modules/rules_python/2.0.0)" ,
68+ "- [ BCR Entry 2.0.0-rc0 ](https://registry.bazel.build/modules/rules_python/2.0.0-rc0 )" ,
6569 comment_call_args [1 ],
6670 )
6771 self .assertIn (
68- "- [BCR PRs](https://github.com/bazelbuild/bazel-central-registry/pulls?q=is%3Apr+rules_python+2.0.0)" ,
72+ "- [BCR PRs](https://github.com/bazelbuild/bazel-central-registry/pulls?q=is%3Apr+rules_python+2.0.0-rc0 )" ,
6973 comment_call_args [1 ],
7074 )
7175 self .assertIn (
72- "- [Release workflow status](https://github.com/bazel-contrib/rules_python/actions/workflows/release_publish.yaml)" ,
76+ "- [Release workflow status](https://github.com/bazel-contrib/rules_python/actions/workflows/release_create_rc.yaml)" ,
77+ comment_call_args [1 ],
78+ )
79+
80+ def test_create_rc_success_with_run_id (self ):
81+ # Arrange
82+ args = MagicMock (issue = 123 , remote = "my-remote" )
83+ self .mock_gh .get_issue_title .return_value = "Release 2.0.0"
84+ self .mock_gh .get_issue_body .return_value = """
85+ ## Checklist
86+ - [x] Prepare Release | status=done pr=#122 commit=abcdef12
87+ - [x] Create Release branch | status=done branch=release/2.0 commit=abcdef12
88+ - [ ] Tag RC0 | status=pending
89+ """
90+ self .mock_git .get_remote_tags .return_value = []
91+ self .mock_git .get_commit_sha .return_value = "1234567890"
92+
93+ # Act
94+ with patch .dict (os .environ , {"GITHUB_RUN_ID" : "987654321" }):
95+ result = CreateRc (args , self .mock_git , self .mock_gh ).run ()
96+
97+ # Assert
98+ self .assertEqual (result , 0 )
99+ self .mock_gh .post_issue_comment .assert_called_once ()
100+ comment_call_args = self .mock_gh .post_issue_comment .call_args [0 ]
101+ self .assertIn (
102+ "- [Release workflow status](https://github.com/bazel-contrib/rules_python/actions/runs/987654321)" ,
103+ comment_call_args [1 ],
104+ )
105+ self .assertIn (
106+ "tagged on branch [`release/2.0`](https://github.com/bazel-contrib/rules_python/tree/release/2.0)" ,
73107 comment_call_args [1 ],
74108 )
75- self .assertNotIn ("🚀" , comment_call_args [1 ])
76109
77110 def test_create_rc_success_next_rc (self ):
78111 # Arrange
@@ -113,23 +146,26 @@ def test_create_rc_success_next_rc(self):
113146 "**New Release Candidate Tagged!** 🐍🌿" ,
114147 comment_call_args [1 ],
115148 )
149+ self .assertIn (
150+ "tagged on branch [`release/2.0`](https://github.com/bazel-contrib/rules_python/tree/release/2.0)" ,
151+ comment_call_args [1 ],
152+ )
116153 self .assertIn (
117154 "- [Github Release 2.0.0-rc1](https://github.com/bazel-contrib/rules_python/releases/tag/2.0.0-rc1)" ,
118155 comment_call_args [1 ],
119156 )
120157 self .assertIn (
121- "- BCR Entry: [rules_python@ 2.0.0](https://registry.bazel.build/modules/rules_python/2.0.0)" ,
158+ "- [ BCR Entry 2.0.0-rc1 ](https://registry.bazel.build/modules/rules_python/2.0.0-rc1 )" ,
122159 comment_call_args [1 ],
123160 )
124161 self .assertIn (
125- "- [BCR PRs](https://github.com/bazelbuild/bazel-central-registry/pulls?q=is%3Apr+rules_python+2.0.0)" ,
162+ "- [BCR PRs](https://github.com/bazelbuild/bazel-central-registry/pulls?q=is%3Apr+rules_python+2.0.0-rc1 )" ,
126163 comment_call_args [1 ],
127164 )
128165 self .assertIn (
129- "- [Release workflow status](https://github.com/bazel-contrib/rules_python/actions/workflows/release_publish .yaml)" ,
166+ "- [Release workflow status](https://github.com/bazel-contrib/rules_python/actions/workflows/release_create_rc .yaml)" ,
130167 comment_call_args [1 ],
131168 )
132- self .assertNotIn ("🚀" , comment_call_args [1 ])
133169
134170 def test_create_rc_gating_on_backports (self ):
135171 # Arrange
0 commit comments