add code comments

Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
This commit is contained in:
Hghtwr
2024-11-23 20:21:31 +01:00
parent ab92f94d7a
commit ad829efd52
3 changed files with 5 additions and 2 deletions
@@ -136,6 +136,7 @@ const httpHandlers = [
// dynamic handlers
// https://docs.gitlab.com/ee/api/groups.html#list-group-details supports encoded path and id
const httpGroupFindByEncodedPathDynamic = all_groups_response.flatMap(group => [
// Handler for apiBaseUrl
rest.get(`${apiBaseUrl}/groups/${group.full_path}`, (_, res, ctx) => {
@@ -166,6 +166,8 @@ export class GitLabClient {
return this.pagedRequest(`/groups`, options);
}
// https://docs.gitlab.com/ee/api/groups.html#list-group-details
// id can either be group id or encoded full path
async getGroupByPath(
groupPath: string,
options?: CommonListOptions,
@@ -366,7 +366,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
if (this.gitLabClient.isSelfManaged() && this.config.restrictUsersToGroup) {
groups = (await this.gitLabClient.listDescendantGroups(this.config.group))
.items;
groups.push(await this.gitLabClient.getGroupByPath(this.config.group));
groups.push(await this.gitLabClient.getGroupByPath(this.config.group)); // adds the parent group for #26554
users = paginated<GitLabUser>(
options =>
this.gitLabClient.listGroupMembers(this.config.group, options), // calls /groups/<groupId>/members
@@ -397,7 +397,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
groups = (await this.gitLabClient.listDescendantGroups(this.config.group))
.items;
groups.push(await this.gitLabClient.getGroupByPath(this.config.group));
groups.push(await this.gitLabClient.getGroupByPath(this.config.group)); // adds the parent group for #26554
const rootGroupSplit = this.config.group.split('/');
const rootGroup = this.config.restrictUsersToGroup