Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Foundation
IT
APIs
git-eca-rest-api
Commits
de848e15
Commit
de848e15
authored
Jun 18, 2021
by
Martin Lowe
🇨🇦
Committed by
Martin Lowe
Jul 06, 2021
Browse files
Add extra context to messaging for auth vs committer
parent
60901e99
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/eclipsefoundation/git/eca/resource/ValidationResource.java
View file @
de848e15
...
...
@@ -273,23 +273,27 @@ public class ValidationResource {
*/
private
void
validateUserAccessPartial
(
ValidationResponse
r
,
Commit
c
,
EclipseUser
eclipseUser
,
boolean
isCommitter
,
APIStatusCode
errorCode
)
{
String
userType
=
"author"
;
if
(
APIStatusCode
.
ERROR_COMMITTER
.
equals
(
errorCode
))
{
userType
=
"committer"
;
}
if
(
isCommitter
)
{
addMessage
(
r
,
String
.
format
(
"Eclipse user '%s' is a committer on the project."
,
eclipseUser
.
getName
()),
c
.
getHash
());
addMessage
(
r
,
String
.
format
(
"Eclipse user '%s'
(%s)
is a committer on the project."
,
eclipseUser
.
getName
()
,
userType
),
c
.
getHash
());
}
else
{
addMessage
(
r
,
String
.
format
(
"Eclipse user '%s' is not a committer on the project."
,
eclipseUser
.
getName
()),
c
.
getHash
());
addMessage
(
r
,
String
.
format
(
"Eclipse user '%s'
(%s)
is not a committer on the project."
,
eclipseUser
.
getName
()
,
userType
),
c
.
getHash
());
// check if the author is signed off if not a committer
if
(
eclipseUser
.
getEca
().
isSigned
())
{
addMessage
(
r
,
String
.
format
(
"Eclipse user '%s' has a current Eclipse Contributor Agreement (ECA) on file."
,
eclipseUser
.
getName
()),
String
.
format
(
"Eclipse user '%s'
(%s)
has a current Eclipse Contributor Agreement (ECA) on file."
,
eclipseUser
.
getName
()
,
userType
),
c
.
getHash
());
}
else
{
addMessage
(
r
,
String
.
format
(
"Eclipse user '%s' does not have a current Eclipse Contributor Agreement (ECA) on file.\n"
+
"If there are multiple commits, please ensure that each author has a ECA."
,
eclipseUser
.
getName
()),
String
.
format
(
"Eclipse user '%s'
(%s)
does not have a current Eclipse Contributor Agreement (ECA) on file.\n"
+
"If there are multiple commits, please ensure that each author has a ECA."
,
eclipseUser
.
getName
()
,
userType
),
c
.
getHash
());
addError
(
r
,
String
.
format
(
"An Eclipse Contributor Agreement is required for Eclipse user '%s'."
,
eclipseUser
.
getName
()),
addError
(
r
,
String
.
format
(
"An Eclipse Contributor Agreement is required for Eclipse user '%s'
(%s)
."
,
eclipseUser
.
getName
()
,
userType
),
c
.
getHash
(),
errorCode
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment