Skip to content

Commit

Permalink
fix: need to use the teams endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Nov 27, 2024
1 parent e81912f commit ca9acad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ def _maintainer_exists(maintainer: str) -> bool:
# )
# so we check two public URLs instead.
# 1. github.com/<maintainer> - this URL works for all users and all orgs
# 2. https://github.com/orgs/<maintainer> - this URL only works for
# 2. https://github.com/orgs/<maintainer>/teams - this URL only works for
# orgs so we make sure it fails
req_profile = requests.get(f"https://github.com/{maintainer}")
req_org = requests.get(f"https://github.com/orgs/{maintainer}")
req_org = requests.get(f"https://github.com/orgs/{maintainer}/teams")
return req_profile.status_code == 200 and req_org.status_code != 200


Expand Down
3 changes: 2 additions & 1 deletion tests/test_lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,8 @@ def test_maintainer_exists(self):
self.assertNotIn(expected_message, lints)

lints, _ = linter.lintify_meta_yaml(
{"extra": {"recipe-maintainers": ["conda-forge"]}}, conda_forge=True
{"extra": {"recipe-maintainers": ["conda-forge"]}},
conda_forge=True,
)
expected_message = 'Recipe maintainer "conda-forge" does not exist'
self.assertIn(expected_message, lints)
Expand Down

0 comments on commit ca9acad

Please sign in to comment.