Class RedmineComponentService

java.lang.Object
fr.paris.lutece.plugins.releaser.service.RedmineComponentService
All Implemented Interfaces:
IBugtrackerService

public class RedmineComponentService extends Object implements 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
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Finds the identifier of the bugtracker project whose repository URL matches the given SCM URL.
    boolean
    Tells whether a projects index (possibly stale) is available for lookups.
    void
    Inits the service (connection to the bugtracker server).
    boolean
    Checks live that the bugtracker server answers (cheap API call).
    void
    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.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).
    void
    updateComponentVersions(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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RedmineComponentService

      public RedmineComponentService()
      Constructor.
  • Method Details

    • init

      public void init()
      Inits the service (connection to the bugtracker server).
      Specified by:
      init in interface IBugtrackerService
    • isReachable

      public boolean isReachable()
      Checks live that the bugtracker server answers (cheap API call).
      Specified by:
      isReachable in interface IBugtrackerService
      Returns:
      true if the bugtracker is reachable
    • hasProjectIndex

      public boolean hasProjectIndex()
      Tells whether a projects index (possibly stale) is available for lookups.
      Specified by:
      hasProjectIndex in interface IBugtrackerService
      Returns:
      true if an index is available
    • findProjectIdentifier

      public String findProjectIdentifier(String strScmUrl)
      Finds the identifier of the bugtracker project whose repository URL matches the given SCM URL.
      Specified by:
      findProjectIdentifier in interface IBugtrackerService
      Parameters:
      strScmUrl - the component SCM URL (scm:git:... accepted)
      Returns:
      the project identifier, or null if none matches or no index is available
    • populateBugtrackerInfo

      public void populateBugtrackerInfo(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. Silently skipped when the projects index is unavailable (bugtracker down).
      Specified by:
      populateBugtrackerInfo in interface IBugtrackerService
      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:
      prepareReleaseInBugtracker in interface IBugtrackerService
      Parameters:
      component - the component to release
      bForce - true when the user confirmed a previous prompt
      bCreateProject - true when the user confirmed the project creation
      bSkipCreate - true to skip the project creation step (after a failed creation)
      strDescription - the project description entered by the user
      bPublic - whether the project to create is public
      Returns:
      the error response (prompt or warning), or null to proceed
    • updateComponentVersions

      public void updateComponentVersions(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. If no bugtracker project matches the component repository, the project is created first.
      Specified by:
      updateComponentVersions in interface IBugtrackerService
      Parameters:
      component - the component being released
      commandResult - the command result (release console)