Before this change, when using init in interactive mode and the input was
invalid for the HTTP daemon settings (e.g. invalid 'host'), init would
fail with a fatal error, but the invalid configuration string would still
be written to the configuration file.
Change-Id: Icf5d864b61443c13bcc6a90c766b16cc908052d5
Fix a recurring issue after the migration of external ids from ReviewDb
to NoteDb failing with the error 'Email <email> is already assigned to
account <>' and thus failing LDAP authentication.
The LDAP authentication may or may not have generated the preferred
email record in the main 'gerrit:<>' account. Consequently, users may
have added their external id as additional 'mailto:<>' record. That
was a normally supported use-case and, previously in v2.15, did not
create any problems or conflicts.
Starting with v2.16 the extra check for unique e-mails did go a bit too
far and blocked the ability to have both the 'mailto:' record and having
the same value also as preferred e-mail, which is incorrect because it is
a perfectly valid use-case (see Change-Id: Ie4c677365cd).
When linking or updating the preferred e-mail to an existing account,
accept duplications only if both external ids belongs to the target
account id. Because both e-mails (preferred e-mail and 'mailto:' record)
belongs to the same account, they are not really duplicated but just a
legacy of the way Gerrit was used to indicate an external 'mailto:'
identity that has been selected as primary e-mail afterwards.
Add unit-test that consistently reproduce the issue that many people
have reported after having migrated the accounts and external-ids to
All-Users.
NOTE: Even though the issue has been reported on the LDAP authentication
use-case, the problem lies in AccountManager and is more generic.
Fix the consistency checker for the e-mail external ids when
multiple duplicate entries are associated with the same account.
Bug: Issue 11246
Bug: Issue 9001
Change-Id: I78bc82faa2761bc0e56a9fa54a94225c82317275
If a user had a capability added by a plugin, e.g. in case of the
serviceuser plugin to create a service user, but was not an
administrator, modifying a resource was failing. The error involved was:
com.google.gerrit.server.permissions.PermissionBackendException:
cannot extract permission
This error was caused, since the plugin name was not set in the viewData,
when the capabilities were checked in case the view was
a child RestCollection.
This change sets the plugin name in the viewData to the value of the
parent view instead of setting it to `null`.
Bug: Issue 11374
Change-Id: Ia679367216cf8898b60445a1290b9ac5b1f56b25
Since SSHD 1.7.0 unknown channel reference should be provided, otherwise
session can crash, see this SSHD issue for more details: [1].
[1] https://issues.apache.org/jira/browse/SSHD-942
Bug: Issue 11491
Change-Id: Ic3d5f86ead0cf9669a3d73d6822ccd8b86114607
If one change-update in a batch affects All-Users it is assumed that
all ChangeTasks updates NoteDb. This is not true when a stack of
changes is pushed and the changes(s) at the bottom of the stack are not
updated, existing last patchset is pushed.
Bug: Issue 11442
Change-Id: I0c828635920cc437da3da20785d3882a2e68d086
The ChangesCollection rejects the request if the current user doesn't have the
Read permission on the loaded change. Therefore, an attempt to reindex a change:
PUT /changes/myProject~12345/index
gets rejected even before it reaches the indexing code.
On the other side, the admin can reindex all changes of that project and thus
also index the change 12345:
POST /projects/myProject/index.changes
Indexing all changes of a project in order to just index one change is too much.
Add a new REST endpoint where a set of change-ids to index is given in the
request body.
POST /config/server/index.changes
Content-Type: application/json; charset=UTF-8
{changes: ["foo~101", "bar~202"]}
Bug: issue 11205
Change-Id: I05fcc5a024c7634a969a7baac9fd61f3d0f3d12a
* stable-2.15:
Format BUILD files with buildifier
Format BUILD files with buildifier
junit.bzl: Fix name conventions warning flagged by buldifier
Bazel: Avoid using tools in action inputs
dev-contributing: Update recommended version of buildifier to 0.28.0
Change-Id: I20579e30a97b640d23df38e2bf129fea0003c548
Fix the NoteDb migration progress by converting its binary output
into printable characters that can be easily understood by humans.
Bug: Issue 11444
Change-Id: I6c2c6f036d8e5402ce72b7cdd53a4677b0f54521
* stable-2.15:
Bazel: Add fixes for --incompatible_load_{java|python}_rules_from_bzl
Bazel: Bump minimum supported version to 0.29.0
Lucene index configuration and docs.
Change-Id: I6c597cbc89fafece83c374e9b36c4c4c0126704f
* stable-2.15:
Set version to 2.15.17-SNAPSHOT
Set version to 2.15.16
Revert "CreateAccount: Fail early when invalid SSH key is given"
tools/eclipse/project.py: Fix typo of bazelisk
Migrate from old-style legacy .java provider to the new JavaInfo.
Support bazelisk or bazel in tools/eclipse/project.py
Rework imports in project.py
Update project.py to use argparse
Change-Id: If9388140c516f8ff2f5275eefe6cf65dad42449e
This reverts commit bd68b579e87736977df26bb6ef6a1649b635577f.
Reason for revert: Not needed after JGit update was reverted.
Change-Id: I6a27c05e7078d6874db66e1c0919622748e5bf75
This reverts commit 0d025efd4b644bbc2d9368bac5d8f353dd9f5d75.
Reason for revert: Not needed after JGit update was reverted.
Change-Id: If26d672dd3f09f5ff25540ad90128e1edd08ee41
This reverts commit cba560d1fc26e7d757a28596a1d292537dec21fc.
Reason for revert: The Jgit upgrade that made it necessary is
being reverted.
Bug: Issue 11373
Change-Id: I372023a611cfe02adc38827ceb6a66b5f9a67ce0
* stable-2.15:
AccountIT: Test that account is not created with invalid email
CreateAccount: Fail early when invalid SSH key is given
Use base url for commentlink
Change-Id: Ifac43208ba54ffcc012e1ff9374272466555bfbc
In JGit 5.1.10.201908230655-r additional debug logs were added in
the FileSnapshot class, and these cause a lot of unwanted messages
when running tests.
Set the log level to WARN for this class.
Change-Id: Ie8dba4fd17e59ae5d49730f36f1b5f06f83b17d1
Since [1], which is included in JGit since 5.1.10.201908230655-r, the
method DirCacheEntry#setLastModified(long) is deprecated in favor of
DirCacheEntry#setLastModified(Instant).
Replace the only usage of the deprecated call with the new one.
[1] https://git.eclipse.org/r/#/c/145437/
Change-Id: I7c87b20d518ad68652d2f91317d6a4505df21fe4
Improvements in 5.1.9 and 5.1.10:
- measure FileStoreAttributes per filesystem
- improve measuring file timestamp resolution
- measure minimal racy interval
- use Instant to increase resolution to 1us (limited by FileTime)
- persist FileStoreAttributes
- optional asynchronous measurement of FileStoreAttributes
- directory - FileStore cache
- cache user and system level gitconfig
- fix supportsAtomicCreateNewFile default to true
- fix non-deterministic hash of archives created by ArchiveCommand
Release notes:
https://projects.eclipse.org/projects/technology.jgit/releases/5.1.9https://projects.eclipse.org/projects/technology.jgit/releases/5.1.10
Change-Id: Ifc110f1f305d16cb7f3c2dbe55e3b4855c1b7ce1
When removing all the changes associated with a user,
do not bump the associated updatedOn timestamp similarly
to what it does the single removal of individual drafts.
Add also coverage for the existing use-cases where
adding or removing a draft change should not update
the updatedOn timestamp, already working but not properly
covered.
Bug: Issue 11325
Change-Id: Ieaad3888b570db9eee6e2eb8130acc3b4cfe3d16
Allow to track the progress of the conversion to
NoteDb by sending the progress output to Flogger
instead of throwing it away.
This allows Gerrit admins to keep track of the status
of the migration to NoteDb and predict the ETA of the
conversion completion.
Bug: Issue 11348
Change-Id: I398a118c966faebab64c0dfa718ee268191eae5c
Implementations may want to only change the default for some of the
ChangeReportFormatter's methods, in which case it makes sense to
extend the default implementation. However this is not possible when
its constructor is private.
Likewise, extending classes might need to use the UrlFormatter instance.
Make the constructor public and the UrlFormatter protected so that they
are visible to deriving classes.
Change-Id: Ia4a24f29e0d283cad40b1f90d019ea7f65bc0cb2
* stable-2.15:
StarredChangesUtil: Fix NPE when ref to be deleted doesn't exist
StarredChangesUtil: Throw LockFailureException on LOCK_FAILURE
Add test for creating a change on a non-existing base change
Rebase: Do not fail with 500 ISE if non-existing change is given as base
Fix detecting changes of parent trees when computing change kind for merge commit
Change-Id: I8ec9c55d86c3b425e0bce289f4c92cd5b6adbc80
Change I45ccec5ed removed several methods from InternalAccountQuery
that are no longer used in core Gerrit. One of them, however, is
used in CollabNet's integration.
Add back the method that is used, and annotate it with @UsedAt.
Make adaptations compared to the original version that was removed:
- Use the FluentLogger rather than slf4j's Logger
- Use the Stream API rather than Guava's Lists.transform
This partially reverts commit 69f297f568aa3648df1096aba08eac387ef7e28d.
Change-Id: I9170932646960754ef2ec4b9287d7c71844403a2
* stable-2.15:
Revert "Migrate from old-style legacy .java provider to the new JavaInfo."
Catch all exceptions for reporting on Schema_130 migration
Migrate from old-style legacy .java provider to the new JavaInfo.
Change-Id: I8fe109677bfa32c4fccceef28ff234d666d90c24
The methods' javadocs state that the return is 'null', but this was
changed some time ago to be Optional.empty().
Change-Id: I8f883cf7d79efb848d70043d23ecc707cfcdf1d0
* stable-2.15:
ChangeApi: Add methods to get change comments/drafts as list
ListChangeComments: Extend ListChangeDrafts
detach -> detached
Fix anchor tag for settings page
Change-Id: Id9f3cf0b5ec13ac38f6f011c611c5096f622c1aa
* stable-2.15:
Add support for Elasticsearch version 7.3.*
Also update ElasticV7QueryProjectsTest to use V7_3.
Change-Id: Ib7081c5b15756e2ca91d448430928b2f5b8aca50
* stable-2.15:
ElasticContainer: Upgrade to 6.8.2 image for V6_8 tests
Fix typo: program
Clarify usage of 'parent' option in list files API
Remove unused Skylark patch file
Files: Use Gerrit API to get revision parents
Add support for Elasticsearch version 6.8.x
Upgrade elasticsearch-rest-client to 7.2.1
CommitApi: Add method to get commit info
Consolidate all CommitApi tests into a single class
Files: Validate parent option to prevent internal server error
RevisionIT: Assert that files(base) only works for patch set revisions
Fix and expand documentation of REST API to get revision files
RevisionIT#files: Simplify assertion
Update git submodules
Also update ElasticV6QueryProjectsTest to use V6_8.
Change-Id: I98da65486f39acad509529ff90540d9f8ae00a2d
The ls-user-ref was broken by Change-Id: I1819de0bab where
the refactoring of the permission backend needed to be passed
the current user as parameter. As a result, the LsUserRefs, started
using the user's identity executing the command instead of the one
requested as a parameter.
Bug: Issue 11235
Change-Id: I48b6e14a2fe24d3d2a96a8274bd9e0108dc0c95d
Callers do not expect that methods that return an Optional may also
return null.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I1962891693aaa9048771f5f7eae7c303a826da13
This REST endpoint shouldn't accept any input, but it was wrongly
accepting a ProjectInput (which is used by the Create Project REST
endpoint to specify the properties of a new project).
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Iaada3114e11dccba474f3e26101017a576998b79
* stable-2.15:
Expose Gerrit's GWT client library in the plugin API
Replace usage of Iterables.limit with Java 8 Stream API
Follow up to "Adapt gerrit.sh script to work on Alpine Linux"
Change-Id: If66c0dd7f912e4551a6855c3cf299ed2586873dc