Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Fix/xxxx-indexOutOfRange
  • Fix/xxxx-minorFixes
  • Fix/xxxx-organization
  • Fix/xxxx-wrap
  • Hotfix/2332-userInstitutesInReporting
  • Hotfix/2388-sensitive
  • Hotfix/3115-userReportingEmpty
  • Hotfix/3115-userReportingEmpty2
  • Hotfix/xxxx-rors
  • Issue/2181-kpiGeneratorBase
  • Issue/2182-kpiGeneratorUser
  • Issue/2183-kpiGeneratorResource
  • Issue/2184-kpiGeneratorProject
  • Issue/2185-kpiGeneratorAP
  • Issue/2186-systemStatusReporting
  • Issue/2283-activityFix
  • Issue/2304-virtuosoRoars
  • Issue/2330-fixNaNQuotainAdmin
  • Issue/2432-publicationKpi
  • Issue/2492-respOrg
  • Issue/2518-docs
  • Issue/2568-betterLogging
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2850-removeGrantId
  • Issue/2982-kpiDataPub
  • Issue/3005-kpiReportingBroken
  • Issue/3073-kpi
  • Issue/3142-kpiGenerator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.0.4
  • v1.0.5
  • v1.0.6
  • v1.0.7
  • v1.0.8
  • v1.0.9
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.1
  • v1.2.10
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.2.6
  • v1.2.7
  • v1.2.8
  • v1.2.9
79 results

Target

Select target project
  • coscine/backend/scripts/kpi-generator
1 result
Select Git revision
  • Fix/xxxx-indexOutOfRange
  • Fix/xxxx-minorFixes
  • Fix/xxxx-organization
  • Fix/xxxx-wrap
  • Hotfix/2332-userInstitutesInReporting
  • Hotfix/2388-sensitive
  • Hotfix/3115-userReportingEmpty
  • Hotfix/3115-userReportingEmpty2
  • Hotfix/xxxx-rors
  • Issue/2181-kpiGeneratorBase
  • Issue/2182-kpiGeneratorUser
  • Issue/2183-kpiGeneratorResource
  • Issue/2184-kpiGeneratorProject
  • Issue/2185-kpiGeneratorAP
  • Issue/2186-systemStatusReporting
  • Issue/2283-activityFix
  • Issue/2304-virtuosoRoars
  • Issue/2330-fixNaNQuotainAdmin
  • Issue/2432-publicationKpi
  • Issue/2492-respOrg
  • Issue/2518-docs
  • Issue/2568-betterLogging
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2850-removeGrantId
  • Issue/2982-kpiDataPub
  • Issue/3005-kpiReportingBroken
  • Issue/3073-kpi
  • Issue/3142-kpiGenerator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.0.4
  • v1.0.5
  • v1.0.6
  • v1.0.7
  • v1.0.8
  • v1.0.9
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.1
  • v1.2.10
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.2.6
  • v1.2.7
  • v1.2.8
  • v1.2.9
