Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Organization Parser
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
scripts
Organization Parser
Commits
7e1bc70a
Commit
7e1bc70a
authored
3 years ago
by
Petar Hristov
Browse files
Options
Downloads
Plain Diff
Merge branch 'Sprint/2021-19' into 'master'
Sprint/2021 19 See merge request
!15
parents
447aaaa8
ca81fc2c
No related branches found
No related tags found
1 merge request
!15
Sprint/2021 19
Pipeline
#988747
failed
1 year ago
Stage: schedule
Changes
2
Pipelines
485
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OrganizationLoader/Program.cs
+20
-15
20 additions, 15 deletions
src/OrganizationLoader/Program.cs
src/OrganizationLoader/ResourceType.cs
+1
-0
1 addition, 0 deletions
src/OrganizationLoader/ResourceType.cs
with
21 additions
and
15 deletions
src/OrganizationLoader/Program.cs
+
20
−
15
View file @
7e1bc70a
...
...
@@ -16,37 +16,40 @@ namespace Coscine.OrganizationLoader
{
private
static
HttpClient
_httpClient
;
private
static
readonly
List
<
ResourceType
>
_resourceTypes
=
new
List
<
ResourceType
>
{
private
static
readonly
List
<
ResourceType
>
_resourceTypes
=
new
List
<
ResourceType
>
{
new
ResourceType
{
Name
=
"rds"
,
{
Name
=
"rds"
,
Quota
=
25
,
MaxQuota
=
100
,
HasQuota
=
true
,
},
new
ResourceType
{
Name
=
"rdss3"
,
Quota
=
0
,
MaxQuota
=
0
,
HasQuota
=
true
,
},
new
ResourceType
{
Name
=
"linked"
,
Quota
=
-
1
,
MaxQuota
=
-
1
,
HasQuota
=
false
,
},
};
// taken from https://tools.aai.dfn.de/entities/ and https://git.rwth-aachen.de/coscine/graphs/organizations/-/raw/master/ROR/index.ttl
private
static
readonly
List
<
OrganizationMapping
>
_organizationMappings
=
new
List
<
OrganizationMapping
>
{
new
OrganizationMapping
{
RorId
=
"https://ror.org/04xfq0f34"
,
private
static
readonly
List
<
OrganizationMapping
>
_organizationMappings
=
new
List
<
OrganizationMapping
>
{
new
OrganizationMapping
{
RorId
=
"https://ror.org/04xfq0f34"
,
EntityId
=
"https://login.rz.rwth-aachen.de/shibboleth"
,
},
new
OrganizationMapping
{
RorId
=
"https://ror.org/04xfq0f34"
,
RorId
=
"https://ror.org/04xfq0f34"
,
EntityId
=
"https://login-test.rz.rwth-aachen.de/shibboleth"
,
},
};
...
...
@@ -107,7 +110,7 @@ namespace Coscine.OrganizationLoader
Console
.
WriteLine
(
"Forced execution! Checks will be skipped."
);
}
if
(
string
.
IsNullOrWhiteSpace
(
output
))
if
(
string
.
IsNullOrWhiteSpace
(
output
))
{
Console
.
WriteLine
(
"No value for output provided."
);
return
;
...
...
@@ -116,7 +119,7 @@ namespace Coscine.OrganizationLoader
var
configuration
=
new
ConsulConfiguration
();
rorId
=
string
.
IsNullOrWhiteSpace
(
rorId
)
?
configuration
.
GetString
(
"coscine/global/organizations/rwth/ror_url"
)
:
rorId
;
if
(
string
.
IsNullOrWhiteSpace
(
rorId
))
if
(
string
.
IsNullOrWhiteSpace
(
rorId
))
{
Console
.
WriteLine
(
"No value for rorId provided."
);
}
...
...
@@ -198,7 +201,7 @@ namespace Coscine.OrganizationLoader
var
organizationsSha
=
Sha256Hash
(
organizationsString
);
var
employeesSha
=
Sha256Hash
(
employeesString
);
if
(!
force
&&
previousEmployeeSha
!=
null
&&
previousEmployeeSha
==
employeesSha
&&
previousOrganizationsSha
!=
null
&&
previousOrganizationsSha
==
organizationsSha
)
if
(!
force
&&
previousEmployeeSha
!=
null
&&
previousEmployeeSha
==
employeesSha
&&
previousOrganizationsSha
!=
null
&&
previousOrganizationsSha
==
organizationsSha
)
{
Console
.
WriteLine
(
"The sha of the exports has not changed."
);
return
;
...
...
@@ -292,7 +295,8 @@ namespace Coscine.OrganizationLoader
new
Organization
{
OrgId
=
node
[
"OrgId"
].
InnerText
?.
Trim
(),
Name
=
node
[
"Name"
].
InnerText
?.
Trim
(),
// IDM changed this to capital and might change it back. Keeps us safe for now.
Name
=
(
node
[
"NAME"
]
??
node
[
"Name"
]).
InnerText
?.
Trim
(),
IKZ
=
node
[
"IKZ"
].
InnerText
?.
Trim
(),
Abbreviation
=
node
[
"Abbreviation"
]?.
InnerText
?.
Trim
(),
CMSLink
=
node
[
"CMSLink"
].
InnerText
?.
Trim
(),
...
...
@@ -377,9 +381,10 @@ namespace Coscine.OrganizationLoader
{
streamWriter
.
WriteLine
(
$"<
{
rorId
}
> coscineresource:typeSpecification ["
);
streamWriter
.
WriteLine
(
$@" coscineresource:type <https://purl.org/coscine/terms/resource/types#
{
resourceType
.
Name
}
>;"
);
if
(
resourceType
.
HasQuota
)
if
(
resourceType
.
HasQuota
)
{
streamWriter
.
WriteLine
(
$@" coscineresource:defaultQuota ""
{
resourceType
.
Quota
}
"";"
);
streamWriter
.
WriteLine
(
$@" coscineresource:defaultMaxQuota ""
{
resourceType
.
MaxQuota
}
"";"
);
}
streamWriter
.
WriteLine
(
"]."
);
}
...
...
This diff is collapsed.
Click to expand it.
src/OrganizationLoader/ResourceType.cs
+
1
−
0
View file @
7e1bc70a
...
...
@@ -4,6 +4,7 @@
{
public
string
Name
{
get
;
set
;
}
public
int
Quota
{
get
;
set
;
}
public
int
MaxQuota
{
get
;
set
;
}
public
bool
HasQuota
{
get
;
set
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment