Skip to content

[server] Add server API to list blocked repositories #11080

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

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

andrew-farries
Copy link
Contributor

Description

Add adminGetBlockedRepositories API to components/server to fetch the list of blocked repositories.

This is a step towards using these endpoints to manage blocked repositories in the admin UI.

Related Issue(s)

Part of #11030

How to test

await window._gp.gitpodService.server.adminGetBlockedRepositories({offset: 0, limit: 10, orderBy: 'id', orderDir: "desc", searchTerm: "foo"})

setting searchTerm as appropriate (or omitting it entirely).

Release Notes

NONE

Documentation

Werft options

  • /werft with-preview

/hold

@andrew-farries
Copy link
Contributor Author

andrew-farries commented Jul 1, 2022

/werft run with-preview

👍 started the job as gitpod-build-af-blocked-repo-api.5
(with .werft/ from main)

findAllBlockedRepositories(
offset: number,
limit: number,
orderBy: keyof BlockedRepository,
Copy link
Member

Choose a reason for hiding this comment

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

Here it might make sense to limit to the fields that actually are indexex, for instance by using orderBy: keyof Pick<BlockedRepository, "id | "blockUser"> or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have no indexes on the table besides the PK. As mentioned yesterday #11036 (comment), mysql can't make use of indexes on urlRegexp when testing with REGEXP.

Do you think we should add indexes to support this admin search?

@geropl
Copy link
Member

geropl commented Jul 1, 2022

Left some comments. Please squash before merging! 🙃

@andrew-farries andrew-farries requested a review from geropl July 1, 2022 13:37
@geropl
Copy link
Member

geropl commented Jul 5, 2022

/werft run

👍 started the job as gitpod-build-af-blocked-repo-api.7
(with .werft/ from main)

@geropl
Copy link
Member

geropl commented Jul 5, 2022

/werft run

👍 started the job as gitpod-build-af-blocked-repo-api.9
(with .werft/ from main)

🤞

@geropl geropl self-assigned this Jul 5, 2022
Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Code LGTM, tested and works! ✔️

/hold Please squash before merging! 🙃

@andrew-farries
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 543d66f into main Jul 7, 2022
@roboquat roboquat deleted the af/blocked-repo-api branch July 7, 2022 06:57
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants