The method UrlFormatter#getChangeViewUrl has the @Nullable annotation
on the project argument, allowing the project name to be omitted from
the URL.
The URL used in the Reviewed-On footer, which is added to the detailed
commit message, is the only place that passes null for that parameter,
and as a result this is the only place in Gerrit where the change URL
does not include the project name.
Bug: Issue 10512
Change-Id: Ib6737af0a72adb7706caa20991780be71617dd24
Since change I375245647 the UrlFormatter is bound as a DynamicItem,
so it should also be injected as such.
For this class we can't simply change the constructor parameter since
the UrlFormatter is not stored as a member but is used to initialise
the abandon message, which may have a $URL placeholder which is used
to replace with the actual URL provided by the UrlFormatter.
Change it so that the abandon message is initialized in the construcor
as before, but the replacement of the $URL placeholder is only done at
the time the message is needed.
Bug: Issue 10500
Change-Id: If4299276ec94402e8d2b806ad179e185e307d1ab
Since change I375245647 the UrlFormatter is bound as a DynamicItem,
so it should also be injected as such.
Adjust most remaining classes to do that. The only one remaining is
the ChangeCleanupConfig which requires slightly more invasive changes
and will be done in a separate commit.
Bug: Issue 10500
Change-Id: Ie9eeef11bd5ce63168bb339e22ee3062482ddd25
* stable-2.15:
Set version to 2.15.12-SNAPSHOT
Set version to 2.15.11
Allow LFS-over-SSH created auth pass through ContainerAuthFilter
Upgrade elasticsearch-rest-client to 6.6.1
ElasticContainer: Bump the test server version to 5.6.15
Change-Id: I6a54f5b233cf9fa6053241b729cdd300f83dfdc9
By default all acceptance tests start Gerrit in DEBUG level, which in
some cases may generate *a lot* of logs that may pollute the output
console and make troubleshooting very difficult.
Allow specific tests to customise the log level and reduce it to
a more acceptable level.
Sample use:
@LogThreshold(level = "INFO")
public class MyTest extends AbstractDaemonTest {
@Test
public void shouldJustWork() {
// test code
}
}
Change-Id: I2b0b8496de1a43de112ce5b5c427e3c8603d5d9e
* stable-2.15:
AccountIT: Extend assertKeyEquals to check that full key is included
Fix GPG public key export
Change-Id: I68c469722593a53b475144825673cb0e8e9708e7
Introduce a new global configuration parameter gerrit.listProjectsFromIndex
to control the ability to render the project list from the secondary
index or the in-memory cache.
By default, the legacy in-memory cache is used as engine.
NOTE: The legacy in-memory cache provides an unlimited list
while the secondary index limit is defined by the global
capability 'queryLimit' which is defaulted to 500 entries.
Change-Id: I3dc089c2b546ff78c6a5aea65b2d6a255b6e20e1
If a plugin gets CommitValidators injected, the plugin fails to
load with:
No implementation for com.google.gerrit.server.config.UrlFormatter was bound.
Since change I375245647 the UrlFormatter is bound as a DynamicItem,
so it should also be injected as such.
Bug: Issue 10500
Change-Id: Ieabb12b2086f8f785c8013e62193c8b811e00500
* stable-2.15:
gerrit.sh: Improve error message when JRE cannot be found
PrologEnvironment#setPredicate: Reduce log level to DEBUG
Change-Id: I26703bd42f91a96dc985a2de8e90f93be78bdd63
Add gerrit.primaryWeblinkName to ServerInfo.
Lets the UI know which is the preferred weblink in instances were
only one weblink can be used, for example in inline links.
Change-Id: I01deaca3418d5c0486e3f5ebabf10827d47c3631
With Flogger we must use '%s' as placeholder for parameters.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I834c84516b86b7bdcf800ab06748da30babd9a4f
The documentation says that an input is not required. The code checks
for null values correctly, but the injection methods lack @Nullable
which makes Guice fail to create the object when null is passed to
the factory method.
Annotate the input object as @Nullable to fix this.
Change-Id: I0d424e45d6039fd4ad8386b6811b9134cd600dfd
Render the list of projects to OutputStream leveraging the
projects secondary index instead of relying on the in-memory cache.
Change-Id: I864e1c3cd63b206c0f9dc76bbaa6de99ddfdc0d4
The GWT UI and other parts of Gerrit still rely on the in-memory
cache for rendering the project list.
This is the first step that moves some use-cases to the QueryProjects
engine: full list without filters and showing only the active and readonly
projects.
All other existing use-cases are still based on the in-memory
cache and are going to be addressed in the follow-up of this change.
With regards to filtering by project name substring, it is not
implemented on top of the secondary index because of Issue 10446.
Bug: Issue 10380
Change-Id: I8effed5f75bdf353d9b23a3d349009e5f0535186
The apply(TopLevelResource) method doesn't actually use the given
resource parameter, and only exists to satisfy the interface of its
parent RestReadView.
A variant of the method without the TopLevelResource parameter was
added in change Ia8ded07a5. Modify callers to use that.
Change-Id: I15af0d1cb35750c8aec4b2f42339901c48332889
* stable-2.15:
Disable "prefer-promise-reject-errors" in eslint
Set version to 2.15.10
Daemon: Show status of slave and headless mode in 'ready' log
Daemon: Don't install online reindexer in slave mode
RevisionApi: Add method to list votes per revision
ChangeJson#getApprovalInfo: Add @Nullable annotations
cmd-review: Add another example to clarify review using change number and PS
Update .mailmap
Update cmd-review documentation
Daemon: use regular binding for auditModule
CommitValidators: trim "ERROR" shouting from "forge committer" check
ReceiveCommits: uniformize commit validation error messages.
Inline "Change-Id" string into error messages
Always end the "Change-Id missing" error message with \n.
Print only one hint about Change-Ids at a time
Clean up Change-Id hint text
CommitValidators: Replace indexOf calls with String#contains
CommitValidators: Prefer using Splitter to String.split
Changes I0bfe06bd and I58f8a0e5 are intentionally omitted because
they do not apply to the structure of the stable-2.16 branch.
Change-Id: I711837f062aeefeafa3631601b0150448e879575
QueryProjects REST API does not depend on the resource passed
as input but purely on its query parameters.
Introduce an apply() method without parameters so that the
absence of dependency with the resource becomes more explicit.
Change-Id: Ia8ded07a56a00af15f1fa44679886f24d8eabdd9
Fix a NPE in the decoding of ProjectState to ProjectData when a project
is removed from disk while Gerrit is still running.
Change-Id: I9bbf4e88a3b41d677e17121d10f38d8f901b2e99
GroupAuditService is the interface to the underlying audit
system, while AuditService is the actual implementation.
Instead of directly injecting the implementation class, rely on
the interface and leave the association to AuditService to the
Guice binding.
This is useful because tests may want to replace, at times, the
actual implementation of the audit-trail with a fake in-memory
store.
Change-Id: I31bbb522fb974c2504635ccf1251287d4890af89
When running integration tests with in-memory repositories make
sure that they are all indexed in Lucene before starting the tests.
This enables the implementation of tests that can rely on a
consistent projects index to run.
Change-Id: I2e628e4555ed7faa24fff44a0d226b57b5ce9909
Enabling the search by parent enables the rewrite
of the ListChildProjects REST-API that extracts the children
of a project. Using the Lucene index avoids the full scan
of the ProjectCache and thus speedup the extraction and
reduce the JVM heap consumption.
Bug: Issue 10401
Change-Id: I568d6ba0e5a0bff391f57e2357de6d059d77fe5d
* stable-2.15:
Elasticsearch: Support and use v6.6.0 for testing
Adds <noscript> to PolyGerritIndexHtml.soy
Change-Id: I93e6121d3fbb97d3f6598131148d50c73db19704
The fields that are used for sorting must be added to the document. This
means the documents in the index must be all recomputed, hence we need
new index schema versions for the affected indexes.
The sorting that is done by Lucene for the account index must match the
sorting of accounts that is already done in QueryAccounts before
returning query results to clients. QueryAccounts sorts results by
fullname, preferred email and account ID. If Lucene would do a different
sorting limited queries may return wrong results. E.g. if there are 3
accounts, Foo (ID=1), Bar (ID=2) and Baz (ID=3), which are all matched
by a query for which the results are limited to 2, callers of
QueryAccounts expect Bar and Baz to be returned since QueryAccounts
promises sorting by fullname. If now Lucene would sort by account ID,
Lucene would find Foo and Bar, Baz would be skipped since it's over the
limit. These results are then handed over to QueryAccounts which does
sorting by name so that Bar and Foo are returned to the client. This
would be wrong since the caller expects Bar and Baz. It's a bit unclear
how this worked when Lucene was not doing proper sorting at all, maybe
it was just luck that the withLimit test succeeded before. As Lucene
does the sorting properly now, the sorting in QueryAccounts could be
removed, but since Lucene is not the only index implementation and other
index implementation may still have sorting issues we keep that sorting
in QueryAccounts for now.
Bug: Issue 10210
Change-Id: Ic59e4d330fe8c7198023ddbc2fa946cf5db80b63
Signed-off-by: Edwin Kempin <ekempin@google.com>
(cherry picked from commit 714f7d3c3f6540b6d52bc4a426476f692eae612c)
* stable-2.15:
Set version to 2.15.9
ListProjects: Refactor to avoid excessive heap usage
ListProjectsIT: Add test for parent candidates option
Change-Id: If133e258196163e0ce4c58fc9bcf38ef84485bb5
* stable-2.15:
Fix support for deleting branches (if you have can_delete)
FileApi: Add a method to set a file's "reviewed" flag
Change-Id: I72b3ece539223452a8cd446825d20eacbb82f153
* stable-2.15:
Consume JGit artifacts from Maven Central
Consume JGit artifacts from Maven Central
gr-related-changes: Don't show "Same topic" for only one change
RelatedChanges: Don't show "Same Topic" for only one change
ChangeEditApi: Allow to set options on change edit detail request
Add Javadoc to clarify behavior of {Accounts|Changes|Groups}#withOptions
OnlineNoteDbMigrationIT: improve readability of some tests
Update git submodules
Add release notes for Gerrit v2.10.8
Add release notes for Gerrit v2.9.5
Set version to 2.13.12
Set version to 2.12.9
Set version to 2.11.12
Set version to 2.10.8
Set version to 2.9.5
Change-Id: Id02a8afc6e4e8d42b759ed2ea28a0926411ff2e8
* stable-2.15:
ListChangesOption: Add missing word in Javadoc
Update git submodules
AccountIT#updateDisplayName: Rewrite to work with updated account manager
AccountApiImpl: Fix message in exception
RelatedChangeAndCommitInfo: Use default CommitInfo#toString
Support Get Related in extension API
CommitInfo: Use ToStringHelper
CommitInfo: Handle root commits in toString()
Implement equals/hashCode/toString in CommitInfo and friends
Set version to 2.15.9-SNAPSHOT
AccountIT: Disable failing updateDisplayName test
Change-Id: Id2c1ad86a3f5ebb62a932b02d315330ae7a11102
* stable-2.15:
Set version to 2.15.8
Upgrade JGit to 4.9.8.201812241815-r
Set version to 2.14.18
Revert "Fix the missing DB entry in Gerrit DB"
Upgrade JGit to 4.7.7.201812240805-r
maven_jar: Add repo.eclipse.org to supported repositories
Upgrade JGit to 4.5.5.201812240535-r
Change-Id: I012c25d49b9c03e91404c3166f30fdb7f32810f5
This reverts commit 719b2d1067a8d655222d70417310753c93ba2d21.
Reason for revert: Using the standard project list would
bring the performance back to v2.15. The cure is worse
than the illness.
Change-Id: Ic94ac6e944d13ca4bd167e63bc2a8f9942cf5b38
If you add a comment on PS1, but post your reply on PS2,
the text line in the email was taken from PS2, which can
have a completely different content for the same line.
Bug: Issue 4278
Change-Id: I88c6035e404582e96b621367d8b3f665f7828906
* stable-2.15:
EditInfo: Include the change edit ref
Add missing documentation of base_patch_set_number in edit API
Change-Id: Ib005e971116f569d73e1019d2b3cd27f9ba3da32