Pipeline Stage View Plugin REST API - Pagination feature

341 views
Skip to first unread message

Natesh Kukreja

unread,
Aug 19, 2018, 11:08:24 AM8/19/18
to jenkin...@googlegroups.com
Hey,

The reason for this email is to ask for some assistance in regards to adding a new feature to the Pipeline Stage View Plugin REST API - I am the one who will be implementing this feature.

A little background - we have a multistage build process in Jenkins. In one of our stages, we end up with hundreds of stageFlowNodes. Our blocker here is that there is a cap of 100 stageFlowNodes being return by the REST API response. I'd like to implement a Pagination feature to be able to query the remaining results. I am able to add a value to the response - totalPages (which is the total number of pages needed to query the result). I have been looking into the actual feature itself - which is querying the values - but I am stuck. Majority of the logic is done in ChunkVisitor.java, where the response value is added to StageNodeExt.java. 

I was wondering if someone would be able to provide guidance, per say. I am still very new to Jenkins and how it runs. As experts, I was hoping someone can steer me in a certain direction and can provide some tips or how they think it should be implemented. Any and all advice/tips are appreciated. 

Kind regards,

Natesh Kukreja

Jesse Glick

unread,
Aug 20, 2018, 9:16:36 AM8/20/18
to Jenkins Dev
On Sun, Aug 19, 2018 at 11:08 AM Natesh Kukreja
<natesh....@gmail.com> wrote:
> adding a new feature to the Pipeline Stage View Plugin REST API

I am under the impression that this plugin is mostly abandoned, in
favor of Blue Ocean.

Craig Rodrigues

unread,
Aug 20, 2018, 11:23:35 AM8/20/18
to Jenkins Developers
That is not obvious.  I have filed this ticket:
https://issues.jenkins-ci.org/browse/JENKINS-53139

to request:
1.  deprecation notice be placed on this plugin's page, with info telling people to install Blue Ocean
2.  pipeline-stage-view be removed from dependencies when installing "pipeline-plugin"

--
Craig

Jesse Glick

unread,
Aug 20, 2018, 11:30:50 AM8/20/18
to Jenkins Dev
On Mon, Aug 20, 2018 at 11:23 AM Craig Rodrigues <rod...@freebsd.org> wrote:
> 2. pipeline-stage-view be removed from dependencies when installing "pipeline-plugin"

https://github.com/jenkinsci/workflow-aggregator-plugin/pull/22

though really IMO we should get rid of `workflow-aggregator` anyway.

Natesh Kukreja

unread,
Aug 20, 2018, 4:23:58 PM8/20/18
to Jenkins Developers
I was not aware that the plugin is mostly abandoned. When I initially started researching into my project, Blue Ocean kept 'crashing' or I would get a 404 Error. This lead me to try and implement a pagination feature to the existing Stage View Plugin API.

This plugin is still heavily used in our company, on all of our Jenkins instances. I was hoping someone can point me in the right direction. My idea was to have a variable bound to StaplerRequest and retrieve the page parameter in ChunkVisitor, but that didn't work so well. Do you have any ideas you think I should try? I appreciate all your help! 

Natesh 

Craig Rodrigues

unread,
Aug 20, 2018, 4:26:46 PM8/20/18
to Jenkins Developers
On Mon, Aug 20, 2018 at 8:30 AM Jesse Glick <jgl...@cloudbees.com> wrote:
On Mon, Aug 20, 2018 at 11:23 AM Craig Rodrigues <rod...@freebsd.org> wrote:
> 2.  pipeline-stage-view be removed from dependencies when installing "pipeline-plugin"

https://github.com/jenkinsci/workflow-aggregator-plugin/pull/22


Yes, that would do the trick.  I've expresed my support for that in the comments section of that PR.

In addition to deprecating/removing pipeline-stage-view, I would recommend
that in the classic UI, if Blue Ocean is installed, when you click on a pipeline, instead of the pipeline-stage-view,
you have a small text link which says:

Click here to visualize pipeline in Blue Ocean

There already a Open Blue Ocean icon on the left part of the page,
but for users who are not savvy about Jenkins, it is not obvious what Blue Ocean is,
or that they can see a graphical representation of the pipeline in it.

BTW, everyone who I have shown Blue Ocean to (end users who are not super savvy about Jenkins)
has said positive things about the Blue Ocean UI.  So the more hints there are to steer people towards
Blue Ocean, the better.

--
Craig
 

Jesse Glick

unread,
Aug 20, 2018, 4:46:49 PM8/20/18
to Jenkins Dev
On Mon, Aug 20, 2018 at 4:26 PM Craig Rodrigues <rod...@freebsd.org> wrote:
> I would recommend
> that in the classic UI, if Blue Ocean is installed, when you click on a pipeline, instead of the pipeline-stage-view,
> you have a small text link …

Probably best to file this as an enhancement in `blueocean-plugin`
lest it get lost.

Natesh Kukreja

unread,
Aug 20, 2018, 4:51:19 PM8/20/18
to Jenkins Developers
This is no longer a feature that I would like to implement. After playing around in Blue Ocean, I think I can convince them to switch over. Thanks!

Björn Pedersen

unread,
Aug 21, 2018, 2:37:48 AM8/21/18
to Jenkins Developers
Hi,

While I agree that BlueOcean is the future and it does look much nicer optically, I still think the classical stage-view has it's own advantages, depending on the way you are using
pipelines.
We are using pipelines with parallel and nested stages, and for our use-case the stage-flattend view in stageview is more appropriate than the BlueOcean view that
hides these nested stages.

Björn



blueocean-view.png

stage-view.png




Jesse Glick

unread,
Aug 21, 2018, 10:17:17 AM8/21/18
to Jenkins Dev
On Tue, Aug 21, 2018 at 2:37 AM 'Björn Pedersen' via Jenkins
Developers <jenkin...@googlegroups.com> wrote:
> the stage-flattend view in stageview is more appropriate than the BlueOcean view that
> hides these nested stages.

This is a request which is pretty much as old as BO itself.
Declarative Pipeline deliberately does not offer a nesting level that
BO could not display, but Scripted Pipeline lets you nest `stage` (and
`parallel`) however you see fit, which only the “classic” *Pipeline
Steps* view honors. Confusingly,

https://jenkins.io/projects/blueocean/roadmap/

lists “Support nested stages” as “Not planned”—which I would interpret
as “considered valid but not currently planned for execution”, rather
than “rejected”?—but then links to JENKINS-38442, which is closed as a
duplicate of JENKINS-49050, which is marked fixed. I suppose
JENKINS-53162 is now the active tracking issue? It would be nice if BO
devs could clear up what the ultimate intent is here.

Craig Rodrigues

unread,
Aug 21, 2018, 11:55:25 AM8/21/18
to Jenkins Developers
Reply all
Reply to author
Forward
0 new messages