Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43377

Allow plugins to redirect to a custom index and not force /pipelines as default

      ATM in the dashBoard we are doing:

      export default (
          <Route path="/" component={Dashboard} onChange={persistBackgroundOnNavigationChange}>
      ...
              <Route path="/pipelines" component={Pipelines} />
      
              <Route path="/create-pipeline" component={CreatePipeline} />
              <IndexRedirect to="pipelines" />
          </Route>
      

      The problem here is that <IndexRedirect to="pipelines" /> is always redirects to pipelines. However that needs to be override-able.

          [JENKINS-43377] Allow plugins to redirect to a custom index and not force /pipelines as default

          Cliff Meyers added a comment -

          There has been some discussion about enhancing the router API to give us a lot more flexibility overall. But that will probably not happen within a reasonable timeframe, so let's move to discussion of a stop-gap that works but maybe isn't as nice.

          We could perhaps have an extension point like "jenkins.main.routes.default.redirect" which requires a single <IndexRedirect /> element to be supplied. We could provide a default that which points to "/pipelines" but let a custom one be supplied to point elsewhere.

          If multiple plugins try to contribute we need to determine who "wins". kzantow has used an "ordinal" property on extensions to allow them to be sorted, and we could use that to pick the right one from an array of default redirects.

          I don't expect this to be too difficult, could whip up a PR tomorrow probably if that works for you tscherler ?

          Cliff Meyers added a comment - There has been some discussion about enhancing the router API to give us a lot more flexibility overall. But that will probably not happen within a reasonable timeframe, so let's move to discussion of a stop-gap that works but maybe isn't as nice. We could perhaps have an extension point like "jenkins.main.routes.default.redirect" which requires a single <IndexRedirect /> element to be supplied. We could provide a default that which points to "/pipelines" but let a custom one be supplied to point elsewhere. If multiple plugins try to contribute we need to determine who "wins". kzantow has used an "ordinal" property on extensions to allow them to be sorted, and we could use that to pick the right one from an array of default redirects. I don't expect this to be too difficult, could whip up a PR tomorrow probably if that works for you tscherler ?

          AnneTheAgile added a comment - - edited

          cliffmeyers +1 for having an IndexRedirect for plugins. Alternatively, is there a way for a plugin / job to add onto the job index page after it completes?

          We create URL's in our job and I'd love to have them be links on each output build's root index.html.

          AnneTheAgile added a comment - - edited cliffmeyers +1 for having an IndexRedirect for plugins. Alternatively, is there a way for a plugin / job to add onto the job index page after it completes? We create URL's in our job and I'd love to have them be links on each output build's root index.html.

            Unassigned Unassigned
            tscherler Thorsten Scherler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: