Class ReleasePreparationService
java.lang.Object
fr.paris.lutece.plugins.releaser.service.ReleasePreparationService
Prepares an aggregate (site, theme, platform POM loaded in a transient site) and its components for release : component list from the POM
dependencies, remote informations, target and next snapshot versions, release branches. Knows nothing about persistence or screens.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe reasons a component cannot be released by the aggregate it belongs to, whatever the user does. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFirst major of the core line parents numbered like the core : lutece-global-pom 4.x to 7.x and lutece-site-pom 3.x to 7.x are core 7The parents that tell the core version a component is built forstatic final StringMessage of a default branch built for another core version than the aggregate, shared by the site and platform flows -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildComponentComments(Component component, Locale locale) Builds the release comments of a component : missing version, bugtracker informations, outdated snapshot, newer version available, to be released.static voidbuildComponentsComments(Site site, Locale locale) Rebuilds the release comments of every component of an aggregate.static voiddefineAggregateVersions(Site site, String strLastReleaseVersion) Define the aggregate versions from its origin version : next release, next snapshot, target versions list and cycling index.static voiddefineNextSnapshotVersion(Component component) Define the next snapshot version for a given component from its target version.static voiddefineTargetVersion(Component component) Define the target version for a given component :
- current version for non project component
- next release for project component.static IntegergetCoreLine(Site site) Returns the core version of an aggregate : its parent major converted bytoCoreLine(int).static IntegergetCoreMajor(Site site) Returns the core version of an aggregate, read from the major of its parent POM version : the lutece-site-pom of a site, the core of a platform campaign.static String[]getCoreMismatchArguments(Component component, int nCoreMajor) The arguments of the core mismatch message : branch, core of the branch, parent artifactId and version, expected core.getNonReleasableReason(Component component, int nCoreMajor, String strDefaultBranch) Decides why a component cannot be released by its aggregate, in the order the checks must apply : a component already blocked or not in SNAPSHOT is left as is ; a theme ; a current SNAPSHOT ahead of the last one in Nexus, before any check relying on the Nexus POM ; a default branch whose parent belongs to another core version than the aggregate.static StringgetOriginVersion(String strLastRelease, String strCurrentVersion) Define which version between last released or current snapshot should be the origin for next release versions.static IntegergetParentCoreLine(AbstractReleaserResource resource) Returns the core version a component or an aggregate is built for, told by its parent POM when that parent belongs to the core line (lutece-global-pom, lutece-site-pom).static voidinitComponents(Site site, ReleaserUser user, Predicate<Component> projectSelector) Initialize the component list of an aggregate from its current dependencies : remote informations, target versions, next snapshot versions and release branches.static booleanisParsableSnapshot(String strVersion) Whether a value parses to a SNAPSHOT version, false for null, blank and the "not found" sentinels without logging.static voidrefreshProjectComponent(Component component) Refreshes a component newly flagged as project : remote informations, release branch, target and next snapshot versions, name.static inttoCoreLine(int nParentMajor) Converts the major of a core line parent into the core version it is built for : the parents are numbered like the core from 8, the earlier numbering (lutece-global-pom 4.x to 7.x, lutece-site-pom 3.x to 7.x) belongs to core 7.
-
Field Details
-
MESSAGE_BRANCH_CORE_MISMATCH
Message of a default branch built for another core version than the aggregate, shared by the site and platform flows- See Also:
-
CORE_LINE_PARENTS
The parents that tell the core version a component is built for -
CORE_8_FIRST_PARENT_MAJOR
public static final int CORE_8_FIRST_PARENT_MAJORFirst major of the core line parents numbered like the core : lutece-global-pom 4.x to 7.x and lutece-site-pom 3.x to 7.x are core 7- See Also:
-
-
Method Details
-
getOriginVersion
Define which version between last released or current snapshot should be the origin for next release versions. Ex of cases :
last release : 3.2.1 current : 4.0.0-SNAPSHOT -- current
last release : 3.2.1 current : 3.2.2-SNAPSHOT -- last or current
last release : missing current : 1.0.0-SNAPSHOT -- current
last release : 3.2.1-RC-02 current : 3.2.1-SNAPSHOT -- last- Parameters:
strLastRelease- The last releasestrCurrentVersion- The current release- Returns:
- The origin version
-
defineAggregateVersions
Define the aggregate versions from its origin version : next release, next snapshot, target versions list and cycling index.- Parameters:
site- The aggregatestrLastReleaseVersion- The last released version, may be null
-
initComponents
public static void initComponents(Site site, ReleaserUser user, Predicate<Component> projectSelector) Initialize the component list of an aggregate from its current dependencies : remote informations, target versions, next snapshot versions and release branches. The project selector decides which components are to be released.- Parameters:
site- The aggregateuser- The releaser user (credentials)projectSelector- Returns true for components to be released
-
buildComponentsComments
Rebuilds the release comments of every component of an aggregate.- Parameters:
site- The aggregatelocale- The locale of the comments
-
getNonReleasableReason
public static ReleasePreparationService.NonReleasableReason getNonReleasableReason(Component component, int nCoreMajor, String strDefaultBranch) Decides why a component cannot be released by its aggregate, in the order the checks must apply : a component already blocked or not in SNAPSHOT is left as is ; a theme ; a current SNAPSHOT ahead of the last one in Nexus, before any check relying on the Nexus POM ; a default branch whose parent belongs to another core version than the aggregate. The site flow reports the reason, the platform flow blocks on it.- Parameters:
component- the component, Nexus information loadednCoreMajor- the core version of the aggregatestrDefaultBranch- the default branch of the components- Returns:
- the reason, null when the component is releasable
-
getCoreMismatchArguments
The arguments of the core mismatch message : branch, core of the branch, parent artifactId and version, expected core.- Parameters:
component- the componentnCoreMajor- the core version of the aggregate- Returns:
- the arguments
-
getParentCoreLine
Returns the core version a component or an aggregate is built for, told by its parent POM when that parent belongs to the core line (lutece-global-pom, lutece-site-pom).- Parameters:
resource- the component or aggregate- Returns:
- 7 or 8, null when the parent is unknown, of another kind or unreadable
-
toCoreLine
public static int toCoreLine(int nParentMajor) Converts the major of a core line parent into the core version it is built for : the parents are numbered like the core from 8, the earlier numbering (lutece-global-pom 4.x to 7.x, lutece-site-pom 3.x to 7.x) belongs to core 7.- Parameters:
nParentMajor- the parent major- Returns:
- 7 or 8
-
getCoreLine
Returns the core version of an aggregate : its parent major converted bytoCoreLine(int).- Parameters:
site- the aggregate- Returns:
- 7 or 8, null when the parent version is missing or unreadable
-
getCoreMajor
Returns the core version of an aggregate, read from the major of its parent POM version : the lutece-site-pom of a site, the core of a platform campaign.- Parameters:
site- the aggregate- Returns:
- the core major, null when the parent version is missing or unreadable
-
isParsableSnapshot
Whether a value parses to a SNAPSHOT version, false for null, blank and the "not found" sentinels without logging.- Parameters:
strVersion- the value- Returns:
- true for a SNAPSHOT version
-
buildComponentComments
Builds the release comments of a component : missing version, bugtracker informations, outdated snapshot, newer version available, to be released. A blocking anomaly owns the display, no other comment is added after it.- Parameters:
component- The componentlocale- The locale of the comments
-
refreshProjectComponent
Refreshes a component newly flagged as project : remote informations, release branch, target and next snapshot versions, name.- Parameters:
component- The component
-
defineTargetVersion
Define the target version for a given component :
- current version for non project component
- next release for project component.- Parameters:
component- The component
-
defineNextSnapshotVersion
Define the next snapshot version for a given component from its target version.- Parameters:
component- The component
-