Skip to content

[4.x] Add the team methods by slug and deprecate the /teams/{team_id} routes - #96

Open
Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-teams-by-slug
Open

Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-teams-by-slug

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Orgs\Teams addresses teams by numeric ID through the legacy /teams/{team_id} routes. GitHub has replaced them with organization-scoped routes by team slug (/orgs/{org}/teams/{team_slug}), and the /teams/{id}/members/{user} routes behind isMember(), addMember() and removeMember() are gone. Those three were marked @deprecated without a version, a runtime notice or a working replacement — the suggested getTeamMembership()/addTeamMembership()/removeTeamMembership() use legacy routes too.

  • New methods by organization and slug: getBySlug(), editBySlug() (sends only the given name/description/privacy), deleteBySlug(), getListMembersBySlug(), getMembershipBySlug(), addMembershipBySlug(), removeMembershipBySlug(), getListReposBySlug(), checkRepoBySlug(), addRepoBySlug() (optional permission), removeRepoBySlug(). Bodies are JSON.
  • The 14 methods that use /teams/{team_id} are deprecated with a runtime deprecation naming their replacement (removal in 5.0; adds symfony/deprecation-contracts ^2|^3). getList(), create() and getUserTeams() already use current routes and are unchanged.

Testing Instructions

TeamsTest::testSlugMethods (data provider) asserts method, path and body of each new method; testMembershipAndRepoChecksBySlug covers the 200/404/204 handling; testLegacyRoutesAreDeprecated expects the deprecation. They fail before the change.

Documentation Changes Required

docs/overview.md: new "Teams" section with the old-to-new mapping. #66's packages.md teams row needs the new methods when the second of the two is merged. The 5.x removal follows with the other 5.0 removals.

Related to #88 (JSON bodies of create(), edit(), addTeamMembership(); merges cleanly).

🤖 Generated with Claude Code

Orgs\Teams addressed teams by ID through the legacy /teams/{team_id}
routes, which GitHub has replaced with /orgs/{org}/teams/{team_slug};
the /teams/{id}/members/{user} routes of isMember(), addMember() and
removeMember() are gone. Add a ...BySlug() method for each team
operation and deprecate the methods that use the legacy routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant