Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  config-project-config.txt: reformat submit-section
  TestSubmitType: Enable logErrors when debug logging is enabled
  TestSubmitRule: Enable logErrors when debug logging is enabled
  Fix typos in test.submit_rule and test.submit_type examples
  RestApiServlet: Log JSON parse error at debug level

The changes "Enable logErrors when debug logging is enabled" are
omitted by this merge due to refactoring done in the TestSubmitType
and TestSubmitRule classes. This will be redone in a follow-up.

Change-Id: I997bfed6fda28dd49c0cc13508b83114ff9c6266
This commit is contained in:
David Pursehouse
2020-06-18 18:13:59 +09:00
3 changed files with 26 additions and 19 deletions

View File

@@ -316,26 +316,32 @@ the parent project.
The submit section includes configuration of project-specific
submit settings:
- 'mergeContent': Defines whether to automatically merge changes. Valid values
are 'true', 'false', or 'INHERIT'. Default is 'INHERIT'.
[[submit.mergeContent]]submit.mergeContent::
+
Defines whether to automatically merge changes. Valid values are 'true', 'false', or 'INHERIT'.
Default is 'INHERIT'.
- 'action': defines the link:#submit-type[submit type]. Valid
values are 'fast forward only', 'merge if necessary', 'rebase if necessary',
'rebase always', 'merge always' and 'cherry pick'. The default is 'merge if necessary'.
[[submit.action]]submit.action::
+
Defines the link:#submit-type[submit type]. Valid values are 'fast forward only',
'merge if necessary', 'rebase if necessary', 'rebase always', 'merge always' and 'cherry pick'.
The default is 'merge if necessary'.
- 'matchAuthorToCommitterDate': Defines whether to the author date will be changed to match the
submitter date upon submit, so that git log shows when the change was submitted instead of when the
author last committed. Valid values are 'true', 'false', or 'INHERIT'. The default is 'INHERIT'.
This option only takes effect in submit strategies which already modify the commit, i.e.
Cherry Pick, Rebase Always, and (perhaps) Rebase If Necessary.
- 'rejectEmptyCommit': Defines whether empty commits should be rejected when a change is merged.
Changes might not seem empty at first but when attempting to merge, rebasing can lead to an empty
commit. If this option is set to 'true' the merge would fail. An empty commit is still allowed as
the initial commit on a branch.
Merge strategy
[[submit.matchAuthorToCommitterDate]]submit.matchAuthorToCommitterDate::
+
Defines whether the author date will be changed to match the submitter date upon submit, so that
git log shows when the change was submitted instead of when the author last committed. Valid
values are 'true', 'false', or 'INHERIT'. The default is 'INHERIT'. This option only takes effect
in submit strategies which already modify the commit, i.e. Cherry Pick, Rebase Always, and
(when rebase is necessary) Rebase If Necessary.
[[submit.rejectEmptyCommit]]submit.rejectEmptyCommit::
+
Defines whether empty commits should be rejected when a change is merged. When using
link:#submit.action[submit action] Cherry Pick, Rebase If Necessary or Rebase Always changes may
become empty upon submit, since the rebase|cherry-pick can lead to an empty commit. If this option
is set to 'true' the merge would fail in such a case. An empty commit is still allowed as the
initial commit on a branch.
[[access-section]]
=== Access section

View File

@@ -4349,7 +4349,7 @@ a project-specific rule.
.Request
----
POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
Content-Type: text/plain; charset-UTF-8
Content-Type: text/plain; charset=UTF-8
submit_type(cherry_pick).
----
@@ -4380,7 +4380,7 @@ a project-specific rule.
.Request
----
POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
Content-Type: text/plain; charset-UTF-8
Content-Type: text/plain; charset=UTF-8
submit_rule(submit(R)) :-
R = label('Any-Label-Name', reject(_)).

View File

@@ -591,6 +591,7 @@ public class RestApiServlet extends HttpServlet {
}
}
} catch (MalformedJsonException | JsonParseException e) {
logger.atFine().withCause(e).log("REST call failed on JSON parsing");
responseBytes =
replyError(
req, res, status = SC_BAD_REQUEST, "Invalid " + JSON_TYPE + " in request", e);