From 5526b9376965ea490604409526f989eae873bca3 Mon Sep 17 00:00:00 2001 From: Sven Selberg Date: Thu, 17 Dec 2020 09:43:18 +0100 Subject: [PATCH 1/8] ForRef#check should permit internal users to read all refs 79d24d4 Make PermissionBackend#ForRef authoritative Introduced a regression where InternalUsers where not taken into consideration when checking READ permission. Bug: Issue 13786 Change-Id: I3f18507f65044ac96321c1efecf1f2688f36859f (cherry picked from commit 23ff2cfc8ffc00ad3d6e2c752d63394957c8720d) --- .../gerrit/server/permissions/RefControl.java | 4 ++++ .../server/permissions/RefControlTest.java | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/java/com/google/gerrit/server/permissions/RefControl.java b/java/com/google/gerrit/server/permissions/RefControl.java index 650c8bab4e..10ded3c220 100644 --- a/java/com/google/gerrit/server/permissions/RefControl.java +++ b/java/com/google/gerrit/server/permissions/RefControl.java @@ -603,6 +603,10 @@ class RefControl { private boolean can(RefPermission perm) throws PermissionBackendException { switch (perm) { case READ: + /* Internal users such as plugin users should be able to read all refs. */ + if (getUser().isInternalUser()) { + return true; + } if (refName.startsWith(Constants.R_TAGS)) { return isTagVisible(); } diff --git a/javatests/com/google/gerrit/server/permissions/RefControlTest.java b/javatests/com/google/gerrit/server/permissions/RefControlTest.java index 04b84b6f75..14fa01ceec 100644 --- a/javatests/com/google/gerrit/server/permissions/RefControlTest.java +++ b/javatests/com/google/gerrit/server/permissions/RefControlTest.java @@ -47,6 +47,7 @@ import com.google.gerrit.metrics.MetricMaker; import com.google.gerrit.reviewdb.client.AccountGroup; import com.google.gerrit.reviewdb.client.Project; import com.google.gerrit.server.CurrentUser; +import com.google.gerrit.server.InternalUser; import com.google.gerrit.server.account.CapabilityCollection; import com.google.gerrit.server.account.GroupMembership; import com.google.gerrit.server.account.ListGroupMembership; @@ -367,6 +368,11 @@ public class RefControlTest extends GerritBaseTests { assertAllRefsAreNotVisible(user(allUsers, DEVS)); } + @Test + public void userRefIsVisibleForInternalUser() throws Exception { + internalUser(local).controlForRef("refs/users/default").asForRef().check(RefPermission.READ); + } + @Test public void branchDelegation1() throws Exception { allow(local, OWNER, ADMIN, "refs/*"); @@ -1013,6 +1019,21 @@ public class RefControlTest extends GerritBaseTests { return repo; } + private ProjectControl internalUser(ProjectConfig local) throws Exception { + return new ProjectControl( + Collections.emptySet(), + Collections.emptySet(), + sectionSorter, + changeControlFactory, + permissionBackend, + refVisibilityControl, + repoManager, + refFilterFactory, + allUsersName, + new InternalUser(), + newProjectState(local)); + } + private ProjectControl user(ProjectConfig local, AccountGroup.UUID... memberOf) { return user(local, null, memberOf); } From fce488d7dc45396dae3bde6011e3c296ce7f1357 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Thu, 28 Jan 2021 23:23:54 +0000 Subject: [PATCH 2/8] Do not use ReviewDb anymore when is disabled When notedb.config is set to read from NoteDb and ReviewDb is disabled, do not use anymore a real instance of the DBMS connection to access ReviewDb but return a simple NoOpReviewDb wrapper that returns dummy values for relation name/id and the fixed Gerrit version number. Bug: Issue 14013 Change-Id: I7132d0e6007ead880e4161f52c2f4b12f13f1e59 --- .../google/gerrit/pgm/init/InitAdminUser.java | 5 +- .../gerrit/reviewdb/server/NoOpReviewDb.java | 719 ++++++++++++++++++ .../schema/NotesMigrationSchemaFactory.java | 10 +- ...ema_166_to_167_WithGroupsInNoteDbTest.java | 8 +- ...a_166_to_167_WithGroupsInReviewDbTest.java | 5 +- 5 files changed, 738 insertions(+), 9 deletions(-) create mode 100644 java/com/google/gerrit/reviewdb/server/NoOpReviewDb.java diff --git a/java/com/google/gerrit/pgm/init/InitAdminUser.java b/java/com/google/gerrit/pgm/init/InitAdminUser.java index f12fa50507..f4289e776a 100644 --- a/java/com/google/gerrit/pgm/init/InitAdminUser.java +++ b/java/com/google/gerrit/pgm/init/InitAdminUser.java @@ -36,6 +36,7 @@ import com.google.gerrit.server.index.account.AccountIndex; import com.google.gerrit.server.index.account.AccountIndexCollection; import com.google.gerrit.server.index.group.GroupIndex; import com.google.gerrit.server.index.group.GroupIndexCollection; +import com.google.gerrit.server.schema.ReviewDbFactory; import com.google.gerrit.server.util.time.TimeUtil; import com.google.gwtorm.server.SchemaFactory; import com.google.inject.Inject; @@ -85,8 +86,8 @@ public class InitAdminUser implements InitStep { public void run() {} @Inject(optional = true) - void set(SchemaFactory dbFactory) { - this.dbFactory = dbFactory; + void set(@ReviewDbFactory SchemaFactory dbProvider) { + this.dbFactory = dbProvider; } @Inject diff --git a/java/com/google/gerrit/reviewdb/server/NoOpReviewDb.java b/java/com/google/gerrit/reviewdb/server/NoOpReviewDb.java new file mode 100644 index 0000000000..8fe3413cfe --- /dev/null +++ b/java/com/google/gerrit/reviewdb/server/NoOpReviewDb.java @@ -0,0 +1,719 @@ +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.gerrit.reviewdb.server; + +import com.google.common.util.concurrent.CheckedFuture; +import com.google.gerrit.reviewdb.client.Change; +import com.google.gerrit.reviewdb.client.Change.Id; +import com.google.gerrit.reviewdb.client.ChangeMessage; +import com.google.gerrit.reviewdb.client.CurrentSchemaVersion; +import com.google.gerrit.reviewdb.client.PatchLineComment; +import com.google.gerrit.reviewdb.client.PatchSet; +import com.google.gerrit.reviewdb.client.PatchSetApproval; +import com.google.gerrit.reviewdb.client.PatchSetApproval.Key; +import com.google.gwtorm.server.Access; +import com.google.gwtorm.server.AtomicUpdate; +import com.google.gwtorm.server.OrmException; +import com.google.gwtorm.server.ResultSet; +import com.google.gwtorm.server.StatementExecutor; +import java.util.Map; + +/** ReviewDb that is disabled. */ +public class NoOpReviewDb implements ReviewDb { + public static class ReviewDbDisabledException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private ReviewDbDisabledException() { + super("ReviewDb has been disabled and should not be used anymore"); + } + } + + @Override + public void close() { + // Do nothing. + } + + @Override + public void commit() { + throw new ReviewDbDisabledException(); + } + + @Override + public void rollback() { + throw new ReviewDbDisabledException(); + } + + @Override + public void updateSchema(StatementExecutor e) { + throw new ReviewDbDisabledException(); + } + + @Override + public void pruneSchema(StatementExecutor e) { + throw new ReviewDbDisabledException(); + } + + @Override + public Access[] allRelations() { + throw new ReviewDbDisabledException(); + } + + @Override + public SchemaVersionAccess schemaVersion() { + return new SchemaVersionAccess() { + + @Override + public void upsert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void update(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Map + toMap(Iterable c) { + throw new ReviewDbDisabledException(); + } + + @Override + public com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key primaryKey( + CurrentSchemaVersion entity) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet iterateAllEntities() throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void insert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public String getRelationName() { + return "disabled"; + } + + @Override + public int getRelationID() { + return 0; + } + + @Override + public CheckedFuture getAsync( + com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key key) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet get( + Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void deleteKeys( + Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void delete(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void beginTransaction(com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key key) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public CurrentSchemaVersion atomicUpdate( + com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key key, + AtomicUpdate update) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public CurrentSchemaVersion get( + com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key key) throws OrmException { + CurrentSchemaVersion version = new CurrentSchemaVersion(); + version.versionNbr = 170; + return version; + } + }; + } + + @Override + public ChangeAccess changes() { + return new ChangeAccess() { + + @Override + public void upsert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void update(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Map toMap(Iterable c) { + throw new ReviewDbDisabledException(); + } + + @Override + public Id primaryKey(Change entity) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet iterateAllEntities() throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void insert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public String getRelationName() { + return "disabled"; + } + + @Override + public int getRelationID() { + return 0; + } + + @Override + public CheckedFuture getAsync(Id key) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet get(Iterable keys) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void deleteKeys(Iterable keys) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void delete(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void beginTransaction(Id key) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Change atomicUpdate(Id key, AtomicUpdate update) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Change get(Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet all() throws OrmException { + throw new ReviewDbDisabledException(); + } + }; + } + + @Override + public PatchSetApprovalAccess patchSetApprovals() { + return new PatchSetApprovalAccess() { + + @Override + public void upsert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void update(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Map toMap(Iterable c) { + throw new ReviewDbDisabledException(); + } + + @Override + public Key primaryKey(PatchSetApproval entity) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet iterateAllEntities() throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void insert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public String getRelationName() { + return "disabled"; + } + + @Override + public int getRelationID() { + return 0; + } + + @Override + public CheckedFuture getAsync(Key key) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet get(Iterable keys) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void deleteKeys(Iterable keys) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void delete(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void beginTransaction(Key key) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public PatchSetApproval atomicUpdate(Key key, AtomicUpdate update) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public PatchSetApproval get(Key key) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byPatchSetUser( + com.google.gerrit.reviewdb.client.PatchSet.Id patchSet, + com.google.gerrit.reviewdb.client.Account.Id account) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byPatchSet( + com.google.gerrit.reviewdb.client.PatchSet.Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byChange(Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet all() throws OrmException { + throw new ReviewDbDisabledException(); + } + }; + } + + @Override + public ChangeMessageAccess changeMessages() { + return new ChangeMessageAccess() { + + @Override + public void upsert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void update(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Map toMap( + Iterable c) { + throw new ReviewDbDisabledException(); + } + + @Override + public com.google.gerrit.reviewdb.client.ChangeMessage.Key primaryKey(ChangeMessage entity) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet iterateAllEntities() throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void insert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public String getRelationName() { + return "disabled"; + } + + @Override + public int getRelationID() { + return 0; + } + + @Override + public CheckedFuture getAsync( + com.google.gerrit.reviewdb.client.ChangeMessage.Key key) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet get( + Iterable keys) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void deleteKeys(Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void delete(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void beginTransaction(com.google.gerrit.reviewdb.client.ChangeMessage.Key key) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ChangeMessage atomicUpdate( + com.google.gerrit.reviewdb.client.ChangeMessage.Key key, + AtomicUpdate update) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ChangeMessage get(com.google.gerrit.reviewdb.client.ChangeMessage.Key id) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byPatchSet(com.google.gerrit.reviewdb.client.PatchSet.Id id) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byChange(Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet all() throws OrmException { + throw new ReviewDbDisabledException(); + } + }; + } + + @Override + public PatchSetAccess patchSets() { + return new PatchSetAccess() { + + @Override + public void upsert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void update(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Map toMap( + Iterable c) { + throw new ReviewDbDisabledException(); + } + + @Override + public com.google.gerrit.reviewdb.client.PatchSet.Id primaryKey(PatchSet entity) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet iterateAllEntities() throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void insert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public String getRelationName() { + return "disabled"; + } + + @Override + public int getRelationID() { + return 0; + } + + @Override + public CheckedFuture getAsync( + com.google.gerrit.reviewdb.client.PatchSet.Id key) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet get(Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void deleteKeys(Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void delete(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void beginTransaction(com.google.gerrit.reviewdb.client.PatchSet.Id key) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public PatchSet atomicUpdate( + com.google.gerrit.reviewdb.client.PatchSet.Id key, AtomicUpdate update) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public PatchSet get(com.google.gerrit.reviewdb.client.PatchSet.Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byChange(Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet all() throws OrmException { + throw new ReviewDbDisabledException(); + } + }; + } + + @Override + public PatchLineCommentAccess patchComments() { + return new PatchLineCommentAccess() { + + @Override + public void upsert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void update(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public Map toMap( + Iterable c) { + throw new ReviewDbDisabledException(); + } + + @Override + public com.google.gerrit.reviewdb.client.PatchLineComment.Key primaryKey( + PatchLineComment entity) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet iterateAllEntities() throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void insert(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public String getRelationName() { + return "disabled"; + } + + @Override + public int getRelationID() { + return 0; + } + + @Override + public CheckedFuture getAsync( + com.google.gerrit.reviewdb.client.PatchLineComment.Key key) { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet get( + Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void deleteKeys(Iterable keys) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void delete(Iterable instances) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public void beginTransaction(com.google.gerrit.reviewdb.client.PatchLineComment.Key key) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public PatchLineComment atomicUpdate( + com.google.gerrit.reviewdb.client.PatchLineComment.Key key, + AtomicUpdate update) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet publishedByPatchSet( + com.google.gerrit.reviewdb.client.PatchSet.Id patchset) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet publishedByChangeFile(Id id, String file) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public PatchLineComment get(com.google.gerrit.reviewdb.client.PatchLineComment.Key id) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet draftByPatchSetAuthor( + com.google.gerrit.reviewdb.client.PatchSet.Id patchset, + com.google.gerrit.reviewdb.client.Account.Id author) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet draftByChangeFileAuthor( + Id id, String file, com.google.gerrit.reviewdb.client.Account.Id author) + throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet draftByAuthor( + com.google.gerrit.reviewdb.client.Account.Id author) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byPatchSet( + com.google.gerrit.reviewdb.client.PatchSet.Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet byChange(Id id) throws OrmException { + throw new ReviewDbDisabledException(); + } + + @Override + public ResultSet all() throws OrmException { + throw new ReviewDbDisabledException(); + } + }; + } + + @Override + public int nextAccountId() { + throw new ReviewDbDisabledException(); + } + + @Override + public int nextAccountGroupId() { + throw new ReviewDbDisabledException(); + } + + @Override + public int nextChangeId() { + throw new ReviewDbDisabledException(); + } +} diff --git a/java/com/google/gerrit/server/schema/NotesMigrationSchemaFactory.java b/java/com/google/gerrit/server/schema/NotesMigrationSchemaFactory.java index 0d95610499..9cf5333328 100644 --- a/java/com/google/gerrit/server/schema/NotesMigrationSchemaFactory.java +++ b/java/com/google/gerrit/server/schema/NotesMigrationSchemaFactory.java @@ -15,6 +15,7 @@ package com.google.gerrit.server.schema; import com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper; +import com.google.gerrit.reviewdb.server.NoOpReviewDb; import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.notedb.NotesMigration; import com.google.gwtorm.server.OrmException; @@ -34,6 +35,7 @@ public class NotesMigrationSchemaFactory implements SchemaFactory { this.migration = migration; } + @SuppressWarnings("resource") @Override public ReviewDb open() throws OrmException { // There are two levels at which this class disables access to Changes and related tables, @@ -61,10 +63,12 @@ public class NotesMigrationSchemaFactory implements SchemaFactory { // This wrapper is not a public class and nobody should ever attempt to unwrap it. // First create the wrappers which can not be removed by ReviewDbUtil#unwrapDb(ReviewDb). - ReviewDb db = delegate.open(); + ReviewDb db; if (migration.readChanges() && migration.disableChangeReviewDb()) { - // Disable writes to change tables in ReviewDb (ReviewDb access for changes are No-Ops). - db = new NoChangesReviewDbWrapper(db); + // Disable ReviewDb access. + db = new NoChangesReviewDbWrapper(new NoOpReviewDb()); + } else { + db = delegate.open(); } // Second create the wrappers which can be removed by ReviewDbUtil#unwrapDb(ReviewDb). diff --git a/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInNoteDbTest.java b/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInNoteDbTest.java index 57689b3520..ebe01be333 100644 --- a/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInNoteDbTest.java +++ b/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInNoteDbTest.java @@ -26,7 +26,6 @@ import com.google.gerrit.common.data.GroupReference; import com.google.gerrit.reviewdb.client.AccountGroup; import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.server.ReviewDb; -import com.google.gerrit.reviewdb.server.ReviewDbWrapper; import com.google.gerrit.server.Sequences; import com.google.gerrit.server.ServerInitiated; import com.google.gerrit.server.config.AllUsersName; @@ -40,6 +39,7 @@ import com.google.gerrit.server.group.db.InternalGroupUpdate; import com.google.gerrit.testing.InMemoryTestEnvironment; import com.google.gerrit.testing.TestUpdateUI; import com.google.gwtorm.jdbc.JdbcSchema; +import com.google.gwtorm.server.SchemaFactory; import com.google.inject.Inject; import java.io.IOException; import java.sql.PreparedStatement; @@ -68,18 +68,20 @@ public class Schema_166_to_167_WithGroupsInNoteDbTest { public InMemoryTestEnvironment testEnv = new InMemoryTestEnvironment(Schema_166_to_167_WithGroupsInNoteDbTest::createConfig); + @Inject @ReviewDbFactory private SchemaFactory schemaFactory; @Inject private Schema_167 schema167; - @Inject private ReviewDb db; @Inject private GitRepositoryManager gitRepoManager; @Inject private AllUsersName allUsersName; @Inject private @ServerInitiated GroupsUpdate groupsUpdate; @Inject private Sequences seq; + private ReviewDb db; private JdbcSchema jdbcSchema; @Before public void initDb() throws Exception { - jdbcSchema = ReviewDbWrapper.unwrapJbdcSchema(db); + db = schemaFactory.open(); + jdbcSchema = (JdbcSchema) db; try (Statement stmt = jdbcSchema.getConnection().createStatement()) { stmt.execute( diff --git a/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInReviewDbTest.java b/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInReviewDbTest.java index 78fef3932c..6cd558583c 100644 --- a/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInReviewDbTest.java +++ b/javatests/com/google/gerrit/server/schema/Schema_166_to_167_WithGroupsInReviewDbTest.java @@ -69,6 +69,7 @@ import com.google.gerrit.testing.TestUpdateUI; import com.google.gerrit.truth.OptionalSubject; import com.google.gwtorm.jdbc.JdbcSchema; import com.google.gwtorm.server.OrmException; +import com.google.gwtorm.server.SchemaFactory; import com.google.inject.Inject; import java.io.IOException; import java.sql.PreparedStatement; @@ -114,7 +115,7 @@ public class Schema_166_to_167_WithGroupsInReviewDbTest { @Inject private GerritApi gApi; @Inject private Schema_167 schema167; - @Inject private ReviewDb db; + @Inject @ReviewDbFactory private SchemaFactory schemaFactory; @Inject private GitRepositoryManager gitRepoManager; @Inject private AllUsersName allUsersName; @Inject private GroupsConsistencyChecker consistencyChecker; @@ -126,10 +127,12 @@ public class Schema_166_to_167_WithGroupsInReviewDbTest { @Inject private DynamicSet backends; @Inject private Sequences seq; + private ReviewDb db; private JdbcSchema jdbcSchema; @Before public void initDb() throws Exception { + db = schemaFactory.open(); jdbcSchema = ReviewDbWrapper.unwrapJbdcSchema(db); try (Statement stmt = jdbcSchema.getConnection().createStatement()) { From 1965e0b3dd5c843369833ce530fa92089a755491 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 27 Nov 2018 06:42:47 +0100 Subject: [PATCH 3/8] Use NoteDb sequence seed for accounts sequence initialization NoteDb sequence seed is already used in Sequences class. Consistently use it also in SequencesOnInit and avoid using the ReviewDb for that. Changes in Schema_155 class were reverted because ReviewDb must still be used during migration of accounts from ReviewDb to NoteDb. Change-Id: I75ac27dae90ec9be0efe017f73c798d3ccd0ad04 --- java/com/google/gerrit/pgm/init/InitAdminUser.java | 2 +- java/com/google/gerrit/pgm/init/api/SequencesOnInit.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/java/com/google/gerrit/pgm/init/InitAdminUser.java b/java/com/google/gerrit/pgm/init/InitAdminUser.java index f4289e776a..64827fe003 100644 --- a/java/com/google/gerrit/pgm/init/InitAdminUser.java +++ b/java/com/google/gerrit/pgm/init/InitAdminUser.java @@ -111,7 +111,7 @@ public class InitAdminUser implements InitStep { if (!accounts.hasAnyAccount()) { ui.header("Gerrit Administrator"); if (ui.yesno(true, "Create administrator user")) { - Account.Id id = new Account.Id(sequencesOnInit.nextAccountId(db)); + Account.Id id = new Account.Id(sequencesOnInit.nextAccountId()); String username = ui.readString("admin", "username"); String name = ui.readString("Administrator", "name"); String httpPassword = ui.readString("secret", "HTTP password"); diff --git a/java/com/google/gerrit/pgm/init/api/SequencesOnInit.java b/java/com/google/gerrit/pgm/init/api/SequencesOnInit.java index c9c3a64c27..1716a3cd57 100644 --- a/java/com/google/gerrit/pgm/init/api/SequencesOnInit.java +++ b/java/com/google/gerrit/pgm/init/api/SequencesOnInit.java @@ -35,16 +35,14 @@ public class SequencesOnInit { this.allUsersName = allUsersName; } - public int nextAccountId(ReviewDb db) throws OrmException { - @SuppressWarnings("deprecation") - RepoSequence.Seed accountSeed = db::nextAccountId; + public int nextAccountId() throws OrmException { RepoSequence accountSeq = new RepoSequence( repoManager, GitReferenceUpdated.DISABLED, new Project.NameKey(allUsersName.get()), Sequences.NAME_ACCOUNTS, - accountSeed, + () -> ReviewDb.FIRST_ACCOUNT_ID, 1); return accountSeq.next(); } From a6452e1b1fc0a1d0153f6221c138613af689727f Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 27 Nov 2018 06:50:32 +0100 Subject: [PATCH 4/8] GroupsOnInit: Remove unused dependency on ReviewDb Change-Id: Icd472f927db0c7231549fb4eead4afe9fd54b9fa --- .../google/gerrit/pgm/init/GroupsOnInit.java | 24 ++--- .../google/gerrit/pgm/init/InitAdminUser.java | 97 ++++++++----------- 2 files changed, 50 insertions(+), 71 deletions(-) diff --git a/java/com/google/gerrit/pgm/init/GroupsOnInit.java b/java/com/google/gerrit/pgm/init/GroupsOnInit.java index 8e06aa16e2..584d8af54a 100644 --- a/java/com/google/gerrit/pgm/init/GroupsOnInit.java +++ b/java/com/google/gerrit/pgm/init/GroupsOnInit.java @@ -25,7 +25,6 @@ import com.google.gerrit.pgm.init.api.AllUsersNameOnInitProvider; import com.google.gerrit.pgm.init.api.InitFlags; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.AccountGroup; -import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.GerritPersonIdentProvider; import com.google.gerrit.server.config.AllUsersName; import com.google.gerrit.server.config.GerritServerIdProvider; @@ -37,7 +36,6 @@ import com.google.gerrit.server.group.db.AuditLogFormatter; import com.google.gerrit.server.group.db.GroupConfig; import com.google.gerrit.server.group.db.GroupNameNotes; import com.google.gerrit.server.group.db.InternalGroupUpdate; -import com.google.gwtorm.server.OrmException; import com.google.inject.Inject; import java.io.File; import java.io.IOException; @@ -54,9 +52,8 @@ import org.eclipse.jgit.util.FS; /** * A database accessor for calls related to groups. * - *

