-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
#24889 - Feature: Fetch Gitlab users for self-hosted Gitlab based on group assignment #24936
Conversation
Changed Packages
|
Im gonna clean this up in the course of the day... |
Uffizzi Ephemeral Environment - Virtual ClusterYour cluster
Access the |
Nice! Feel free to remove it from draft whenever is ready so that we get pinged :D |
@vinzscam I'm pretty lost with the last two failing checks as I don't have a good understanding about yarn workspaces. |
try rebasing master, probably something was wrong in the base branch |
…onfiguration key 'restrictUsersToGroup' Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
@vinzscam Thanky you, that worked. The DCO job seems to be stuck before even starting, so I hope that won't be a problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, just want to cover the additional functionality with some tests if thats possible 🙏
plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts
Show resolved
Hide resolved
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
@@ -260,15 +260,16 @@ describe('GitlabOrgDiscoveryEntityProvider - refresh', () => { | |||
const taskDef = schedule.getTasks()[0]; | |||
|
|||
await (taskDef.fn as () => Promise<void>)(); | |||
const userEntities = mock.expected_full_org_scan_entities.filter( | |||
const entities = mock.expected_full_org_scan_entities.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this logic change the default behaviour which we have today or am I misreading this test change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full org scan returns users as well as groups (and their subgroups).
Previously, there was no testing with subgroups. I implemented this into the test data. So the comparison of returned users and the returned entities doesn't make a lot of sense anymore.
I can make the test more precise by filtering the returned entities to users, compare this to the expected users and add another line of test that filters the returned entities to groups and compares them to the expected number of groups. That would keep the original test logic in place but still would be compatible to the test data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - let's go with this 🎉 thanks!
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
Hey, I just made a Pull Request!
In reference to the problem described in #24889, this PR implements a new configuration key to limit the ingested users to the group defined in the provider configuration for self-hosted and SaaS.
I have tested this positively with a self-hosted Gitlab instance. Unforunately, I don't have access to a SaaS instance even though the change on SaaS side is only a minor one that shouldn't break anything.
It also slips a small change into the .gitignore to add
.envrc
files used with direnv.✔️ Checklist
Signed-off-by
line in the message. (more info)