The only place this class is referenced from is the httpd package, and
the only things it contains are XSRF constants.
Move it to the same package, and rename it to a more appropriate name.
Change-Id: Ia9cb3c8c66ed1db3aeb69419d5187a5aa5bb8936
Historically, Gerrit was generous when computing tag reachability and
fed all refs into the computation. For Gerrit instances that have a lot
of changes, this is extremely expensive.
This commit changes that behavior and documents it. The motivation is
that every ref that Gerrit manages (changes, meta refs, etc.) is
Gerrit's domain and there is no use case for users to add tags.
For now, orphaned tags are still served to users who have READ on refs/*
and no block rules configured, but that might as well change in the
future.
Change-Id: I4820ea69fc4c90127a9a5615ae63fabb7dd32175
In all callers we are providing a set of refs that we care about. This
is either refs/heads/* and refs/tags/* or all refs minus change refs.
In both cases filtering tags separately (that means separately obtaining
all refs that are visible to the user irrespective of the provided
prefix and using these for reachability) is superfluous.
Change-Id: I3151528ada71abdc62721a0d3daa62884036ee1f
For some operations in Gerrit we perform a reachability check. The
majority of checks is fine with just checking if the commit is reachable
from refs/heads/* or refs/tags/* but CommitsCollection requires some
more places to be included like refs/meta/dashboards or refs/users/*.
However, it does not require refs/changes/* to be included in the check
because we have already checked if the commit is reachable by a change
(= is the commit of a change). This check also covers stacked changes as
we have one change per commit in the stack.
There is no case where the parent of a change is neither another change
nor part of a ref that can be reached through refs/heads/* or
refs/tags/*. Therfore we spare reevaluating change refs where possible.
Change-Id: Icba91f7c770863d34c920320e944e8f2e86783e1
* 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
After removal of GWT UI this feature is not used and this can be
removed.
Create project SSH command is offering a similar --suggest-parents
but this is implemented using a dedicated: SuggestParentCandidates
class.
PolyGerrit UI doesn't offer the list of parent candidates to select
from in create repository dialog.
Change-Id: Iaaa687f4df373bc945632367be49941c939f8b9b
Client errors (like an authentication issue) shouldn't be prefixed by
"internal server error: " when Gerrit rejects a commit upload. We
already have special handling for BadRequestException and
UnprocessableEntityException, which we now extend to AuthException.
Change-Id: I126d89dd8d296d20a3cf0b0fbe73d337b2e35320
* 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
With d4fdc9323d8, we're able to read default "project.config" for
All-Projects from the "etc" folder, which makes it possible for us to
provide default configs from the "etc" folder rather than All-Projects.
This commit makes sure we're able to create an All-Projects with just
a project description initialized.
Change-Id: Ia07a818c9897a0bdb8a3f603923b607d74570b6e
With this boolean field, we can control whether initializing
default access sections in the All-Projects.
Change-Id: Ia5dfa6a2a265f2887a21c246de0a8da433db5b2c
With these separate methods, it's easier to understand what ACLs
are initialized by default when an All-Projects is created.
Change-Id: Ie2ecf50f0eae3778520abb283d5fe82fe0835ce8
This allows us to have better control over what is going to be initialized
when an All-Projects is created. As a start, this commit just defines this
@Auto_Value class with several simple properties.
Change-Id: I3facd009434ee387e1799c9ef7b2b49353134379
* stable-2.16:
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
JS API: Expose invalidateReposCache method
restAPI.invalidateGroupsCache: Remove unused parameters
restAPI.invalidateReposCache: Remove unused parameters
Add Javadoc to clarify behavior of {Accounts|Changes|Groups}#withOptions
Update highlight.js to master branch
Docs: Add use-case for Private changes
OnlineNoteDbMigrationIT: improve readability of some tests
Update git submodules
migrate-to-note-db: add --skip-project option
OnlineNoteDbMigrationIT: Reuse existing constant
Do not crash if permitted labels array is empty
Fix '/' getting typed in search bar when pressed
Encode project name in download commands
ProjectResetter: Avoid Repository#getAllRefs
AbstractDaemonTest: Avoid Repository#getAllRefs
ChangeUtil: Remove javadoc references to deprecated JGit methods
Set version to 2.16.4-SNAPSHOT
AccountManagerIT: Fix failing authentication tests
ChangeEditApiImpl: Access non-Singleton change edit classes via Provider
ListChangesOption: Add missing word in Javadoc
Update git submodules
Update git submodules
Fix broken links in gr-icons.html
Add release notes for Gerrit v2.10.8
AccountIT#updateDisplayName: Rewrite to work with updated account manager
Add release notes for Gerrit v2.9.5
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
Set version to 2.16.3
Set version to 2.13.12
Set version to 2.12.9
Set version to 2.11.12
Set version to 2.10.8
Upgrade JGit to 5.1.5.201812261915-r
Set version to 2.15.8
Upgrade JGit to 4.9.8.201812241815-r
Set version to 2.9.5
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
Update git submodules
ChangeApi: Add method to list change reviewers
Bazel: Automatically fix lint errors with buildifier 0.20.0
Revert "Temp fix for projects list ordering in PolyGerrit"
Do not center the "By User" column in the Group Audit Log table
Bazel: Fix more buildifier warnings
Bazel: Automatically fix lint errors with buildifier 0.20.0
Fix typo in documentation of edit preferences
Add MIME type for favicons to list of allowed image types.
Bazel: Automatically fix lint errors with buildifier
Mail: Use correct patch set when reading line from file
Upgrade JGit to 4.5.5.201812240535-r
Change-Id: I15dd15a2e3a1171ddfb792a3f17c43861d434421
It is not used in any tests. It is useful when using Gerrit as a
library, so let's make this helper an ordinary public class.
Noticed via an error-prone warning about a Google-internal caller.
Change-Id: I6fe9f8a792b7fa9328f95aa97893bcec78db367a
* 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
This option will return all possible results and overrides the default
limit and any limit specified using "limit" query operator. This is
useful for applications that need the entire result set with a single
query. Getting data with a single query improves the accuracy since
there is less chance of the data being modified between calls.
Change-Id: Idc4dd5799195110c580c7e6d88c0a6e8c6734d6c
Submitting a change can fail if the commit that should be merged depends
on a commit that belongs to change that is not visible to the calling
user. In this case the following message is returned as part of the 409
response for the submit request:
Change <change-number>: Depends on change that was not submitted.
Commit <sha1-commit-1> depends on commit <sha1-commit-2> which cannot
be merged. Is the change of this commit not visible or was it
deleted?
With this message alone it’s difficult to investigate the problem
because it doesn’t include the calling user, the user for which the
change is not visible. Change it to
Change <change-number>: Depends on change that was not submitted.
Commit <sha1-commit-1> depends on commit <sha1-commit-2> which cannot
be merged. Is the change of this commit not visible to <calling-user>
or was it deleted?
Dry-run submits are executed in the background and hence there is no
current user available. This doesn’t matter since for dry-run submits
the message is anyway ignored.
Change-Id: I8ff1ad7041c9632b3fdbfdba19d83c984a776a01
Signed-off-by: Edwin Kempin <ekempin@google.com>
These are often ambiguous without their containing class, not to mention
used inconsistently within single class files. Implement a consistent
policy.
After this change there are exactly two remaining:
$ find . -name \*.java | sort | xargs pcregrep '^import.*\.[A-Z][^.]*\.(NameKey|Key|Id|Entry);'
./java/com/google/gerrit/httpd/CacheBasedWebSession.java:import com.google.gerrit.httpd.WebSessionManager.Key;
./javatests/com/google/gerrit/server/change/ChangeKindCacheImplTest.java:import com.google.gerrit.server.change.ChangeKindCacheImpl.Key;
These are corner cases of a specific cache implementation where the Key
type is less ambiguous, and the full name is long.
Change-Id: I1d2e9eb6c7dec0d09ca42b41dc252786d2024a5a
This reverts commit f5c89c1a6f01aee6295717fb785a4bfbacb8ce86.
Reason for revert:
Bootstrapping doesn't work because the index doesn't give us
all changes. In addition, we would have to filter way more
refs with this cache because the index-backed cache limitted
the ref filtering by recency (= you can't fetch a change from
say 2015) which is another performance bottleneck.
Change-Id: I447eaeb652e530ed560f31de15bb012912e14fff
* 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
If JGit can't find the ref, it will return null. There is no guarantee
that we have a change meta ref for each change so we want to log these
instances instead of failing the entire operation.
Change-Id: I2e33d05e77bb80c2e1db6b5ee0067dfefa25cce2