Package com.google.gerrit.server.project
Class ProjectConfig
java.lang.Object
com.google.gerrit.server.git.meta.VersionedMetaData
com.google.gerrit.server.project.ProjectConfig
- All Implemented Interfaces:
ValidationError.Sink
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
VersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final com.google.common.collect.ImmutableSet<String>
static final String
Fields inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
inserter, newTree, projectName, reader, revision, rw
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommentLinkSection
(StoredCommentLinkInfo commentLink) void
static StoredCommentLinkInfo
buildCommentLink
(org.eclipse.jgit.lib.Config cfg, String name) void
void
error
(ValidationError error) getAccessSection
(String name) Returns an access section,name
typically is a ref pattern.Returns an immutable, thread-safe representation of this object that can be cached.boolean
Returns the checkReceivedObjects for this project, default is true.getGroup
(AccountGroup.UUID uuid) Returns the group reference, if the group is used by at least one rule.Returns the group reference corresponding to the specified group name if the group is used by at least one rule or plugin value.long
Returns the maxObjectSizeLimit configured on this project, or zero if not configured.getName()
getPluginConfig
(String pluginName) protected String
Returns name of the reference storing this configuration.org.eclipse.jgit.lib.ObjectId
Returns the project's rules.pl ObjectId, if present in the branch.Get the validation errors, if any were discovered during load.boolean
void
load
(org.eclipse.jgit.lib.Repository repo) void
load
(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId revision) void
load
(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId revision) protected void
onLoad()
Set up the metadata, parsing any state from the loaded revision.protected boolean
onSave
(org.eclipse.jgit.lib.CommitBuilder commit) Save any changes to the metadata in a commit.void
putNotifyConfig
(String name, NotifyConfig nc) void
remove
(AccessSection section) void
remove
(AccessSection section, Permission permission) void
remove
(AccessSection section, Permission permission, PermissionRule rule) void
void
renameGroup
(AccountGroup.UUID uuid, String newName) void
replace
(ContributorAgreement section) resolve
(GroupReference group) void
setAccountsSection
(AccountsSection accountsSection) void
setBranchOrderSection
(BranchOrderSection branchOrderSection) void
setProject
(Project.Builder project) boolean
updateGroupNames
(GroupBackend groupBackend) Check all GroupReferences use current group name, repairing stale ones.void
updateLabelType
(String name, Consumer<LabelType.Builder> update) Allows a mutation of an existingLabelType
.void
updatePluginConfig
(String pluginName, Consumer<PluginConfig.Update> pluginConfigUpdate) void
updateProject
(Consumer<Project.Builder> update) void
upsertAccessSection
(String name, Consumer<AccessSection.Builder> update) void
Adds or replaces the givenContributorAgreement
in this config.void
upsertLabelType
(LabelType labelType) Adds or replaces the givenLabelType
in this config.void
upsertSubmitRequirement
(SubmitRequirement requirement) Adds or replaces the givenSubmitRequirement
in this config.static String
validMaxObjectSizeLimit
(String value) Methods inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
commit, commit, commitToNewRef, getObjectId, getPathInfos, getRevision, load, load, load, load, load, openUpdate, openUpdate, readConfig, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
-
Field Details
-
RULES_PL_FILE
- See Also:
-
COMMENTLINK
- See Also:
-
LABEL
- See Also:
-
KEY_LABEL_DESCRIPTION
- See Also:
-
KEY_FUNCTION
- See Also:
-
KEY_DEFAULT_VALUE
- See Also:
-
KEY_ALLOW_POST_SUBMIT
- See Also:
-
KEY_IGNORE_SELF_APPROVAL
- See Also:
-
KEY_COPY_CONDITION
- See Also:
-
KEY_VALUE
- See Also:
-
KEY_CAN_OVERRIDE
- See Also:
-
KEY_BRANCH
- See Also:
-
SUBMIT_REQUIREMENT
- See Also:
-
KEY_SR_DESCRIPTION
- See Also:
-
KEY_SR_APPLICABILITY_EXPRESSION
- See Also:
-
KEY_SR_SUBMITTABILITY_EXPRESSION
- See Also:
-
KEY_SR_OVERRIDE_EXPRESSION
- See Also:
-
KEY_SR_OVERRIDE_IN_CHILD_PROJECTS
- See Also:
-
SR_KEYS
-
KEY_MATCH
- See Also:
-
KEY_LINK
- See Also:
-
KEY_PREFIX
- See Also:
-
KEY_SUFFIX
- See Also:
-
KEY_TEXT
- See Also:
-
KEY_ENABLED
- See Also:
-
PROJECT_CONFIG
- See Also:
-
ACCESS
- See Also:
-
-
Method Details
-
getCacheable
Returns an immutable, thread-safe representation of this object that can be cached. -
buildCommentLink
public static StoredCommentLinkInfo buildCommentLink(org.eclipse.jgit.lib.Config cfg, String name) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
addCommentLinkSection
-
removeCommentLinkSection
-
load
public void load(org.eclipse.jgit.lib.Repository repo) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
load
public void load(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId revision) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
load
public void load(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId revision) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
getName
-
getProject
-
setProject
-
updateProject
-
getAccountsSection
-
setAccountsSection
-
getAccessSection
Returns an access section,name
typically is a ref pattern. -
upsertAccessSection
-
getAccessSections
-
getBranchOrderSection
-
setBranchOrderSection
-
getSubscribeSections
-
addSubscribeSection
-
remove
-
remove
-
remove
-
getContributorAgreement
-
getContributorAgreements
-
replace
-
getNotifyConfigs
-
putNotifyConfig
-
getLabelSections
-
getSubmitRequirementSections
-
upsertSubmitRequirement
Adds or replaces the givenSubmitRequirement
in this config. -
clearSubmitRequirements
public void clearSubmitRequirements() -
upsertLabelType
Adds or replaces the givenLabelType
in this config. -
updateLabelType
Allows a mutation of an existingLabelType
. -
upsertContributorAgreement
Adds or replaces the givenContributorAgreement
in this config. -
getCommentLinkSections
-
getMimeTypes
-
resolve
-
renameGroup
-
getGroup
Returns the group reference, if the group is used by at least one rule. -
getGroup
Returns the group reference corresponding to the specified group name if the group is used by at least one rule or plugin value. -
getRulesId
public org.eclipse.jgit.lib.ObjectId getRulesId()Returns the project's rules.pl ObjectId, if present in the branch. Null if it doesn't exist. -
getMaxObjectSizeLimit
public long getMaxObjectSizeLimit()Returns the maxObjectSizeLimit configured on this project, or zero if not configured. -
getCheckReceivedObjects
public boolean getCheckReceivedObjects()Returns the checkReceivedObjects for this project, default is true. -
updateGroupNames
Check all GroupReferences use current group name, repairing stale ones.- Parameters:
groupBackend
- cache to use when looking up group information by UUID.- Returns:
- true if one or more group names was stale.
-
getValidationErrors
Get the validation errors, if any were discovered during load.- Returns:
- list of errors; empty list if there are no errors.
-
getRefName
Description copied from class:VersionedMetaData
Returns name of the reference storing this configuration.- Specified by:
getRefName
in classVersionedMetaData
-
onLoad
Description copied from class:VersionedMetaData
Set up the metadata, parsing any state from the loaded revision.- Specified by:
onLoad
in classVersionedMetaData
- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
updatePluginConfig
-
getPluginConfig
-
onSave
protected boolean onSave(org.eclipse.jgit.lib.CommitBuilder commit) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException Description copied from class:VersionedMetaData
Save any changes to the metadata in a commit.- Specified by:
onSave
in classVersionedMetaData
- Returns:
- true if the commit should proceed, false to abort.
- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
validMaxObjectSizeLimit
public static String validMaxObjectSizeLimit(String value) throws org.eclipse.jgit.errors.ConfigInvalidException - Throws:
org.eclipse.jgit.errors.ConfigInvalidException
-
error
- Specified by:
error
in interfaceValidationError.Sink
-
hasLegacyPermissions
public boolean hasLegacyPermissions()
-