Skip to content

Commit

Permalink
link to migration on conda-forge.org in PR description
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Sep 4, 2024
1 parent 9b0b86e commit 6a45db9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions conda_forge_tick/migrators/migration_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -300,11 +301,13 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str:
"<hr>"
"".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 "
Expand All @@ -316,6 +319,7 @@ def pr_body(self, feedstock_ctx: ClonedFeedstockContext) -> str:
"<hr>"
"".format(
name=self.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 6a45db9

Please sign in to comment.