Class RedmineComponentService
java.lang.Object
fr.paris.lutece.plugins.releaser.service.RedmineComponentService
- All Implemented Interfaces:
IBugtrackerService
Redmine bugtracker integration : on a component release, creates the next open version, moves the
still-open issues of the released version onto it, then closes the released version.
Connection pattern (createWithApiKey, no proxy) mirrors the read-only RedmineService of the
lutecetools plugin ; the write operations below are specific to the release workflow.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindProjectIdentifier(String strScmUrl) Finds the identifier of the bugtracker project whose repository URL matches the given SCM URL.booleanTells whether a projects index (possibly stale) is available for lookups.voidinit()Inits the service (connection to the bugtracker server).booleanChecks live that the bugtracker server answers (cheap API call).voidpopulateBugtrackerInfo(Component component) Populates the bugtracker informations of a component : the roadmap URL when a project matches its repository, or an informative release comment (GitHub only) when no project matches.fr.paris.lutece.util.json.ErrorJsonResponseprepareReleaseInBugtracker(Component component, boolean bForce, boolean bCreateProject, boolean bSkipCreate, String strDescription, boolean bPublic) Checks the bugtracker prerequisites before launching a component release : bugtracker reachable, project existing (created on user confirmation).voidupdateComponentVersions(Component component, CommandResult commandResult) Updates the bugtracker versions for a released component : creates the next open version, moves the still-open issues of the released version onto it, then closes the released version.
-
Constructor Details
-
RedmineComponentService
public RedmineComponentService()Constructor.
-
-
Method Details
-
init
public void init()Inits the service (connection to the bugtracker server).- Specified by:
initin interfaceIBugtrackerService
-
isReachable
public boolean isReachable()Checks live that the bugtracker server answers (cheap API call).- Specified by:
isReachablein interfaceIBugtrackerService- Returns:
- true if the bugtracker is reachable
-
hasProjectIndex
public boolean hasProjectIndex()Tells whether a projects index (possibly stale) is available for lookups.- Specified by:
hasProjectIndexin interfaceIBugtrackerService- Returns:
- true if an index is available
-
findProjectIdentifier
Finds the identifier of the bugtracker project whose repository URL matches the given SCM URL.- Specified by:
findProjectIdentifierin interfaceIBugtrackerService- Parameters:
strScmUrl- the component SCM URL (scm:git:... accepted)- Returns:
- the project identifier, or null if none matches or no index is available
-
populateBugtrackerInfo
Populates the bugtracker informations of a component : the roadmap URL when a project matches its repository, or an informative release comment (GitHub only) when no project matches. Silently skipped when the projects index is unavailable (bugtracker down).- Specified by:
populateBugtrackerInfoin interfaceIBugtrackerService- Parameters:
component- the component
-
prepareReleaseInBugtracker
public fr.paris.lutece.util.json.ErrorJsonResponse prepareReleaseInBugtracker(Component component, boolean bForce, boolean bCreateProject, boolean bSkipCreate, String strDescription, boolean bPublic) Checks the bugtracker prerequisites before launching a component release : bugtracker reachable, project existing (created on user confirmation). Returns the error response to send back to the user, or null if the release can start.- Specified by:
prepareReleaseInBugtrackerin interfaceIBugtrackerService- Parameters:
component- the component to releasebForce- true when the user confirmed a previous promptbCreateProject- true when the user confirmed the project creationbSkipCreate- true to skip the project creation step (after a failed creation)strDescription- the project description entered by the userbPublic- whether the project to create is public- Returns:
- the error response (prompt or warning), or null to proceed
-
updateComponentVersions
Updates the bugtracker versions for a released component : creates the next open version, moves the still-open issues of the released version onto it, then closes the released version. If no bugtracker project matches the component repository, the project is created first.- Specified by:
updateComponentVersionsin interfaceIBugtrackerService- Parameters:
component- the component being releasedcommandResult- the command result (release console)
-