From 6a3d8bee6e9233e93317d2e64ddedb0439e4ca06 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wright" Date: Thu, 20 Aug 2020 16:38:39 -0400 Subject: [PATCH 1/5] disable automerge for bad deps --- conda_forge_tick/contexts.py | 1 + conda_forge_tick/migrators/version.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conda_forge_tick/contexts.py b/conda_forge_tick/contexts.py index ab74bd2f0..bf540c601 100644 --- a/conda_forge_tick/contexts.py +++ b/conda_forge_tick/contexts.py @@ -73,3 +73,4 @@ class FeedstockContext: package_name: str feedstock_name: str attrs: "AttrsTypedDict" + passed_dep_analysis = True diff --git a/conda_forge_tick/migrators/version.py b/conda_forge_tick/migrators/version.py index a1d6ce159..70ba61000 100644 --- a/conda_forge_tick/migrators/version.py +++ b/conda_forge_tick/migrators/version.py @@ -659,6 +659,7 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: "If you encounter issues with this feature please ping the bot team `conda-forge/bot`.\n\n" ) if dep_comparison: + feedstock_ctx.passed_dep_analysis = False df_cf = "" for k in dep_comparison.get("df_minus_cf", set()): df_cf += f"- {k}" + "\n" @@ -680,6 +681,11 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: f"\n\n### Packages found in the meta.yaml but not found by inspection:\n" f"{cf_df}" ) + hint += f"\n\n @conda-forge-admin please ping {feedstock_ctx.attrs['name']} It seems that there are" \ + f"some discrepancies in the dependencies please address them if possible. " + if feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get("automerge", False,) in {"version", True}: + hint += "Note that automerge has been disabled for this PR because of the dependency issues. You can" \ + "restore automerge by disabling this feature in your `conda-forge.yml`" else: hint += ( "Analysis of the source code shows **no** discrepancy between" @@ -695,9 +701,9 @@ def commit_message(self, feedstock_ctx: FeedstockContext) -> str: def pr_title(self, feedstock_ctx: FeedstockContext) -> str: assert isinstance(feedstock_ctx.attrs["new_version"], str) # TODO: turn False to True when we default to automerge - if feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get( + if (feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get( "automerge", False, - ) in {"version", True}: + ) in {"version", True}) and feedstock_ctx.passed_dep_analysis: add_slug = "[bot-automerge] " else: add_slug = "" From 79d6deae7be111ffbac631b0c0a4b3320732d861 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wright" Date: Thu, 20 Aug 2020 16:44:27 -0400 Subject: [PATCH 2/5] put tiny text at the bottom --- conda_forge_tick/migrators/version.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/conda_forge_tick/migrators/version.py b/conda_forge_tick/migrators/version.py index 70ba61000..62d317eae 100644 --- a/conda_forge_tick/migrators/version.py +++ b/conda_forge_tick/migrators/version.py @@ -559,7 +559,6 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: self.ctx.effective_graph.predecessors(feedstock_ctx.package_name), ) ] - body = super().pr_body(feedstock_ctx) # TODO: note that the closing logic needs to be modified when we # issue PRs into other branches for backports open_version_prs = [ @@ -582,8 +581,7 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: upstream_url_link = "" muid: dict - body = body.format( - "It is very likely that the current package version for this " + body = ("It is very likely that the current package version for this " "feedstock is out of date.\n" "Notes for merging this PR:\n" "1. Feel free to push to the bot's branch to update this PR if needed.\n" @@ -607,8 +605,8 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: closes="\n".join( [f"Closes: #{muid['number']}" for muid in open_version_prs], ), - ), - ) + )) + # Statement here template = ( "|{name}|{new_version}|[![Anaconda-Server Badge]" @@ -692,6 +690,7 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: " the library's imports and the package's stated requirements in the meta.yaml." ) body += hint + body = super().pr_body(feedstock_ctx).format(body) return body def commit_message(self, feedstock_ctx: FeedstockContext) -> str: From d22a057f7c37261dbb5fcb5c7044a4f230fc8997 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wright" Date: Thu, 20 Aug 2020 16:46:11 -0400 Subject: [PATCH 3/5] restate the key --- conda_forge_tick/migrators/version.py | 34 ++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/conda_forge_tick/migrators/version.py b/conda_forge_tick/migrators/version.py index 62d317eae..887d1d26b 100644 --- a/conda_forge_tick/migrators/version.py +++ b/conda_forge_tick/migrators/version.py @@ -581,7 +581,8 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: upstream_url_link = "" muid: dict - body = ("It is very likely that the current package version for this " + body = ( + "It is very likely that the current package version for this " "feedstock is out of date.\n" "Notes for merging this PR:\n" "1. Feel free to push to the bot's branch to update this PR if needed.\n" @@ -605,8 +606,9 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: closes="\n".join( [f"Closes: #{muid['number']}" for muid in open_version_prs], ), - )) - + ) + ) + # Statement here template = ( "|{name}|{new_version}|[![Anaconda-Server Badge]" @@ -679,11 +681,18 @@ def pr_body(self, feedstock_ctx: FeedstockContext) -> str: f"\n\n### Packages found in the meta.yaml but not found by inspection:\n" f"{cf_df}" ) - hint += f"\n\n @conda-forge-admin please ping {feedstock_ctx.attrs['name']} It seems that there are" \ - f"some discrepancies in the dependencies please address them if possible. " - if feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get("automerge", False,) in {"version", True}: - hint += "Note that automerge has been disabled for this PR because of the dependency issues. You can" \ - "restore automerge by disabling this feature in your `conda-forge.yml`" + hint += ( + f"\n\n @conda-forge-admin please ping {feedstock_ctx.attrs['name']} It seems that there are" + f"some discrepancies in the dependencies please address them if possible. " + ) + if feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get( + "automerge", False, + ) in {"version", True}: + hint += ( + "Note that automerge has been disabled for this PR because of the dependency issues. You can" + "restore automerge by disabling this feature by adding `bot: inspection: false` to your " + "`conda-forge.yml`. " + ) else: hint += ( "Analysis of the source code shows **no** discrepancy between" @@ -700,9 +709,12 @@ def commit_message(self, feedstock_ctx: FeedstockContext) -> str: def pr_title(self, feedstock_ctx: FeedstockContext) -> str: assert isinstance(feedstock_ctx.attrs["new_version"], str) # TODO: turn False to True when we default to automerge - if (feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get( - "automerge", False, - ) in {"version", True}) and feedstock_ctx.passed_dep_analysis: + if ( + feedstock_ctx.attrs.get("conda-forge.yml", {}) + .get("bot", {}) + .get("automerge", False) + in {"version", True} + ) and feedstock_ctx.passed_dep_analysis: add_slug = "[bot-automerge] " else: add_slug = "" From 157364972fe4a2013067ab5fb57ed168df20780d Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Sun, 24 Dec 2023 05:52:01 -0600 Subject: [PATCH 4/5] Update conda_forge_tick/migrators/version.py --- conda_forge_tick/migrators/version.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conda_forge_tick/migrators/version.py b/conda_forge_tick/migrators/version.py index 4be5363bb..ac4d5f826 100644 --- a/conda_forge_tick/migrators/version.py +++ b/conda_forge_tick/migrators/version.py @@ -339,9 +339,9 @@ def _hint_and_maybe_update_deps(self, feedstock_ctx): "new_version", ) - if feedstock_ctx.attrs.get("conda-forge.yml", {}).get("bot", {}).get( - "automerge", False, - ) in {"version", True}: + if feedstock_ctx.attrs.get("conda-forge.yml", {}).get( + "bot", {}, + ).get("automerge", False) in {"version", True}: feedstock_ctx.passed_dep_analysis = False hint += ( "\nNote that automerge has been disabled for this PR because of the dependency issues. You can" From 0b4f864018b28e6c747bfa30d2164f3100f6c380 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Sun, 24 Dec 2023 05:53:04 -0600 Subject: [PATCH 5/5] Update conda_forge_tick/migrators/version.py --- conda_forge_tick/migrators/version.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conda_forge_tick/migrators/version.py b/conda_forge_tick/migrators/version.py index ac4d5f826..7f169ea15 100644 --- a/conda_forge_tick/migrators/version.py +++ b/conda_forge_tick/migrators/version.py @@ -340,7 +340,8 @@ def _hint_and_maybe_update_deps(self, feedstock_ctx): ) if feedstock_ctx.attrs.get("conda-forge.yml", {}).get( - "bot", {}, + "bot", + {}, ).get("automerge", False) in {"version", True}: feedstock_ctx.passed_dep_analysis = False hint += (