Skip to content

[2.1] Fixes #35869: Add tests for leaving a non-joinable team - #39840

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

gh-bot-collate[bot] wants to merge 1 commit into
2.1from
backport/2.1/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.1.

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.1

Source: Fixes #35869: Add tests for leaving a non-joinable team (merge commit 42bd0d15f0).

What this PR does

Adds integration test coverage confirming that leaving a non-joinable ("closed") team requires
an admin, the same way joining one does, and tightens the isJoinable description in the JSON
schemas (createTeam.json, team.json, teamHierarchy.json) to describe that rule. Also amends
the only-admins-add-roles-or-policies-to-a-team decision record's Guard list.

Conflict and resolution

Only openmetadata-spec/src/main/resources/rdf/ontology/openmetadata.ttl conflicted. This file is
generated from the JSON schema descriptions. On main, the generated om:isJoinable property
already carried a rdfs:comment/rdfs:domain/rdfs:range (derived from the schema description),
so the PR's diff there is just a comment-text update.

On 2.1, om:isJoinable is generated without any rdfs:comment/domain/range — it has only
om:projectionStatus and rdfs:label, same as several neighboring boolean properties
(isHidden, isEnabled, isDisabled, …) that share a property name across multiple entity
schemas. This is a pre-existing difference in how 2.1's ontology generator renders this file, not
something introduced by this PR — it predates this change and is unrelated to it.

Resolution: kept 2.1's existing generated shape for om:isJoinable (label only), i.e. no net
change to this file. Adding the comment/domain/range here would mean hand-editing a generated
artifact into a shape 2.1's generator doesn't actually produce, which would drift on the next
real regeneration.

The three JSON schema files (createTeam.json, team.json, teamHierarchy.json) and their
generated TypeScript counterparts applied cleanly with the updated isJoinable description text,
so the user-facing description change is fully ported — only the .ttl artifact is affected by
the above.

What a reviewer should check

  • Confirm openmetadata-spec/src/main/resources/rdf/ontology/openmetadata.ttl on 2.1 has no
    diff from before this backport (the isJoinable conflict resolved to a no-op on that file).
  • Confirm the isJoinable description text in the three JSON schemas and their generated
    .ts files matches main's wording.
  • The decision-record amendment references UserResourceIT.test_nonAdmin_cannotLeaveClosedTeam,
    which already exists on 2.1 (added by a prior backport), so the Guard list stays accurate.

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 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.1 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.1 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