Skip to content

Commit

Permalink
Merge pull request #2112 from conda-forge/remove-automerge
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Nov 5, 2024
2 parents 7563105 + 8f779b1 commit 6333d9a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 37 deletions.
18 changes: 16 additions & 2 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2167,9 +2167,23 @@ def _get_skip_files(forge_config):


def render_github_actions_services(jinja_env, forge_config, forge_dir):
# render github actions files for automerge and rerendering services
skip_files = _get_skip_files(forge_config)
for template_file in ["automerge.yml"]:

# we always remove the old files if they exist
old_github_actions_files = [
"automerge.yml",
"webservices.yml",
]
for filename in old_github_actions_files:
rel_target_fname = os.path.join(".github", "workflows", filename)
if _ignore_match(skip_files, rel_target_fname):
continue
remove_file(rel_target_fname)

# there are no current services to render, but if we add them in the future,
# they can go here
current_github_actions_files = []
for template_file in current_github_actions_files:
template = jinja_env.get_template(template_file + ".tmpl")
rel_target_fname = os.path.join(".github", "workflows", template_file)
if _ignore_match(skip_files, rel_target_fname):
Expand Down
18 changes: 0 additions & 18 deletions conda_smithy/templates/automerge.yml.tmpl

This file was deleted.

23 changes: 23 additions & 0 deletions news/2112-remove-GHA-services.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Moved automerge to a central repository. (#2112)

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Rerendering now removes old GHA service files. (#2112)

**Security:**

* <news item>
17 changes: 0 additions & 17 deletions tests/test_configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,23 +793,6 @@ def test_choco_install(choco_recipe, jinja_env):
assert exp in contents


def test_automerge_action_exists(py_recipe, jinja_env):
configure_feedstock.render_github_actions_services(
jinja_env=jinja_env,
forge_config=py_recipe.config,
forge_dir=py_recipe.recipe,
)
assert os.path.exists(
os.path.join(py_recipe.recipe, ".github/workflows/automerge.yml")
)
with open(
os.path.join(py_recipe.recipe, ".github/workflows/automerge.yml")
) as f:
action_config = yaml.safe_load(f)
assert "jobs" in action_config
assert "automerge-action" in action_config["jobs"]


def test_conda_forge_yaml_empty(config_yaml: ConfigYAML):
load_forge_config = lambda: configure_feedstock._load_forge_config( # noqa
config_yaml.workdir,
Expand Down

0 comments on commit 6333d9a

Please sign in to comment.