All calls which read or write group related details to the database during - * init (either ReviewDb or NoteDb) are gathered here. For non-init cases, use {@code - * Groups} or {@code GroupsUpdate} instead. + *

All calls which read or write group related details to the NoteDb during init + * are gathered here. For non-init cases, use {@code Groups} or {@code GroupsUpdate} instead. * *

All methods of this class refer to internal groups. */ @@ -76,16 +73,14 @@ public class GroupsOnInit { /** * Returns the {@code AccountGroup} for the specified {@code GroupReference}. * - * @param db the {@code ReviewDb} instance to use for lookups * @param groupReference the {@code GroupReference} of the group * @return the {@code InternalGroup} represented by the {@code GroupReference} - * @throws OrmException if the group couldn't be retrieved from ReviewDb * @throws IOException if an error occurs while reading from NoteDb * @throws ConfigInvalidException if the data in NoteDb is in an incorrect format * @throws NoSuchGroupException if a group with such a name doesn't exist */ - public InternalGroup getExistingGroup(ReviewDb db, GroupReference groupReference) - throws OrmException, NoSuchGroupException, IOException, ConfigInvalidException { + public InternalGroup getExistingGroup(GroupReference groupReference) + throws NoSuchGroupException, IOException, ConfigInvalidException { File allUsersRepoPath = getPathToAllUsersRepository(); if (allUsersRepoPath != null) { try (Repository allUsersRepo = new FileRepository(allUsersRepoPath)) { @@ -102,14 +97,11 @@ public class GroupsOnInit { /** * Returns {@code GroupReference}s for all internal groups. * - * @param db the {@code ReviewDb} instance to use for lookups * @return a stream of the {@code GroupReference}s of all internal groups - * @throws OrmException if an error occurs while reading from ReviewDb * @throws IOException if an error occurs while reading from NoteDb * @throws ConfigInvalidException if the data in NoteDb is in an incorrect format */ - public Stream getAllGroupReferences(ReviewDb db) - throws OrmException, IOException, ConfigInvalidException { + public Stream getAllGroupReferences() throws IOException, ConfigInvalidException { File allUsersRepoPath = getPathToAllUsersRepository(); if (allUsersRepoPath != null) { try (Repository allUsersRepo = new FileRepository(allUsersRepoPath)) { @@ -126,14 +118,12 @@ public class GroupsOnInit { *

Note: This method doesn't check whether the account exists! It also doesn't * update the account index! * - * @param db the {@code ReviewDb} instance to update * @param groupUuid the UUID of the group * @param account the account to add - * @throws OrmException if an error occurs while reading/writing from/to ReviewDb * @throws NoSuchGroupException if the specified group doesn't exist */ - public void addGroupMember(ReviewDb db, AccountGroup.UUID groupUuid, Account account) - throws OrmException, NoSuchGroupException, IOException, ConfigInvalidException { + public void addGroupMember(AccountGroup.UUID groupUuid, Account account) + throws NoSuchGroupException, IOException, ConfigInvalidException { File allUsersRepoPath = getPathToAllUsersRepository(); if (allUsersRepoPath != null) { try (Repository repository = new FileRepository(allUsersRepoPath)) { diff --git a/java/com/google/gerrit/pgm/init/InitAdminUser.java b/java/com/google/gerrit/pgm/init/InitAdminUser.java index 64827fe003..f19cf39dc1 100644 --- a/java/com/google/gerrit/pgm/init/InitAdminUser.java +++ b/java/com/google/gerrit/pgm/init/InitAdminUser.java @@ -26,7 +26,6 @@ import com.google.gerrit.pgm.init.api.InitFlags; import com.google.gerrit.pgm.init.api.InitStep; import com.google.gerrit.pgm.init.api.SequencesOnInit; import com.google.gerrit.reviewdb.client.Account; -import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.account.AccountSshKey; import com.google.gerrit.server.account.AccountState; import com.google.gerrit.server.account.externalids.ExternalId; @@ -36,9 +35,7 @@ import com.google.gerrit.server.index.account.AccountIndex; import com.google.gerrit.server.index.account.AccountIndexCollection; import com.google.gerrit.server.index.group.GroupIndex; import com.google.gerrit.server.index.group.GroupIndexCollection; -import com.google.gerrit.server.schema.ReviewDbFactory; import com.google.gerrit.server.util.time.TimeUtil; -import com.google.gwtorm.server.SchemaFactory; import com.google.inject.Inject; import java.io.IOException; import java.nio.file.Files; @@ -58,7 +55,6 @@ public class InitAdminUser implements InitStep { private final ExternalIdsOnInit externalIds; private final SequencesOnInit sequencesOnInit; private final GroupsOnInit groupsOnInit; - private SchemaFactory dbFactory; private AccountIndexCollection accountIndexCollection; private GroupIndexCollection groupIndexCollection; @@ -85,11 +81,6 @@ public class InitAdminUser implements InitStep { @Override public void run() {} - @Inject(optional = true) - void set(@ReviewDbFactory SchemaFactory dbProvider) { - this.dbFactory = dbProvider; - } - @Inject void set(AccountIndexCollection accountIndexCollection) { this.accountIndexCollection = accountIndexCollection; @@ -107,58 +98,56 @@ public class InitAdminUser implements InitStep { return; } - try (ReviewDb db = dbFactory.open()) { - if (!accounts.hasAnyAccount()) { - ui.header("Gerrit Administrator"); - if (ui.yesno(true, "Create administrator user")) { - Account.Id id = new Account.Id(sequencesOnInit.nextAccountId()); - String username = ui.readString("admin", "username"); - String name = ui.readString("Administrator", "name"); - String httpPassword = ui.readString("secret", "HTTP password"); - AccountSshKey sshKey = readSshKey(id); - String email = readEmail(sshKey); + if (!accounts.hasAnyAccount()) { + ui.header("Gerrit Administrator"); + if (ui.yesno(true, "Create administrator user")) { + Account.Id id = new Account.Id(sequencesOnInit.nextAccountId()); + String username = ui.readString("admin", "username"); + String name = ui.readString("Administrator", "name"); + String httpPassword = ui.readString("secret", "HTTP password"); + AccountSshKey sshKey = readSshKey(id); + String email = readEmail(sshKey); - List extIds = new ArrayList<>(2); - extIds.add(ExternalId.createUsername(username, id, httpPassword)); + List extIds = new ArrayList<>(2); + extIds.add(ExternalId.createUsername(username, id, httpPassword)); - if (email != null) { - extIds.add(ExternalId.createEmail(id, email)); - } - externalIds.insert("Add external IDs for initial admin user", extIds); + if (email != null) { + extIds.add(ExternalId.createEmail(id, email)); + } + externalIds.insert("Add external IDs for initial admin user", extIds); - Account a = new Account(id, TimeUtil.nowTs()); - a.setFullName(name); - a.setPreferredEmail(email); - accounts.insert(a); + Account a = new Account(id, TimeUtil.nowTs()); + a.setFullName(name); + a.setPreferredEmail(email); + accounts.insert(a); - // Only two groups should exist at this point in time and hence iterating over all of them - // is cheap. - Optional adminGroupReference = - groupsOnInit - .getAllGroupReferences(db) - .filter(group -> group.getName().equals("Administrators")) - .findAny(); - if (!adminGroupReference.isPresent()) { - throw new NoSuchGroupException("Administrators"); - } - GroupReference adminGroup = adminGroupReference.get(); - groupsOnInit.addGroupMember(db, adminGroup.getUUID(), a); + // Only two groups should exist at this point in time and hence iterating over all of them + // is cheap. + Optional adminGroupReference = + groupsOnInit + .getAllGroupReferences() + .filter(group -> group.getName().equals("Administrators")) + .findAny(); + if (!adminGroupReference.isPresent()) { + throw new NoSuchGroupException("Administrators"); + } + GroupReference adminGroup = adminGroupReference.get(); + groupsOnInit.addGroupMember(adminGroup.getUUID(), a); - if (sshKey != null) { - VersionedAuthorizedKeysOnInit authorizedKeys = authorizedKeysFactory.create(id).load(); - authorizedKeys.addKey(sshKey.sshPublicKey()); - authorizedKeys.save("Add SSH key for initial admin user\n"); - } + if (sshKey != null) { + VersionedAuthorizedKeysOnInit authorizedKeys = authorizedKeysFactory.create(id).load(); + authorizedKeys.addKey(sshKey.sshPublicKey()); + authorizedKeys.save("Add SSH key for initial admin user\n"); + } - AccountState as = AccountState.forAccount(new AllUsersName(allUsers.get()), a, extIds); - for (AccountIndex accountIndex : accountIndexCollection.getWriteIndexes()) { - accountIndex.replace(as); - } + AccountState as = AccountState.forAccount(new AllUsersName(allUsers.get()), a, extIds); + for (AccountIndex accountIndex : accountIndexCollection.getWriteIndexes()) { + accountIndex.replace(as); + } - InternalGroup adminInternalGroup = groupsOnInit.getExistingGroup(db, adminGroup); - for (GroupIndex groupIndex : groupIndexCollection.getWriteIndexes()) { - groupIndex.replace(adminInternalGroup); - } + InternalGroup adminInternalGroup = groupsOnInit.getExistingGroup(adminGroup); + for (GroupIndex groupIndex : groupIndexCollection.getWriteIndexes()) { + groupIndex.replace(adminInternalGroup); } } } From fc651f4a0dfb1250c46dc901df4bdfaf595702cf Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 27 Nov 2018 07:15:16 +0100 Subject: [PATCH 5/8] Use NoteDb sequence seed for groups sequence initialization Changes in Schema_163 class were reverted because ReviewDb must still be used during migration of groups from ReviewDb to NoteDb. Change-Id: I49afd0f6e02ccd498f31075961a2f69c9c53e71e --- java/com/google/gerrit/server/Sequences.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/java/com/google/gerrit/server/Sequences.java b/java/com/google/gerrit/server/Sequences.java index fcf0759ee1..70a02a8ac9 100644 --- a/java/com/google/gerrit/server/Sequences.java +++ b/java/com/google/gerrit/server/Sequences.java @@ -93,11 +93,15 @@ public class Sequences { new RepoSequence( repoManager, gitRefUpdated, allProjects, NAME_CHANGES, changeSeed, changeBatchSize); - RepoSequence.Seed groupSeed = () -> nextGroupId(db.get()); int groupBatchSize = 1; groupSeq = new RepoSequence( - repoManager, gitRefUpdated, allUsers, NAME_GROUPS, groupSeed, groupBatchSize); + repoManager, + gitRefUpdated, + allUsers, + NAME_GROUPS, + () -> ReviewDb.FIRST_GROUP_ID, + groupBatchSize); nextIdLatency = metrics.newTimer( @@ -158,9 +162,4 @@ public class Sequences { private static int nextChangeId(ReviewDb db) throws OrmException { return db.nextChangeId(); } - - @SuppressWarnings("deprecation") - static int nextGroupId(ReviewDb db) throws OrmException { - return db.nextAccountGroupId(); - } } From 68b3492fcbd98bbbc4f48d24a4c194e50767481a Mon Sep 17 00:00:00 2001 From: Sven Selberg Date: Thu, 17 Dec 2020 09:43:18 +0100 Subject: [PATCH 6/8] ForRef#check should permit internal users to read all refs 79d24d4 Make PermissionBackend#ForRef authoritative Introduced a regression where InternalUsers where not taken into consideration when checking READ permission. Bug: Issue 13786 Change-Id: I3f18507f65044ac96321c1efecf1f2688f36859f (cherry picked from commit 23ff2cfc8ffc00ad3d6e2c752d63394957c8720d) --- .../gerrit/server/permissions/RefControl.java | 4 ++++ .../server/permissions/RefControlTest.java | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/java/com/google/gerrit/server/permissions/RefControl.java b/java/com/google/gerrit/server/permissions/RefControl.java index 5d6910a68d..411a52a73c 100644 --- a/java/com/google/gerrit/server/permissions/RefControl.java +++ b/java/com/google/gerrit/server/permissions/RefControl.java @@ -608,6 +608,10 @@ class RefControl { private boolean can(RefPermission perm) throws PermissionBackendException { switch (perm) { case READ: + /* Internal users such as plugin users should be able to read all refs. */ + if (getUser().isInternalUser()) { + return true; + } if (refName.startsWith(Constants.R_TAGS)) { return isTagVisible(); } diff --git a/javatests/com/google/gerrit/server/permissions/RefControlTest.java b/javatests/com/google/gerrit/server/permissions/RefControlTest.java index 0f0f1c3ec1..429621a69a 100644 --- a/javatests/com/google/gerrit/server/permissions/RefControlTest.java +++ b/javatests/com/google/gerrit/server/permissions/RefControlTest.java @@ -48,6 +48,7 @@ import com.google.gerrit.reviewdb.client.AccountGroup; import com.google.gerrit.reviewdb.client.Project; import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.CurrentUser; +import com.google.gerrit.server.InternalUser; import com.google.gerrit.server.account.CapabilityCollection; import com.google.gerrit.server.account.GroupMembership; import com.google.gerrit.server.account.ListGroupMembership; @@ -391,6 +392,11 @@ public class RefControlTest { assertAllRefsAreNotVisible(user(allUsers, DEVS)); } + @Test + public void userRefIsVisibleForInternalUser() throws Exception { + internalUser(local).controlForRef("refs/users/default").asForRef().check(RefPermission.READ); + } + @Test public void branchDelegation1() throws Exception { allow(local, OWNER, ADMIN, "refs/*"); @@ -1039,6 +1045,21 @@ public class RefControlTest { return repo; } + private ProjectControl internalUser(ProjectConfig local) throws Exception { + return new ProjectControl( + Collections.emptySet(), + Collections.emptySet(), + sectionSorter, + changeControlFactory, + permissionBackend, + refVisibilityControl, + repoManager, + refFilterFactory, + allUsersName, + new InternalUser(), + newProjectState(local)); + } + private ProjectControl user(ProjectConfig local, AccountGroup.UUID... memberOf) { return user(local, null, memberOf); } From a09a9b5a54d77687074df1b9794474039e0cfe75 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Fri, 12 Feb 2021 16:47:08 +0000 Subject: [PATCH 7/8] Set version to 2.16.27 Change-Id: I1d1e55bdcde69d03cc1945f81d7ba969bbafd041 --- tools/maven/gerrit-acceptance-framework_pom.xml | 2 +- tools/maven/gerrit-extension-api_pom.xml | 2 +- tools/maven/gerrit-plugin-api_pom.xml | 2 +- tools/maven/gerrit-plugin-gwtui_pom.xml | 2 +- tools/maven/gerrit-war_pom.xml | 2 +- version.bzl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/maven/gerrit-acceptance-framework_pom.xml b/tools/maven/gerrit-acceptance-framework_pom.xml index d88bc0a916..98be712e41 100644 --- a/tools/maven/gerrit-acceptance-framework_pom.xml +++ b/tools/maven/gerrit-acceptance-framework_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-acceptance-framework - 2.16.27-SNAPSHOT + 2.16.27 jar Gerrit Code Review - Acceptance Test Framework Framework for Gerrit's acceptance tests diff --git a/tools/maven/gerrit-extension-api_pom.xml b/tools/maven/gerrit-extension-api_pom.xml index 91803fc519..2282f6fb96 100644 --- a/tools/maven/gerrit-extension-api_pom.xml +++ b/tools/maven/gerrit-extension-api_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-extension-api - 2.16.27-SNAPSHOT + 2.16.27 jar Gerrit Code Review - Extension API API for Gerrit Extensions diff --git a/tools/maven/gerrit-plugin-api_pom.xml b/tools/maven/gerrit-plugin-api_pom.xml index 9acfe56526..f3f650684c 100644 --- a/tools/maven/gerrit-plugin-api_pom.xml +++ b/tools/maven/gerrit-plugin-api_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-plugin-api - 2.16.27-SNAPSHOT + 2.16.27 jar Gerrit Code Review - Plugin API API for Gerrit Plugins diff --git a/tools/maven/gerrit-plugin-gwtui_pom.xml b/tools/maven/gerrit-plugin-gwtui_pom.xml index 9e7ccbeef1..cf176bab25 100644 --- a/tools/maven/gerrit-plugin-gwtui_pom.xml +++ b/tools/maven/gerrit-plugin-gwtui_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-plugin-gwtui - 2.16.27-SNAPSHOT + 2.16.27 jar Gerrit Code Review - Plugin GWT UI Common Classes for Gerrit GWT UI Plugins diff --git a/tools/maven/gerrit-war_pom.xml b/tools/maven/gerrit-war_pom.xml index 79f714a2c5..9923e9841d 100644 --- a/tools/maven/gerrit-war_pom.xml +++ b/tools/maven/gerrit-war_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-war - 2.16.27-SNAPSHOT + 2.16.27 war Gerrit Code Review - WAR Gerrit WAR diff --git a/version.bzl b/version.bzl index c1c80c8cc6..26577b2827 100644 --- a/version.bzl +++ b/version.bzl @@ -2,4 +2,4 @@ # Used by :api_install and :api_deploy targets # when talking to the destination repository. # -GERRIT_VERSION = "2.16.27-SNAPSHOT" +GERRIT_VERSION = "2.16.27" From caba13a06c16c5d4bdaf1981ad9abb7e97bd27b7 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Fri, 12 Feb 2021 21:40:53 +0000 Subject: [PATCH 8/8] Set version to 2.16.28-SNAPSHOT Change-Id: Iafda5d812418d33cd5b0f78db452dfec195e07f7 --- tools/maven/gerrit-acceptance-framework_pom.xml | 2 +- tools/maven/gerrit-extension-api_pom.xml | 2 +- tools/maven/gerrit-plugin-api_pom.xml | 2 +- tools/maven/gerrit-plugin-gwtui_pom.xml | 2 +- tools/maven/gerrit-war_pom.xml | 2 +- version.bzl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/maven/gerrit-acceptance-framework_pom.xml b/tools/maven/gerrit-acceptance-framework_pom.xml index 98be712e41..93683ccb91 100644 --- a/tools/maven/gerrit-acceptance-framework_pom.xml +++ b/tools/maven/gerrit-acceptance-framework_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-acceptance-framework - 2.16.27 + 2.16.28-SNAPSHOT jar Gerrit Code Review - Acceptance Test Framework Framework for Gerrit's acceptance tests diff --git a/tools/maven/gerrit-extension-api_pom.xml b/tools/maven/gerrit-extension-api_pom.xml index 2282f6fb96..8f3dab17a0 100644 --- a/tools/maven/gerrit-extension-api_pom.xml +++ b/tools/maven/gerrit-extension-api_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-extension-api - 2.16.27 + 2.16.28-SNAPSHOT jar Gerrit Code Review - Extension API API for Gerrit Extensions diff --git a/tools/maven/gerrit-plugin-api_pom.xml b/tools/maven/gerrit-plugin-api_pom.xml index f3f650684c..63fb51c924 100644 --- a/tools/maven/gerrit-plugin-api_pom.xml +++ b/tools/maven/gerrit-plugin-api_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-plugin-api - 2.16.27 + 2.16.28-SNAPSHOT jar Gerrit Code Review - Plugin API API for Gerrit Plugins diff --git a/tools/maven/gerrit-plugin-gwtui_pom.xml b/tools/maven/gerrit-plugin-gwtui_pom.xml index cf176bab25..15381020ec 100644 --- a/tools/maven/gerrit-plugin-gwtui_pom.xml +++ b/tools/maven/gerrit-plugin-gwtui_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-plugin-gwtui - 2.16.27 + 2.16.28-SNAPSHOT jar Gerrit Code Review - Plugin GWT UI Common Classes for Gerrit GWT UI Plugins diff --git a/tools/maven/gerrit-war_pom.xml b/tools/maven/gerrit-war_pom.xml index 9923e9841d..65e044058d 100644 --- a/tools/maven/gerrit-war_pom.xml +++ b/tools/maven/gerrit-war_pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.google.gerrit gerrit-war - 2.16.27 + 2.16.28-SNAPSHOT war Gerrit Code Review - WAR Gerrit WAR diff --git a/version.bzl b/version.bzl index 26577b2827..726967a12d 100644 --- a/version.bzl +++ b/version.bzl @@ -2,4 +2,4 @@ # Used by :api_install and :api_deploy targets # when talking to the destination repository. # -GERRIT_VERSION = "2.16.27" +GERRIT_VERSION = "2.16.28-SNAPSHOT"