Skip to content

Add an admin API to get the space hierarchy#19021

Merged
MadLittleMods merged 23 commits intoelement-hq:developfrom
H-Shay:shay/admin_spaces
Oct 24, 2025
Merged

Add an admin API to get the space hierarchy#19021
MadLittleMods merged 23 commits intoelement-hq:developfrom
H-Shay:shay/admin_spaces

Conversation

@H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Oct 6, 2025

It is often useful when investigating a space to get information about that space and it's children. This PR adds an Admin API to return information about a space and it's children, regardless of room membership. Will not fetch information over federation about remote rooms that the server is not participating in.

@H-Shay H-Shay requested a review from a team as a code owner October 6, 2025 18:20
@github-actions github-actions bot deployed to PR Documentation Preview October 6, 2025 18:25 Active
@H-Shay
Copy link
Contributor Author

H-Shay commented Oct 6, 2025

test failures appear to be flakes

Copy link
Contributor

@MadLittleMods MadLittleMods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't reviewed the code much as there may be a potential pivot (see review comments)

@H-Shay H-Shay changed the title Add an admin API to search for the parent space of a room Add an admin API to search for children of a room Oct 15, 2025
@github-actions github-actions bot deployed to PR Documentation Preview October 15, 2025 22:37 Active
@H-Shay H-Shay requested a review from MadLittleMods October 15, 2025 23:03
@H-Shay
Copy link
Contributor Author

H-Shay commented Oct 16, 2025

failures look like flakes

@github-actions github-actions bot deployed to PR Documentation Preview October 17, 2025 18:22 Active
@H-Shay H-Shay requested a review from MadLittleMods October 17, 2025 19:29
@github-actions github-actions bot deployed to PR Documentation Preview October 20, 2025 20:22 Active
@H-Shay H-Shay requested a review from MadLittleMods October 20, 2025 20:50
@github-actions github-actions bot deployed to PR Documentation Preview October 21, 2025 19:44 Active
@github-actions github-actions bot deployed to PR Documentation Preview October 23, 2025 17:23 Active
@github-actions github-actions bot deployed to PR Documentation Preview October 23, 2025 17:30 Active
@H-Shay H-Shay requested a review from MadLittleMods October 23, 2025 17:55
@github-actions github-actions bot deployed to PR Documentation Preview October 23, 2025 22:44 Active
@github-actions github-actions bot deployed to PR Documentation Preview October 23, 2025 22:56 Active
@H-Shay H-Shay requested a review from MadLittleMods October 23, 2025 23:02
H-Shay and others added 2 commits October 24, 2025 09:09
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
@github-actions github-actions bot deployed to PR Documentation Preview October 24, 2025 16:13 Active
@H-Shay H-Shay requested a review from MadLittleMods October 24, 2025 17:04
@MadLittleMods MadLittleMods changed the title Add an admin API to search for children of a room Add an admin API to get the space hiearchy Oct 24, 2025
@MadLittleMods MadLittleMods changed the title Add an admin API to get the space hiearchy Add an admin API to get the space hierarchy Oct 24, 2025
@github-actions github-actions bot deployed to PR Documentation Preview October 24, 2025 18:33 Active
@H-Shay
Copy link
Contributor Author

H-Shay commented Oct 24, 2025

@MadLittleMods thanks for the review, since it is approved can you hit the merge button when you get a chance?

@MadLittleMods MadLittleMods merged commit f1695ac into element-hq:develop Oct 24, 2025
74 of 76 checks passed
@MadLittleMods
Copy link
Contributor

@H-Shay Merged 👍 Was waiting for CI to go green again ✅

@MadLittleMods MadLittleMods mentioned this pull request Jan 23, 2026
3 tasks
MadLittleMods added a commit that referenced this pull request Feb 5, 2026
This is useful so we can test Synapse
specific behaviors like our admin API.

(see docs in PR, `complement/README.md`)
```
COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh --in-repo
```

Complement calls these
["out-of-repo"](https://github.com/matrix-org/complement/blob/78c255edcebfcb0ac5e3c86d49d76cb21fdd035a/OUT-OF-REPO-TESTS.md)
tests but it's a bit of a misnomer once they're in your project. (just
depends on the perspective)

There has been [previous
desire](#19021 (comment))
for this kind of thing but this is spawning from wanting to have some
tests for our purge history admin API
(element-hq/synapse-rust-apps#430). There are
some Sytest tests ([`matrix-org/sytest` ->
`tests/48admin.pl#L91-L618`](https://github.com/matrix-org/sytest/blob/1be04cce46c0f84abac736390dc3fab17f35a756/tests/48admin.pl#L91-L618))
for this already but I'd much rather work in Complement instead of
Sytest. I'm wanting these tests to ensure that our new `event-cache`
rust app for Synapse Pro doesn't break these kind of erasure features
(element-hq/synapse-rust-apps#366 and
element-hq/synapse-rust-apps#153).

Interestingly, there is already [`matrix-org/complement` ->
`tests/csapi/admin_test.go`](https://github.com/matrix-org/complement/blob/78c255edcebfcb0ac5e3c86d49d76cb21fdd035a/tests/csapi/admin_test.go)
(added in matrix-org/complement#322) in the
Complement repo iteslf that tests the
`/_synapse/admin/v1/send_server_notice` endpoint but it's a bit of an
interesting case as [Dendrite also supports this
endpoint](matrix-org/dendrite#2180). I don't
think it's good practice to continually shove in more and more
Synapse-specific behavior into the Complement repo itself.

We already have success with other out-of-repo tests for projects like
the
[SBG](https://github.com/element-hq/sbg/tree/b76b05b53e40bf6890e51dd1b83cec3460274eb2/complement_tests),
[TI-Messenger
Proxy](https://github.com/element-hq/ti-messenger-proxy/tree/c8fa87feccc743c01cccbbc2685321206b532925/complement),
and our [Synapse Pro for small
hosts](https://github.com/element-hq/synapse-small-hosts/tree/c2ea7eabf3e1d7c26a5312ebef326b254937be99/complement).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants