Commit d5f88153 authored by Martin Lowe's avatar Martin Lowe 🇨🇦
Browse files

Update GL script for updated gitlab settings structure

parent 7915ce9e
......@@ -269,8 +269,10 @@ const testProjects: EclipseProject[] = [
logo: '',
tags: ['simpsons', 'doh', 'spider pig'],
top_level_project: 'technology',
gitlab_excl_namespaces: ['eclipse/spider.pig/excludes'],
gitlab_namespace: 'eclipse/spider.pig',
gitlab: {
ignored_namespaces: ['eclipse/spider.pig/excludes'],
project_namespace: 'eclipse/spider.pig',
},
gerrit_repos: [
{
url: 'https://github.com/eclipsefdn-webdev/spider-pig',
......
......@@ -31,6 +31,11 @@ export interface WorkingGroup {
id: string;
}
export interface GitlabRepoSettings {
project_namespace: string;
ignored_namespaces: string[];
}
export interface EclipseProject {
project_id: string;
short_project_id: string;
......@@ -41,8 +46,7 @@ export interface EclipseProject {
website_repo: string[];
logo: string;
tags: string[];
gitlab_namespace: string;
gitlab_excl_namespaces: string[];
gitlab: GitlabRepoSettings;
github_repos: Repo[];
gitlab_repos: Repo[];
gerrit_repos: Repo[];
......
......@@ -167,7 +167,7 @@ export class GitlabSyncRunner {
}
// fetch group namespace indicated by the project and ensure format
let actualNamespace = project.gitlab_namespace;
let actualNamespace = project.gitlab.project_namespace;
let [projectNamespace, projectNamespaceTLP] = [
`${this.config.rootGroup}/${project.short_project_id}`,
`${this.config.rootGroup}/${project.top_level_project}/${project.short_project_id}`,
......@@ -268,7 +268,7 @@ export class GitlabSyncRunner {
for (let pidx in projects) {
// check if any of the matched projects marks this as an external/skipped namespace
let project = this.eclipseProjectCache[projects[pidx]];
if (project.gitlab_excl_namespaces.some(v => v.localeCompare(self.full_path, undefined, { sensitivity: 'base' }) === 0)) {
if (project.gitlab.ignored_namespaces.some(v => v.localeCompare(self.full_path, undefined, { sensitivity: 'base' }) === 0)) {
this.logger.info(`Group '${self.full_path}' was marked as an external/protected namespace by project '${project.project_id}'`);
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment