35 Commits

Author SHA1 Message Date
Sven Selberg
560974482c Populate ChangeAttribute with WIP and private status.
Change-Id: Ic2830c573e9245edf57551a42fc63eef71983c99
2017-12-19 17:36:50 +01:00
David Ostrovsky
6ffb7d9358 Discontinue draft workflow
Migration is implemented to either replace draft changes with private
(default) or work-in-progress changes.

We bump the change index version to trigger online reindexing.
That's needed because we don't support reindexing during init step, and
we need to reindex all changes, because DRAFT is removed from the
Change.Status enum and index still contains the old references to the
changes that were migrated to private or work-in-progress changes. To
make online reindexing work, draft status is replaced with the new
change status.

PolyGerrit UI is not addressed in this change and will be done in a
follow-up change.

User branches are not updated in this change to clean-up My-Menu entry
in user preferences. This will be done in a follow-up change.

refs/meta/config is not updated in this change to clean-up draft
related permissions. This will be done in a follow-up change.

ChangeControl#isPatchVisible() call sites are migrated to the
ChangeControl#isVisible() and isVisible() is made public again. This and
other temporary changes to ChangeControl class will be cleaned up in
follow up changes.

Bug: Issue 6880
Change-Id: Icfcb34efe1ff0ea1d39e94ed500db776f5770d8f
2017-09-30 15:47:14 +02:00
David Pursehouse
041fce1dc5 Add missing documentation of ChangeKind.MERGE_FIRST_PARENT_UPDATE
Change-Id: I83338f9e8c3db10004271056ba04ba00edf79639
2016-07-04 02:04:02 +00:00
Khai Do
71b58990e9 Append approval info to every comment-added stream event and hook
This change is driven by the RFC proposal[1] to show label
transitions more explicitly in Gerrit. Stream events only
provides label information on review events that contain
a vote transition.  When a user submits a review with only a
reply message the approvals information is not added to the
stream event and hooks. This change will make Gerrit append
approvals info to every comment-added event including the
ones that do not contain vote changes.

Since labels are shown for every event we will add an 'oldValue'
property to the approvalAttribute to distinguish when a vote
transition has occurred.  The 'oldValue' attribute contains
the previous vote score.  This attribute will only appear when
there is a vote transition.

The comment-added stream event will look like this:

  "approvals":[{"type":"Code-Review","description":"Code-Review",
  "value":"-1", "oldValue":"0"}, {"type":"Verified",
  "description":"Verified","value":"0"}],
  "comment":"Patch Set 1: Code-Review+1\n\nMy Message" ...

This change will also a '--$LabelName-oldValue' parameter to
corresponding comment-added change hook:

  hook[comment-added] output:
  --change I2cd8327360ff89338a4e7f0591bf0c037e9aa5db
  --is-draft false --change-url http://localhost:8080/201
  --change-owner John Smith (jsmith@gmail.com) --project okc
  --branch master --author John Smith (jsmith@gmail.com)
  --commit 55079187f7ce1c461de804c13f2dd71d64a85280
  --comment Patch Set 1: Code-Review-1 --Code-Review -1
  --Code-Review-oldValue 0 --Verified 0

[1] https://groups.google.com/d/msg/repo-discuss/soqmGjRpl-4/IIfAF4jbCQAJ

Bug: Issue 3220
Change-Id: Ibc1c64d70e790c7b507db79931f31fd77f25e276
2016-03-18 14:47:36 +01:00
Stefan Beller
0d3cab0634 Remove the state SUBMITTED altogether
There is a new schema to move all submitted changes to new.

Change-Id: I9f3b015a59fc2446a98a03866330b0d4e22bbf3d
2015-07-10 13:51:01 -07:00
Janice Agustin
0d74afe186 Use full name for refName RefUpdateAttribute
RefUpdated events have an attribute called refName. EventFactory would
create this attribute using the short name, which is inconsistent
since all other events use full ref names. Create the event with the
full ref name.

Change-Id: I45dc114f48b801d0e5c9877c30e0526b8ecb8adb
2015-05-19 11:04:34 -04:00
Zalan Blenessy
ae4768654e Added copyAllScoresIfNoChange
Covers the case when nothing has changed except the commit
of the rebased patch set. This is possible when a patch set is
rebased on target branch.

With this patch, when PS1 is rebased (without modification) to PS2
the Verified+1 and Code-Review+2 will be copied since PS1 and PS2 are
effectively the same change with different commits.

----- (B) ----- (B+M) ----- (B+M-M)
        \                       \
         ----- (PS1)             ----- (PS2)

Change-Id: I6a8ebd3c83ca6167cfc826267a057a871c752ff6
2015-02-17 10:29:38 +09:00
Dave Borowitz
4241459b3f Terminate sortkey with prejudice
It has not been used by the search system since 2.8 and all code using
it in a meaningful way in Gerrit has been removed. Now we can remove
it from the database and API classes.

This requires a schema upgrade to delete the column and rebuild some
indexes to use last_updated_on instead of sort_key.

Change-Id: I87660f8e0e44bf11bafd9fa24f990351759df3fb
2014-12-23 14:48:06 -08:00
David Pursehouse
f60e7a9d7b Merge branch 'stable-2.9' into stable-2.10
* stable-2.9:
  Add CSS style name on review comment div
  Fix incorrect formatting in json documentation
  Don't use deprecated PGPPublicKeyRingCollection constructor
  Add InitStep to fix wrong primary key column order

Change-Id: Id89fc4ec6684396ce13acb57f925fcff53f6b06e
2014-11-21 09:40:41 +09:00
Sven Selberg
a1a5d62da9 Fix incorrect formatting in json documentation
Change-Id: Idaf47978ddd09c9f7a5708efb7d70afcfb8899f8
2014-11-20 10:41:14 +09:00
Doug Kelly
40324a8f13 Fix incorrect attribute name
The ChangeKind attribute exposed in the JSON was incorrectly written
originally.  The correct attribute in the JSON is "kind".

Change-Id: I225bb4cdb486810d8f8c3a3c9969a13ce70a0365
2014-05-28 10:21:52 -05:00
Doug Kelly
58ba20634f Add change kind to PatchSetCreatedEvent
Pass along an extra flag in the patchset-created hook to convey
the change kind.  This is also exposed in the PatchSetCreatedEvent
as the "kind" field.  Both follow the ChangeKind enum type, where a
change can be "REWORK", "NO_CODE_CHANGE", or "TRIVIAL_REBASE".

Bug: Issue 2634
Change-Id: Ie04d0282e42ab177810fafd857e90d21999cab28
2014-05-27 11:19:47 -07:00
Yuxuan 'fishy' Wang
61698b14e0 Use the new section title style in Asciidoctor.
We previous use the section title style like:

Section level 1
===============

Section level 2
---------------

Which have a problem in Asciidoctor that the number of "="s or "-"s must match
the number of characters in the header exactly, as a result it's easy to make
mistakes while changing the titles. Asciidoctor provides a better style like:

= Section level 1

== Section level 2

So we switched to this style.

Also fixed a bug in replace_macros.py, which will not cause any problem in the
old style.

Change-Id: I811dd7238735d98f662767c17086152cd69aea02
2013-12-20 12:55:51 -08:00
Yuxuan 'fishy' Wang
99cb68dec4 Added searchbox to documentation.
This provides the entry point of the documentation search feature.

Change-Id: Iea2b707995c0e042829db509927384dcec7aaf43
2013-11-05 12:49:43 -08:00
Mani Chandel
72cb603f93 Add --all-reviewers to ssh gerrit-query
The new allReviewers parameter allows users to view the name and
email of all reviewers which are added to a change (irrespective of
whether they have been voting on that change or not).

Feature: Issue 2102
Change-Id: I655a49c37b959eb2f0bb705e2c45cb9bdc33ea23
2013-10-17 21:55:53 +02:00
Christian Aistleitner
ca50428bea Bring draft status to PatchSetAttribute
Thereby, stream event consumers can differentiate between events that
are tied to a draft patch set and those that are not.

