Skip to content

[2.0] Fixes #35869: Add tests for leaving a non-joinable team - #39841

Open
gh-bot-collate[bot] wants to merge 1 commit into
2.0from
backport/2.0/pr-39677
Open

gh-bot-collate[bot] wants to merge 1 commit into
2.0from
backport/2.0/pr-39677

Conversation

@gh-bot-collate

@gh-bot-collate gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

Automated backport of #39677 to 2.0.

Source PR #39677
Author @sonika-shah
Merge commit 42bd0d15f09b983087a7fd99e60cbf95d1f49740
Method Conflicts resolved by Claude — worth a read of the diff.

Resolution notes

Backport notes: PR #39677 → 2.0

Source: 42bd0d15f09b983087a7fd99e60cbf95d1f49740 ("Fixes #35869: Add tests for
leaving a non-joinable team")

Conflicts and resolutions

docs/decisions/2026-10-30-only-admins-add-roles-or-policies-to-a-team.md — resolved by keeping it absent

This decision record does not exist on 2.0 at all (git log shows no commit
ever added it here), even though it does exist on 2.1 (e.g.
7d1fc61240 "Tidy the team grant decision record wording (#38957) (#38958)"
landed on 2.1, never on 2.0). The PR's only change to this file is
appending a "v4" amendment to the existing v1–v3 history. Since the base
document was never backported to 2.0, there is no coherent file to amend —
recreating it here would mean fabricating the v1–v3 sections, which were
never part of this PR.

The underlying feature this ADR documents (UserRepository.changesClosedTeamMembership,
enforced in UserResource) is present on 2.0, so no functional gap
exists; only the documentation file is missing. I left the file deleted,
matching 2.0's existing state. Reviewer should double check this matches
project convention for this branch (i.e., that decision records are
intentionally not backported to 2.0) rather than being an oversight.

openmetadata-spec/src/main/resources/rdf/ontology/openmetadata.ttl — resolved by keeping 2.0's version unchanged

The only change in the source commit is to the rdfs:comment on
om:isJoinable. On 2.0, the generated ontology predates the richer
generator used on main: the om:isJoinable entry here has no
rdfs:comment/rdfs:domain/rdfs:range at all (just
om:projectionStatus and rdfs:label). The conflict was purely a side
effect of main's ontology generator having evolved independently of this
PR. Since there is no comment field to update in 2.0's format, I kept
2.0's version of this file untouched (git checkout --ours).

Clean cherry-picks (no manual changes needed)

  • openmetadata-integration-tests/.../UserTeamAssignmentPrivilegeIT.java — new
    tests test_selfUpdate_cannotLeaveClosedTeam,
    test_selfUpdate_canLeaveOpenTeam, test_adminRemoval_fromClosedTeam_stillWorks
    plus supporting helpers (patchTeams, usersPath, removeFirstTeam)
    applied cleanly; all referenced helpers/fields already exist on 2.0.
  • openmetadata-spec/.../createTeam.json, team.json, teamHierarchy.json —
    isJoinable description update applied cleanly.
  • Generated TypeScript (createTeam.ts, team.ts, teamHierarchy.ts) —
    regenerated description text applied cleanly (not regenerated by me; ported
    as part of the cherry-pick diff since make generate/schema codegen wasn't
    re-run here).

What to check by hand

  • Confirm the intentional absence of the ADR doc on 2.0 is correct
    project policy, not a gap that should also be fixed in this PR.
  • The .ttl file has zero diff vs 2.0's current HEAD after resolution —
    verify no actual ontology regeneration is expected on this branch for
    this change.

Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #39677 is asked to look.

resolver run

* Fixes #35869: Test and document that leaving a closed team needs an admin

Leaving a team that is not joinable already needs an admin on user PUT,
PATCH and CSV import (UserRepository.changesClosedTeamMembership). Add
the missing ITs: swapping a closed team for an open one by PUT and PATCH
is refused and keeps the team's default role, leaving an open team still
works, and an admin still removes a user from a closed team. Describe the
rule on isJoinable and record it in the closed-team decision record.

* Correct isJoinable description and trim decision record

On a team that is not joinable, members are added or removed by an admin
editing the user, or by anyone allowed to edit the team's users editing the
team. The description now says so. The decision record's v4 entry only adds
the new tests to its Guard list.

(cherry picked from commit 42bd0d1)
@gh-bot-collate
gh-bot-collate Bot requested a review from a team as a code owner December 4, 2026 13:13
@gh-bot-collate
gh-bot-collate Bot removed the request for review from a team December 4, 2026 13:13
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Dec 4, 2026
@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.0 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 This backport is red, so it will not merge itself. @sonika-shah

Failing: Compatibility checks

The change is not on 2.0 yet. You raised the PR this was backported from, so please take a look. Push a fix to this branch and it merges automatically once the checks go green.

run log

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant