Skip to content

Commit

Permalink
Merge pull request #2992 from duncanmmacleod/migration-url
Browse files Browse the repository at this point in the history
Link to migration on conda-forge.org in PR description
  • Loading branch information
beckermr authored Sep 4, 2024
2 parents d50acc4 + 43ecbf7 commit 7455714
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 10 additions & 4 deletions conda_forge_tick/migrators/migration_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -285,10 +286,12 @@ def migrate(

def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str:
body = super().pr_body(feedstock_ctx)
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 "
"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 "
Expand All @@ -299,12 +302,14 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str:
"the your rebuild has been merged.**\n\n"
"<hr>"
"".format(
name=self.name,
name=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 "
Expand All @@ -315,7 +320,8 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str:
"the your rebuild has been merged.**\n\n"
"<hr>"
"".format(
name=self.name,
name=name,
url=url,
)
)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_container_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_migration_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7455714

Please sign in to comment.