-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecated GitHub API endpoint for teams #135
Comments
The required patch probably is the following. I need to do more testing, though. diff --git a/runtests.py b/runtests.py
index 62f5127..69b8fb6 100755
--- a/runtests.py
+++ b/runtests.py
@@ -1482,8 +1482,8 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"gentlepeople"
}
],
- '/teams/1/members': team1members,
- '/teams/12/members': team12members
+ '/organizations/%s/team/1/members' % self.organization: team1members,
+ '/organizations/%s/team/12/members' % self.organization: team12members
})
with TracContext(self, env=self.tracd_env_debug, **self.trac_env):
@@ -1665,8 +1665,8 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"gentlepeople"
}
],
- '/teams/1/members': team1members,
- '/teams/12/members': team12members
+ '/organizations/%s/team/1/members' % self.organization: team1members,
+ '/organizations/%s/team/12/members' % self.organization: team12members
})
update = {
@@ -1698,7 +1698,7 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"gentlepeople"
}
],
- '/teams/12/members': team12members
+ '/organizations/%s/team/12/members' % self.organization: team12members
})
# Send the delete event
@@ -1783,7 +1783,7 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"justice-league"
},
],
- '/teams/1/members': team1members,
+ '/organizations/%s/team/1/members' % self.organization: team1members,
})
# Send the update event
@@ -1826,7 +1826,7 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"justice-league"
},
],
- '/teams/1/members': list(team1members)
+ '/organizations/%s/team/1/members' % self.organization: list(team1members)
})
update = {
@@ -1848,7 +1848,7 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"justice-league"
},
],
- '/teams/1/members': list(team1members)
+ '/organizations/%s/team/1/members' % self.organization: list(team1members)
})
# Send the update event
@@ -1891,7 +1891,7 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"justice-league"
},
],
- '/teams/1/members': list(team1members)
+ '/organizations/%s/team/1/members' % self.organization: list(team1members)
})
update = {
@@ -1913,7 +1913,7 @@ class GitHubGroupsProviderTests(TracGitHubTests):
"slug": u"justice-league"
},
],
- '/teams/1/members': list(team1members)
+ '/organizations/%s/team/1/members' % self.organization: list(team1members)
})
# Send the update event
diff --git a/tracext/github/__init__.py b/tracext/github/__init__.py
index 0dddb2b..fe9dc6f 100644
--- a/tracext/github/__init__.py
+++ b/tracext/github/__init__.py
@@ -475,11 +475,12 @@ class GitHubTeam(GitHubUserCollection):
:param slug: the GitHub team shortname in URL representation
"""
self._teamid = teamid
+ self._orgid = org
fullname = '-'.join(['github', org, slug])
super(GitHubTeam, self).__init__(api, env, fullname)
def _apicall_parameters(self):
- return ("teams/{}/members", self._teamid)
+ return ("organizations/{}/team/{}/members", self._orgid, self._teamid)
#class GitHubOrgMembers(GitHubUserCollection):
# """
|
GitHub moved the sunset of the teams API endpoint to an unannounced later date. This gives us more time for testing this properly, but we should still move to the newer API endpoint eventually. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The trac-github plugin is using a deprecated GitHub API endpoint for
/teams/
that will be removed on 2022-03-15. Right now on 2022-03-01, GitHub has some brownouts in effect to make users of the API aware of the deprecation. I see the following log message:The easiest route seems to be to replace the
/teams/
endpoint with/organizations/:org_id/team/:team_id
. I have not yet checked whether they are fully compatible, though.The text was updated successfully, but these errors were encountered: