Changing columns in sectioned view

58 views
Skip to first unread message

Kristof Meixner

unread,
Jan 28, 2016, 6:04:50 AM1/28/16
to job-dsl-plugin
Hi!

I have the following view creation but have issues to adjust the columns when using columns from another plugin as I can't change the listView in the sectionedView with a standard configure block like the one below. Any idea how to tackle this?

Best regards,
Kristof

sectionedView('project-summary') {
  sections
{
    listView
{
      name
('Project-A')
      jobs
{
        regex
(/project-A-.*/)
     
}
      columns
{
        status
()
        weather
()
        name
()
        lastSuccess
()
        lastFailure
()
     
}
   
}
 
}
}

configure { node ->
node
/ "sections" / "hudson.plugins.sectioned__view.ListViewSection"/ "columns" << "hudson.plugins.jacococoveragecolumn.JaCoCoColumn"()


Daniel Spilker

unread,
Jan 28, 2016, 6:13:53 AM1/28/16
to job-dsl...@googlegroups.com
I tried your code in the playground (http://job-dsl.herokuapp.com/) and it works as expected:


sectionedView('project-summary') {
  sections {
    listView {
      name('Project-A')
      jobs {
        regex(/project-A-.*/)
      }
      columns {
        status()
        weather()
        name()
        lastSuccess()
        lastFailure()
      }     
    }
  }
  configure { node ->
    node / "sections" / "hudson.plugins.sectioned__view.ListViewSection"/ "columns" << "hudson.plugins.jacococoveragecolumn.JaCoCoColumn"()
  }
}


Support for the JaCoCo column has already been merged for the next release, see https://github.com/jenkinsci/job-dsl-plugin/pull/729.

Daniel


--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/b7f6ae80-631e-4ba1-8ab9-910d4a84628d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kristof Meixner

unread,
Feb 1, 2016, 10:54:12 AM2/1/16
to job-dsl-plugin
Hi!

I forgot to add a second listView to the example code. Then the Jacoco column is only shown in the first listView. Can you give me a hint how to affect all of the defined listViews?

Best regards

Kristof Meixner

unread,
Feb 29, 2016, 3:57:15 AM2/29/16
to job-dsl-plugin
Anyone got an idea?

Matt Sheehan

unread,
Feb 29, 2016, 9:33:16 AM2/29/16
to job-dsl-plugin
You can do this:

sectionedView('project-summary') {
  sections {
    listView {
      name('Project-A')
      jobs {
        regex(/project-A-.*/
)
      }
      columns {
        status()
        weather()
        name()
        lastSuccess()
        lastFailure()
      }      
    }
    listView {
      name('Project-B')
      jobs {
        regex(/project-B-.*/)
      }
      columns {
        status()
        weather()
        name()
        lastSuccess()
        lastFailure()
      }      
    }
  }
  configure { node ->
    (node / "sections").children().each {
      it / "columns" << "hudson.plugins.jacococoveragecolumn.JaCoCoColumn"()
    }
  }
}


Kristof Meixner

unread,
Mar 3, 2016, 5:01:46 AM3/3/16
to job-dsl-plugin
Thanks a ton. This helped a lot.
Reply all
Reply to author
Forward
0 new messages