79 results
Show changes
Commits on Source (2)
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
<AssemblyName>Coscine.KpiGenerator</AssemblyName> <AssemblyName>Coscine.KpiGenerator</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.1.15</Version> <Version>0.1.16</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<Authors>RWTH Aachen University</Authors> <Authors>RWTH Aachen University</Authors>
<Company>IT Center, RWTH Aachen University</Company> <Company>IT Center, RWTH Aachen University</Company>
<Copyright>©2022 IT Center, RWTH Aachen University</Copyright> <Copyright>©2023 IT Center, RWTH Aachen University</Copyright>
<Description>KPI Generator is a part of the Coscine group.</Description> <Description>KPI Generator is a part of the Coscine group.</Description>
</PropertyGroup> </PropertyGroup>
......
...@@ -85,23 +85,15 @@ public class ProjectReporting : Reporting<ProjectReportingOptions> ...@@ -85,23 +85,15 @@ public class ProjectReporting : Reporting<ProjectReportingOptions>
var organizationsFromProjects = GetTopLevelOrganizationsFromEntries(returnObjects.SelectMany(ro => ro.Organizations)); var organizationsFromProjects = GetTopLevelOrganizationsFromEntries(returnObjects.SelectMany(ro => ro.Organizations));
foreach (var entry in organizationsFromProjects) foreach (var entry in organizationsFromProjects)
{ {
var organization = Organizations.Find(o => o.RorUrl.Equals(entry.RorUrl));
if (organization is null)
{
organization = _otherOrganization;
Console.WriteLine($" WARNING!: Organization \"{entry.RorUrl}\" could not be correctly identified. Will use \"{_otherOrganization.RorUrl}\".");
_logger.LogWarning("Organization {ror} could not be correctly identified.", entry.RorUrl);
}
var returnObjectsForOrganization = returnObjects.Where(ro => ro.Organizations.Select(o => o.RorUrl).Any(e => e.Contains(entry.RorUrl))).ToList(); var returnObjectsForOrganization = returnObjects.Where(ro => ro.Organizations.Select(o => o.RorUrl).Any(e => e.Contains(entry.RorUrl))).ToList();
var reportingFile = new ReportingFileObject var reportingFile = new ReportingFileObject
{ {
Path = GetReportingPathOrganization(organization.RorUrl, ReportingFileName), Path = GetReportingPathOrganization(entry.RorUrl, ReportingFileName),
Content = ConvertStringContentsToStream(JsonConvert.SerializeObject(returnObjectsForOrganization, Formatting.Indented)) Content = ConvertStringContentsToStream(JsonConvert.SerializeObject(returnObjectsForOrganization, Formatting.Indented))
}; };
reportingFilesPerOrganization.Add(reportingFile); reportingFilesPerOrganization.Add(reportingFile);
Console.WriteLine($" - {GetType().Name}: \"{GetReportingPathOrganization(organization.RorUrl, ReportingFileName)}\" generated successfully"); Console.WriteLine($" - {GetType().Name}: \"{GetReportingPathOrganization(entry.RorUrl, ReportingFileName)}\" generated successfully");
_logger.LogInformation("{Name}: Generated successfully {ReportingFile}.", GetType().Name, reportingFile); _logger.LogInformation("{Name}: Generated successfully {ReportingFile}.", GetType().Name, reportingFile);
} }
......
...@@ -84,22 +84,15 @@ public class ResourceReporting : Reporting<ResourceReportingOptions> ...@@ -84,22 +84,15 @@ public class ResourceReporting : Reporting<ResourceReportingOptions>
var organizationsFromResources = GetTopLevelOrganizationsFromEntries(returnObjects.SelectMany(ro => ro.Organizations)); var organizationsFromResources = GetTopLevelOrganizationsFromEntries(returnObjects.SelectMany(ro => ro.Organizations));
foreach (var entry in organizationsFromResources) foreach (var entry in organizationsFromResources)
{ {
var organization = Organizations.Find(o => o.RorUrl.Equals(entry.RorUrl));
if (organization is null)
{
organization = _otherOrganization;
Console.WriteLine($" WARNING!: Organization \"{entry.RorUrl}\" could not be correctly identified. Will use \"{_otherOrganization.RorUrl}\".");
_logger.LogWarning("Organization {ror} could not be correctly identified.", entry.RorUrl);
}
var returnObjectsForOrganization = returnObjects.Where(ro => ro.Organizations.Select(o => o.RorUrl).Any(e => e.Equals(entry.RorUrl))).ToList(); var returnObjectsForOrganization = returnObjects.Where(ro => ro.Organizations.Select(o => o.RorUrl).Any(e => e.Equals(entry.RorUrl))).ToList();
var reportingFile = new ReportingFileObject var reportingFile = new ReportingFileObject
{ {
Path = GetReportingPathOrganization(organization.RorUrl, ReportingFileName), Path = GetReportingPathOrganization(entry.RorUrl, ReportingFileName),
Content = ConvertStringContentsToStream(JsonConvert.SerializeObject(returnObjectsForOrganization, Formatting.Indented)) Content = ConvertStringContentsToStream(JsonConvert.SerializeObject(returnObjectsForOrganization, Formatting.Indented))
}; };
reportingFilesPerOrganization.Add(reportingFile); reportingFilesPerOrganization.Add(reportingFile);
Console.WriteLine($" - {GetType().Name}: \"{GetReportingPathOrganization(organization.RorUrl, ReportingFileName)}\" generated successfully"); Console.WriteLine($" - {GetType().Name}: \"{GetReportingPathOrganization(entry.RorUrl, ReportingFileName)}\" generated successfully");
_logger.LogInformation("{Name}: Generated successfully {ReportingFile}.", GetType().Name, reportingFile); _logger.LogInformation("{Name}: Generated successfully {ReportingFile}.", GetType().Name, reportingFile);
} }
return reportingFilesPerOrganization; return reportingFilesPerOrganization;
......
...@@ -15,8 +15,8 @@ public class MaintenanceBannerObject ...@@ -15,8 +15,8 @@ public class MaintenanceBannerObject
[JsonProperty("status")] [JsonProperty("status")]
public string Status { get; set; } = null!; public string Status { get; set; } = null!;
[JsonProperty("start_at")] [JsonProperty("start_at")]
public DateTime StartAt { get; set; } public DateTime? StartAt { get; set; } = null!;
[JsonProperty("end_at")] [JsonProperty("end_at")]
public DateTime EndAt { get; set; } public DateTime? EndAt { get; set; } = null!;
} }
...@@ -230,12 +230,12 @@ public class UserReporting : Reporting<UserReportingOptions> ...@@ -230,12 +230,12 @@ public class UserReporting : Reporting<UserReportingOptions>
private List<Organization> CleanUpOther(List<Organization> affiliations) private List<Organization> CleanUpOther(List<Organization> affiliations)
{ {
// Special case until `https://ror.org/%20https://ror.org/` is moved to `https://ror.org/_other` // Special case until `https://ror.org/%20https://ror.org/` is moved to `https://ror.org/_other`
if (affiliations.Any(o => o.RorUrl.Equals("https://ror.org/%20https://ror.org/"))) if (affiliations.Any(o => o.RorUrl.Equals("https://ror.org/%20https://ror.org/") || o.RorUrl.Equals("https://ror.org/")))
{ {
var cleanedUpAffiliations = affiliations; var cleanedUpAffiliations = affiliations;
foreach (var entry in cleanedUpAffiliations) foreach (var entry in cleanedUpAffiliations)
{ {
if (entry.RorUrl.Equals("https://ror.org/%20https://ror.org/")) if (entry.RorUrl.Equals("https://ror.org/%20https://ror.org/") || entry.RorUrl.Equals("https://ror.org/"))
{ {
cleanedUpAffiliations[cleanedUpAffiliations.IndexOf(entry)] = new() cleanedUpAffiliations[cleanedUpAffiliations.IndexOf(entry)] = new()
{ {
......