Skip to content
Snippets Groups Projects
Commit cc897c08 authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'malowe/master/114' into 'main'

Iss #114 - Add support for estimated LOC and IP team note in status UI

Closes #114

See merge request !123
parents 6d9df112 fe2fbe38
No related branches found
No related tags found
1 merge request!123Iss #114 - Add support for estimated LOC and IP team note in status UI
Pipeline #14329 passed
......@@ -180,6 +180,11 @@ components:
strictMode:
type: boolean
description: Whether to strictly apply validation regardless of project matching
estimated_loc:
type:
- integer
- "null"
description: The estimated LOC changed by the set of commits sent for validation.
commits:
type: array
minimum: 1
......
......@@ -50,6 +50,7 @@ public class CommitValidationStatus extends BareNode {
private String repoUrl;
@Enumerated(EnumType.STRING)
private ProviderType provider;
private Integer estimatedLoc;
private ZonedDateTime creationDate;
private ZonedDateTime lastModified;
@OneToMany(mappedBy = "commit", fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, orphanRemoval = true)
......@@ -120,6 +121,20 @@ public class CommitValidationStatus extends BareNode {
this.provider = provider;
}
/**
* @return the estimatedLoc
*/
public Integer getEstimatedLoc() {
return estimatedLoc;
}
/**
* @param estimatedLoc the estimatedLoc to set
*/
public void setEstimatedLoc(Integer estimatedLoc) {
this.estimatedLoc = estimatedLoc;
}
/**
* @return the creationDate
*/
......@@ -175,6 +190,8 @@ public class CommitValidationStatus extends BareNode {
builder.append(repoUrl);
builder.append(", provider=");
builder.append(provider);
builder.append(", estimatedLoc=");
builder.append(estimatedLoc);
builder.append(", creationDate=");
builder.append(creationDate);
builder.append(", lastModified=");
......
......@@ -42,6 +42,9 @@ public abstract class ValidationRequest {
public abstract ProviderType getProvider();
@Nullable
public abstract Integer getEstimatedLoc();
@Nullable
@JsonProperty("strictMode")
public abstract Boolean getStrictMode();
......@@ -60,6 +63,8 @@ public abstract class ValidationRequest {
public abstract Builder setProvider(ProviderType provider);
public abstract Builder setEstimatedLoc(@Nullable Integer estimatedLoc);
@JsonProperty("strictMode")
public abstract Builder setStrictMode(@Nullable Boolean strictMode);
......
......@@ -13,6 +13,8 @@ package org.eclipsefoundation.git.eca.namespace;
import com.fasterxml.jackson.annotation.JsonValue;
import io.quarkus.qute.TemplateEnum;
/**
* Represents a provider that can submit commits for validation. This is used
* for matching properly on some legacy fields.
......@@ -20,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
* @author Martin Lowe
*
*/
@TemplateEnum
public enum ProviderType {
GITHUB, GITLAB, GERRIT;
......
......@@ -157,6 +157,7 @@ public class DefaultValidationService implements ValidationService {
base.setProvider(req.getProvider());
base.setRepoUrl(req.getRepoUrl().toString());
base.setCreationDate(DateTimeHelper.now());
base.setEstimatedLoc(req.getEstimatedLoc());
}
base.setLastModified(DateTimeHelper.now());
updatedStatuses.add(base);
......
......@@ -32,6 +32,20 @@
<h1>Git ECA Validation Status</h1>
<div class="row">
<div class="col-md-24 margin-bottom-20">
{#if (statuses.0.estimatedLoc ne null && statuses.0.estimatedLoc gt 1000) || statuses.0.provider == ProviderType:GITLAB}
<div class="alert alert-info">
<p>
<strong>Eclipse Intellectual Property Management:</strong>
</p>
<p>
Some contributions of code to be maintained by Eclipse Projects
must be reviewed by the IP Team; in particular if they contain
third party content and/or are over 1,000 Lines of Code. Further
information can be read via the <a href="https://www.eclipse.org/projects/handbook/#ip-project-code">
Eclipse Handbook</a>.
</p>
</div>
{/if}
<h2 class="h4 margin-top-0">About this project</h2>
<ul>
<li><strong>Eclipse Foundation Project:</strong>
......
......@@ -5,6 +5,7 @@ CREATE TABLE CommitValidationStatus (
creationDate datetime DEFAULT NULL,
id bigint NOT NULL AUTO_INCREMENT,
provider varchar(100) NOT NULL,
estimatedLoc int DEFAULT 0,
repoUrl varchar(255) NOT NULL,
PRIMARY KEY (id)
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment