ProjectConfig: Write resolved groups to file

project.config references group names from the groups file.
These names are local to the project. The groups file links the
local name to a global groups UUID.

Renaming a group makes Gerrit go through all projects and try to
rename the local group names. This commit fixes a bug that would
make Gerrit only change the groups file, but not the project.config
file. This lead to half-baked renames that can break ACLs.

Change-Id: I46993b4838ddfa700acb79911713aa42cc026590
(cherry picked from commit bf9be01299)
This commit is contained in:
Patrick Hiesel
2020-11-17 13:14:13 +01:00
parent 4ed924ff83
commit e59e2b3d25

View File

@@ -1425,7 +1425,7 @@ public class ProjectConfig extends VersionedMetaData implements ValidationError.
if (group.getUUID() != null) {
keepGroups.add(group.getUUID());
}
rules.add(rule.asString(needRange));
rules.add(rule.toBuilder().setGroup(group).build().asString(needRange));
}
rc.setStringList(CAPABILITY, null, permission.getName(), rules);
}
@@ -1470,7 +1470,7 @@ public class ProjectConfig extends VersionedMetaData implements ValidationError.
if (group.getUUID() != null) {
keepGroups.add(group.getUUID());
}
rules.add(rule.asString(needRange));
rules.add(rule.toBuilder().setGroup(group).build().asString(needRange));
}
rc.setStringList(ACCESS, refName, permission.getName(), rules);
}