Change-Id: Idbdcfc979f2383de0708560bf2e148fcc51d612f
2013-07-05 23:13:08 +02:00
David Pursehouse
5ab70e33e1 Update documentation of JSON file attributes
Commit ef38c07 renamed PatchResource to FileResource.

Although the code change does not affect the content of the JSON
data, update the documentation to make the description consistent.

Change-Id: I3598d4d40c95817e2e676006085046cce108e2ac
2013-05-08 05:46:08 +01:00
David Pursehouse
93a4ae6cb0 Add clarifications in the documentation of the query command
- Add a statement that the result is always for the latest patch set,
  even if the query matched on an earlier patch set

- Add a link to the change attribute documentation from the JSON
  format option description.

- Add clarification in the change attribute documentation that the
  commit message is of the latest patch set.

- Correct a minor typo

Change-Id: Ie6a825d1d183994926662c0ad8c42ec15f687e51
2013-05-02 14:29:41 +00:00
David Pursehouse
981b016bcd Add DRAFT change state to JSON documentation
Change-Id: Ia13b3c8f2d6e02aa5d1388e25f517ba3f49f2ff2
2013-02-21 17:27:49 +09:00
Edwin Kempin
5944d64152 Document CapabilityInfo that is returned by /accounts/self/capabilities
Change-Id: I40da206b36bb2182e0736245d7406d35bccc3d5a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-02-15 09:31:42 +01:00
Bruce Zu
6b0fd7650f Update document to add content of file comment.
Change-Id: I9366263033b1865cdede75c95b08c78dcb8c44fe
2012-11-17 12:43:57 +08:00
David Pursehouse
877d493809 When a file is renamed, include old file name in Patch attribute
When a file is renamed, the value of `file` in the Patch attribute
is the new file name.  The old file name is not included.

This means it is not possible to find the old file name by running
a gerrit query command.

Add a new field `fileOld`. When the file is renamed, this field
contains the old file name.

The name of the existing field is unchanged.  Renaming to `fileNew`
would make the name more meaningful and consistent with `fileOld`,
but would make it incompatible with user scripts that expect it to
be called `file`.

Change-Id: Ie29c9ea31a6d73ab7ff0c91bf0c10dc10c3636d6
2012-10-31 10:42:44 +09:00
David Pursehouse
cbbb34920e Remove duplicate section in documentation
The `submitRecords` field is included twice in the documentation
of the `change` attribute.  Remove the duplicate.

Change-Id: Ib859a3a83930ec34715c496486fc42ef1ce8e8b4
2012-10-24 15:34:53 +09:00
Shawn O. Pearce
7dd18f5f2c Merge branch 'stable-2.5'
* stable-2.5:
  Fix order of top-level menus
  Ensure that ObjectOutputStream in H2CacheImpl is closed
  Flush persistent H2 cache if the existing entries are incompatible
  Fix plugin loading when running as hosted WAR or GWT DevMode.
  ChangeMessageAccess: Add index for byPathSet method.
  File indentation is sometimes wrong in Side-By-Side
  Move the Groups and Plugins menu items to the top level.
  Call inserter.flush() when creating code review notes
  Add ssh command "test-submit-rule"
  Split up canSubmit()
  Add submit records to query output.

Conflicts:
	Documentation/json.txt
	gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java
	gerrit-server/src/main/java/com/google/gerrit/server/project/ChangeControl.java

Change-Id: I6f9d44cfbd7060d65c8eb8a399d089a88f9bc697
2012-10-16 12:13:32 -07:00
Bruce Zu
1a9be5ee43 Add author and size information to output of query.
Add author information to output of query options:
 '--patch-sets'.
 '--current-patch-set'.

Add size information to output of query options:
 '--patch-sets'.
 '--current-patch-set'.
 '--files'.

This information can now be retrieved by both SSH and
the HTTP REST API.

Change-Id: I7ef0f2dce6a4d2bd2dd2532e4bb48a22522b659a
Signed-off-by: Bruce Zu <bruce.zu@sonymobile.com>
2012-10-11 16:03:39 +02:00
David Pursehouse
6002bb279b Add missing JSON attribute documentation
Documentation is missing for several JSON attributes.  Add it.

