Skip to content
Snippets Groups Projects

feat: Normalize group casing in get and add calls

1 unresolved thread
@@ -769,7 +769,7 @@ export class GitlabSyncRunner {
@@ -769,7 +769,7 @@ export class GitlabSyncRunner {
if (this.config.verbose) {
if (this.config.verbose) {
this.logger.debug(`GitlabSync:addGroup(g = ${g.id})`);
this.logger.debug(`GitlabSync:addGroup(g = ${g.id})`);
}
}
const namespace = g.full_path;
const namespace = g.full_path.toLowerCase();
// split into group namespace paths (eclipse/sample/group.path into ['eclipse','sample','group.path'])
// split into group namespace paths (eclipse/sample/group.path into ['eclipse','sample','group.path'])
const namespaceParts = namespace.split('/');
const namespaceParts = namespace.split('/');
return this.tunnelAndInsert(namespaceParts, g, this.nestedGroupCache);
return this.tunnelAndInsert(namespaceParts, g, this.nestedGroupCache);
@@ -787,11 +787,14 @@ export class GitlabSyncRunner {
@@ -787,11 +787,14 @@ export class GitlabSyncRunner {
if (this.config.verbose) {
if (this.config.verbose) {
this.logger.debug(`GitlabSync:getCachedGroup(${namespace})`);
this.logger.debug(`GitlabSync:getCachedGroup(${namespace})`);
}
}
if (!this.withinNamespace(namespace, rootGroup)) {
 
const normalizedNamespace = namespace.toLowerCase();
 
if (!this.withinNamespace(normalizedNamespace, rootGroup)) {
this.logger.info(`Returning null for ${namespace} as it is outside of the root group ${rootGroup}`);
this.logger.info(`Returning null for ${namespace} as it is outside of the root group ${rootGroup}`);
return null;
return null;
}
}
return this.tunnelAndRetrieve(namespace.split('/'), this.nestedGroupCache);
 
return this.tunnelAndRetrieve(normalizedNamespace.split('/'), this.nestedGroupCache);
}
}
Loading