From 6a45db986caa138d4628a4f8101ae2fd5693788f Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Wed, 4 Sep 2024 08:18:22 +0100 Subject: [PATCH 1/2] link to migration on conda-forge.org in PR description --- conda_forge_tick/migrators/migration_yaml.py | 8 ++++++-- tests/test_container_tasks.py | 3 ++- tests/test_migration_runner.py | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/conda_forge_tick/migrators/migration_yaml.py b/conda_forge_tick/migrators/migration_yaml.py index 1af40c955..be2cb61b8 100644 --- a/conda_forge_tick/migrators/migration_yaml.py +++ b/conda_forge_tick/migrators/migration_yaml.py @@ -285,10 +285,11 @@ def migrate( def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str: body = super().pr_body(feedstock_ctx) + url = f"https://conda-forge.org/status/migration/?name={self.name}" if feedstock_ctx.feedstock_name == "conda-forge-pinning": additional_body = ( "This PR has been triggered in an effort to close out the " - "migration for **{name}**.\n\n" + "migration for [**{name}**]({url}).\n\n" "Notes and instructions for merging this PR:\n" "1. Please merge the PR only after the tests have passed. \n" "2. Feel free to push to the bot's branch to update this PR " @@ -300,11 +301,13 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str: "
" "".format( name=self.name, + url=url, ) ) else: additional_body = ( - "This PR has been triggered in an effort to update **{name}**.\n\n" + "This PR has been triggered in an effort to update " + "[**{name}**]({url}).\n\n" "Notes and instructions for merging this PR:\n" "1. Please merge the PR only after the tests have passed. \n" "2. Feel free to push to the bot's branch to update this PR " @@ -316,6 +319,7 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str: "
" "".format( name=self.name, + url=url, ) ) diff --git a/tests/test_container_tasks.py b/tests/test_container_tasks.py index 5c3af791e..81e7a0aac 100644 --- a/tests/test_container_tasks.py +++ b/tests/test_container_tasks.py @@ -644,7 +644,8 @@ def test_migration_runner_run_migration_containerized_yaml_rebuild(tmpdir): assert migration_data["commit_message"] == "Rebuild for hi" assert migration_data["pr_title"] == "Rebuild for hi" assert migration_data["pr_body"].startswith( - "This PR has been triggered in an effort to update **hi**." + "This PR has been triggered in an effort to update " + "[**hi**](https://conda-forge.org/status/migration/?name=hi)." ) with open(os.path.join(rp_dir, "meta.yaml")) as f: diff --git a/tests/test_migration_runner.py b/tests/test_migration_runner.py index 6aae93c41..ef875fa6d 100644 --- a/tests/test_migration_runner.py +++ b/tests/test_migration_runner.py @@ -65,7 +65,8 @@ def test_migration_runner_run_migration_local_yaml_rebuild(tmpdir): assert migration_data["commit_message"] == "Rebuild for hi" assert migration_data["pr_title"] == "Rebuild for hi" assert migration_data["pr_body"].startswith( - "This PR has been triggered in an effort to update **hi**." + "This PR has been triggered in an effort to update " + "[**hi**](https://conda-forge.org/status/migration/?name=hi)." ) with open(os.path.join(tmpdir, "recipe/meta.yaml")) as f: From 0da4eaaede2bdbd067939a1f1954cc008e880c16 Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Wed, 4 Sep 2024 13:02:16 +0100 Subject: [PATCH 2/2] migration_yaml: use get_migrator_name --- conda_forge_tick/migrators/migration_yaml.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conda_forge_tick/migrators/migration_yaml.py b/conda_forge_tick/migrators/migration_yaml.py index be2cb61b8..3a19d6511 100644 --- a/conda_forge_tick/migrators/migration_yaml.py +++ b/conda_forge_tick/migrators/migration_yaml.py @@ -18,6 +18,7 @@ from conda_forge_tick.utils import ( get_bot_run_url, get_keys_default, + get_migrator_name, pluck, yaml_safe_dump, yaml_safe_load, @@ -285,7 +286,8 @@ def migrate( def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str: body = super().pr_body(feedstock_ctx) - url = f"https://conda-forge.org/status/migration/?name={self.name}" + name = get_migrator_name(self) + url = f"https://conda-forge.org/status/migration/?name={name}" if feedstock_ctx.feedstock_name == "conda-forge-pinning": additional_body = ( "This PR has been triggered in an effort to close out the " @@ -300,7 +302,7 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str: "the your rebuild has been merged.**\n\n" "
" "".format( - name=self.name, + name=name, url=url, ) ) @@ -318,7 +320,7 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str: "the your rebuild has been merged.**\n\n" "
" "".format( - name=self.name, + name=name, url=url, ) )