Also fix a minor typo in Patch.java comments, where some of the
added documentation is copy/pasted from.

Change-Id: I1bb33384a668ebc5c4b778773a59ba1291100660
2012-10-11 20:53:30 +09:00
James E. Blair
f9a4e2f42f Add submit records to query output.
Add a command line option to the gerrit query ssh command to include
submit records in output.

This facilitates the querying of information relating to the submit status
from the command line and by API clients, including information such as
whether the change can be submitted as-is, and whether the submission
criteria for each review label has been met.  Example output:

  submitRecords:
    status: NOT_READY
    labels:
      label: Verified
      status: OK
      by:
        name: James E. Blair
        email: corvus@example.com
        username: corvus
    labels:
      label: Code-Review
      status: NEED

Change-Id: If13393aadfcce75a049d9b15c7467cb8df5570d9
2012-10-10 15:28:05 +02:00
James E. Blair
3fe3d3fb99 Add submit records to query output.
Add a command line option to the gerrit query ssh command to include
submit records in output.

This facilitates the querying of information relating to the submit status
from the command line and by API clients, including information such as
whether the change can be submitted as-is, and whether the submission
criteria for each review label has been met.  Example output:

  submitRecords:
    status: NOT_READY
    labels:
      label: Verified
      status: OK
      by:
        name: James E. Blair
        email: corvus@example.com
        username: corvus
    labels:
      label: Code-Review
      status: NEED

Change-Id: If13393aadfcce75a049d9b15c7467cb8df5570d9
2012-10-04 16:29:28 -07:00
Edwin Kempin
691b9b14d7 Improve documentation of REST endpoint /accounts/self/capabilities
Commit e0169338466d870ccd5867f3bb13cd3a094d1efb added an REST endpoint
for querying the global capabilities of the calling user. Not all
features of this endpoint that were described in the commit message
were contained in the REST API documentation.

Change-Id: I5221b2f180b9deda69a5beec0bacf5033e7bd511
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-07-19 09:29:47 +02:00
James E. Blair
f2c292e1bb Add owner username to gerrit query command.
Change-Id: Iec0a2adfdf6c4a2dd9a94dc327b68f836b59da59
2012-06-18 09:16:44 -07:00
Edwin Kempin
a19ff379fd Fix stream-events documentation
Some attributes contained in the events were not described, for a few
others the name was given in a wrong case.

Change-Id: I3b6b1f400a1b040ca9acfd57b20eef9d2d92aaa5
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-06-15 10:25:00 +02:00
David Pursehouse
221d4f6250 Documentation: Various corrections
Correct typos, spelling mistakes, and grammatical errors.

Change-Id: I80ec66de7b2228f9ff45a2f06faf576707195758
2012-06-12 14:54:54 +02:00
Brad Larson
0943d6e7fc Output full commit message in query results
If the user adds a flag to the query parameters, include the full
commit message in the result data.  This is helpful when verifying
commit messages and with similar tasks.

Change-Id: Iff93bfebfa0c5e2209be29fe60ae12809a76479a
2011-11-17 10:39:48 -06:00
Jesse Greenwald
6cc1190d8f Added support for ref-update events
Whenever a ref is updated via either a direct push to a branch or a
Gerrit change submission, Gerrit will now send a new "ref-updated"
event to the event stream.  This can be used by external agents for
things like automatic submodule ref updating, replication, build bot
hooks, etc.

Change-Id: Ice9d65db8fd662d53df53ff6b61d811815c9f2f6
2010-10-15 13:17:07 -07:00
Shawn O. Pearce
14760b7c0e gerrit query SSH command
Define an SSH command that offers the ability to query for change
summary information.  This provides the same information as a listing
on the web interface.

The query command is also available over HTTP under the /query URL,
with the query string supplied as the q parameter.

Bug: issue 504
Change-Id: I72fc11dc8872b781bcd6895b3bcd90d85f22e419
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-07-19 11:06:18 -07:00