Add debug logs for hidden changes that block submit
If a change cannot be submitted because it depends on changes that are hidden from the user it is hard to find out what those changes are. We cannot report them to the calling user because this user is not allowed to see those change, however we should log them on debug level so that we can find them from a trace. Change-Id: I693f45fe96a026cab5e632bb9beec29d81ba1893 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -248,6 +248,9 @@ public class Submit
|
||||
private String problemsForSubmittingChangeset(ChangeData cd, ChangeSet cs, CurrentUser user) {
|
||||
try {
|
||||
if (cs.furtherHiddenChanges()) {
|
||||
logger.atFine().log(
|
||||
"Change %d cannot be submitted by user %s because it depends on hidden changes: %s",
|
||||
cd.getId().get(), user.getLoggableName(), cs.nonVisibleChanges());
|
||||
return BLOCKED_HIDDEN_SUBMIT_TOOLTIP;
|
||||
}
|
||||
for (ChangeData c : cs.changes()) {
|
||||
@@ -263,6 +266,9 @@ public class Submit
|
||||
.change(c)
|
||||
.test(EnumSet.of(ChangePermission.READ, ChangePermission.SUBMIT));
|
||||
if (!can.contains(ChangePermission.READ)) {
|
||||
logger.atFine().log(
|
||||
"Change %d cannot be submitted by user %s because it depends on change %d which the user cannot read",
|
||||
cd.getId().get(), user.getLoggableName(), c.getId().get());
|
||||
return BLOCKED_HIDDEN_SUBMIT_TOOLTIP;
|
||||
}
|
||||
if (!can.contains(ChangePermission.SUBMIT)) {
|
||||
|
||||
Reference in New Issue
Block a user