Package hudson.matrix
Class MatrixProject
java.lang.Object
- All Implemented Interfaces:
ExtensionPoint
,BuildableItem
,BuildableItemWithBuildWrappers
,Describable<TopLevelItem>
,DescriptorByNameOwner
,Item
,ItemGroup<MatrixConfiguration>
,ModelObject
,PersistenceRoot
,Queue.FlyweightTask
,SubTask
,Queue.Task
,ResourceActivity
,Saveable
,SCMedItem
,TopLevelItem
,SearchableModelObject
,SearchItem
,AccessControlled
,LazyBuildMixIn.LazyLoadingJob<MatrixProject,
,MatrixBuild> Loadable
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,ParameterizedJobMixIn.ParameterizedJob<MatrixProject,
,MatrixBuild> TriggeredItem
,OnMaster
,HasWidgets
,org.kohsuke.stapler.HttpDeletable
,org.kohsuke.stapler.StaplerOverridable
,org.kohsuke.stapler.StaplerProxy
public class MatrixProject
extends AbstractProject<MatrixProject,MatrixBuild>
implements TopLevelItem, SCMedItem, ItemGroup<MatrixConfiguration>, Saveable, Queue.FlyweightTask, BuildableItemWithBuildWrappers
Job
that allows you to run multiple different configurations
from a single setting.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.AbstractProject
AbstractProject.AbstractProjectDescriptor, AbstractProject.BecauseOfBuildInProgress, AbstractProject.BecauseOfDownstreamBuildInProgress, AbstractProject.BecauseOfUpstreamBuildInProgress, AbstractProject.LabelValidator
Nested classes/interfaces inherited from class hudson.model.Job
Job.LastItemListener, Job.SubItemBuildsLocationImpl
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface org.kohsuke.stapler.HttpDeletable
org.kohsuke.stapler.HttpDeletable.HttpDeletableDispatcher
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MatrixProject.DescriptorImpl
Descriptor is instantiated as a field purely for backward compatibility.Fields inherited from class hudson.model.AbstractProject
ABORT, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, BUILD_NOW_TEXT, builds, disabled, transientActions, triggers
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties, runIdMigrator
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
alias()
protected void
doChildrenContextMenu
(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) void
doConfigDotXml
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) org.kohsuke.stapler.HttpResponse
Also delete all the workspaces of the configuration, too.Gets all active configurations.hudson.tasks.test.AggregatedTestResultAction
Collection<? extends Job>
getAxes()
protected Class<MatrixBuild>
Gets the workspace location thatMatrixConfiguration
uses.Obtains the combination filter, used to trim down the size of the matrix.getDynamic
(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) getItems()
getJDK()
Deprecated.getJDKs()
Gets theJDK
s where the builds will be run.Gets theLabel
s where the builds will be run.getPublisher
(Descriptor<Publisher> descriptor) MatrixProject
is relevant with all the labels its configurations are relevant.getRootDirFor
(Combination combination) Gets a root directory for the specifiedCombination
.getRootDirFor
(MatrixConfiguration child) Gets a root directory of the specifiedMatrixConfiguration
.Deprecated.Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneCombinationFilter()
.Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneResultCondition()
.Deprecated.as of 1.373 System vs user difference are generalized into extension point.boolean
Do we have an explicit child custom workspace setting (true)? Or just using the default value (false)?boolean
boolean
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.isRunSequentially()
.void
void
void
onDeleted
(MatrixConfiguration item) void
void
onRenamed
(MatrixConfiguration item, String oldName, String newName) protected Object
void
Reconfigures axes.void
setChildCustomWorkspace
(String childCustomWorkspace) void
setCombinationFilter
(String combinationFilter) Sets the combination filter.void
setExecutionStrategy
(MatrixExecutionStrategy executionStrategy) void
setRunSequentially
(boolean runSequentially) Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setRunSequentially(boolean)
.void
setSorter
(MatrixConfigurationSorter sorter) Deprecated.void
setTouchStoneCombinationFilter
(String touchStoneCombinationFilter) Deprecated.void
setTouchStoneResultCondition
(Result touchStoneResultCondition) Deprecated.protected void
submit
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) protected void
Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, disable, doBuild, doBuildWithParameters, doCheckRetryCount, doConfigSubmit, doPolling, doWs, enable, findNearest, findNearest, getActions, getAssignedLabel, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDelay, getDownstreamProjects, getDownstreamProjectsForApi, getEnvironment, getEstimatedDurationCandidates, getFirstBuild, getHasCustomQuietPeriod, getIconColor, getLastBuild, getLastBuiltOn, getLazyBuildMixIn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getProminentActions, getQueueItem, getQuietPeriod, getRelationship, getResourceActivities, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getScmCheckoutStrategy, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getUpstreamProjectsForApi, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildable, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, loadBuild, makeSearchIndex, newBuild, performDelete, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, resolveForCLI, save, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setConcurrentBuild, setCustomWorkspace, setDisabled, setJDK, setQuietPeriod, setScm, setScmCheckoutStrategy, submit, supportsMakeDisabled, triggers
Methods inherited from class hudson.model.Job
assignBuildNumber, checkRename, createHistoryWidget, delete, doBuildStatus, doChildrenContextMenu, doDescription, doDoRename, doRssAll, doRssChangelog, doRssFailed, fastUpdateNextBuildNumber, getACL, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusIconClassName, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumber
Methods inherited from class hudson.model.AbstractItem
delete, delete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doDoDelete, doReload, doSetName, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, load, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml, writeReplace
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, save
Methods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItemName, getItems, getItemsStream, getItemsStream, getUrl
Methods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled, scheduleBuild, scheduleBuild
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked, isConcurrentBuild
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
Methods inherited from interface hudson.model.SCMedItem
getScm, poll, pollSCMChanges
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
Methods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraint
-
Field Details
-
DESCRIPTOR
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public static final MatrixProject.DescriptorImpl DESCRIPTORDescriptor is instantiated as a field purely for backward compatibility. Do not do this in your code. Put @Extension on your DescriptorImpl class instead.
-
-
Constructor Details
-
MatrixProject
-
MatrixProject
-
-
Method Details
-
readResolve
-
getPronoun
- Overrides:
getPronoun
in classAbstractProject<MatrixProject,
MatrixBuild>
-
getChildCustomWorkspace
Gets the workspace location thatMatrixConfiguration
uses. Used fromMatrixRun.MatrixRunExecution.decideWorkspace
.- Returns:
- never null
even when
MatrixProject
uses no custom workspace, this method still returns something like "${PARENT_WORKSPACE}/${COMBINATION}" that controls how the workspace should be laid out. The return value can be absolute or relative. If relative, it is resolved against the working directory of the overarchingMatrixBuild
.
-
hasChildCustomWorkspace
public boolean hasChildCustomWorkspace()Do we have an explicit child custom workspace setting (true)? Or just using the default value (false)? -
setChildCustomWorkspace
- Throws:
IOException
-
getRelevantLabels
MatrixProject
is relevant with all the labels its configurations are relevant.- Overrides:
getRelevantLabels
in classAbstractProject<MatrixProject,
MatrixBuild>
-
getSorter
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getSorter()
. This method tries to emulate the previous behavior the best it can, but will return null if the currentMatrixExecutionStrategy
is not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setSorter
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setSorter(MatrixConfigurationSorter)
. This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
getAxes
-
setAxes
Reconfigures axes.- Throws:
IOException
-
getExecutionStrategy
-
setExecutionStrategy
- Throws:
IOException
-
isRunSequentially
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.isRunSequentially()
. This method tries to emulate the previous behavior the best it can, but will return false if the currentMatrixExecutionStrategy
is not the default one. -
setRunSequentially
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setRunSequentially(boolean)
. This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
setCombinationFilter
Sets the combination filter.- Parameters:
combinationFilter
- the combinationFilter to set- Throws:
IOException
-
getCombinationFilter
Obtains the combination filter, used to trim down the size of the matrix.By default, a
MatrixConfiguration
is created for every possible combination of axes exhaustively. But by specifying a Groovy expression as a combination filter, one can trim down the # of combinations built.Namely, this expression is evaluated for each axis value combination, and only when it evaluates to true, a corresponding
MatrixConfiguration
will be created and built.- Returns:
- can be null.
- Since:
- 1.279
-
getTouchStoneCombinationFilter
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneCombinationFilter()
. This method tries to emulate the previous behavior the best it can, but will return null if the currentMatrixExecutionStrategy
is not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setTouchStoneCombinationFilter
@Deprecated public void setTouchStoneCombinationFilter(String touchStoneCombinationFilter) throws IOException Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setTouchStoneCombinationFilter(String)
. This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
getTouchStoneResultCondition
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneResultCondition()
. This method tries to emulate the previous behavior the best it can, but will return null if the currentMatrixExecutionStrategy
is not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setTouchStoneResultCondition
@Deprecated public void setTouchStoneResultCondition(Result touchStoneResultCondition) throws IOException Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setTouchStoneResultCondition(Result)
. This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
createTransientActions
- Overrides:
createTransientActions
in classAbstractProject<MatrixProject,
MatrixBuild>
-
updateTransientActions
protected void updateTransientActions()- Overrides:
updateTransientActions
in classAbstractProject<MatrixProject,
MatrixBuild>
-
getUserAxes
Deprecated.as of 1.373 System vs user difference are generalized into extension point.Gets the subset ofAxisList
that are not system axes. -
getLayouter
-
onCreatedFromScratch
public void onCreatedFromScratch()- Specified by:
onCreatedFromScratch
in interfaceItem
- Overrides:
onCreatedFromScratch
in classAbstractProject<MatrixProject,
MatrixBuild>
-
onLoad
- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in classAbstractProject<MatrixProject,
MatrixBuild> - Throws:
IOException
-
logRotate
- Overrides:
logRotate
in classJob<MatrixProject,
MatrixBuild> - Throws:
IOException
InterruptedException
-
getActiveConfigurations
Gets all active configurations.In contract, inactive configurations are those that are left for archival purpose and no longer built when a new
MatrixBuild
is executed.During a build,
MatrixBuild.MatrixBuildExecution.getActiveConfigurations()
should be used to make sure that a build is using the consistent set of active configurations from the start to the end. -
getItems
- Specified by:
getItems
in interfaceItemGroup<MatrixConfiguration>
-
getAllJobs
- Specified by:
getAllJobs
in interfaceItem
- Overrides:
getAllJobs
in classJob<MatrixProject,
MatrixBuild>
-
getUrlChildPrefix
- Specified by:
getUrlChildPrefix
in interfaceItemGroup<MatrixConfiguration>
-
getItem
- Specified by:
getItem
in interfaceItemGroup<MatrixConfiguration>
-
getItem
-
getRootDirFor
Gets a root directory of the specifiedMatrixConfiguration
. Creates the whole directory hierarchy on-demand.- Specified by:
getRootDirFor
in interfaceItemGroup<MatrixConfiguration>
- Parameters:
child
- childMatrixConfiguration
- Returns:
- Root directory for the combination
-
onRenamed
- Specified by:
onRenamed
in interfaceItemGroup<MatrixConfiguration>
- Throws:
IOException
-
onDeleted
- Specified by:
onDeleted
in interfaceItemGroup<MatrixConfiguration>
- Throws:
IOException
-
getRootDirFor
Gets a root directory for the specifiedCombination
. Creates the whole directory hierarchy on-demand.- Parameters:
combination
- Combination to be checked- Returns:
- Root directory for the combination
-
getJDK
Deprecated.- Overrides:
getJDK
in classAbstractProject<MatrixProject,
MatrixBuild> - See Also:
-
getJDKs
Gets theJDK
s where the builds will be run.- Returns:
- never null but can be empty
-
getLabels
Gets theLabel
s where the builds will be run.- Returns:
- never null
-
getBuilders
-
getBuildersList
-
getPublishers
-
getPublishersList
- Specified by:
getPublishersList
in classAbstractProject<MatrixProject,
MatrixBuild>
-
getBuildWrappersList
- Specified by:
getBuildWrappersList
in interfaceBuildableItemWithBuildWrappers
-
getBuildWrappers
-
getPublisher
-
getBuildClass
- Specified by:
getBuildClass
in classAbstractProject<MatrixProject,
MatrixBuild>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()- Specified by:
isFingerprintConfigured
in classAbstractProject<MatrixProject,
MatrixBuild>
-
buildDependencyGraph
- Overrides:
buildDependencyGraph
in classAbstractProject<MatrixProject,
MatrixBuild>
-
asProject
- Specified by:
asProject
in interfaceBuildableItemWithBuildWrappers
- Specified by:
asProject
in interfaceSCMedItem
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) - Overrides:
getDynamic
in classJob<MatrixProject,
MatrixBuild>
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException - Overrides:
submit
in classAbstractProject<MatrixProject,
MatrixBuild> - Throws:
IOException
jakarta.servlet.ServletException
Descriptor.FormException
-
doConfigDotXml
public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException - Overrides:
doConfigDotXml
in classAbstractItem
- Throws:
IOException
-
getAggregatedTestResultAction
public hudson.tasks.test.AggregatedTestResultAction getAggregatedTestResultAction() -
doDoWipeOutWorkspace
public org.kohsuke.stapler.HttpResponse doDoWipeOutWorkspace() throws IOException, InterruptedExceptionAlso delete all the workspaces of the configuration, too.- Overrides:
doDoWipeOutWorkspace
in classAbstractProject<MatrixProject,
MatrixBuild> - Throws:
IOException
InterruptedException
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws Exception - Specified by:
doChildrenContextMenu
in interfaceModelObjectWithChildren
- Overrides:
doChildrenContextMenu
in classJob<MatrixProject,
MatrixBuild> - Throws:
Exception
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<TopLevelItem>
- Specified by:
getDescriptor
in interfaceTopLevelItem
- Throws:
IllegalStateException
- Jenkins is not ready
-
alias
-
DefaultMatrixExecutionStrategyImpl.getSorter()
.