Project

General

Profile

task #9513

"table to div regression": replace scriptler + dynamic parameter plugins

Added by Andreas Kohlbecker about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Highest
Category:
devOps
Target version:
-
Start date:
03/05/2021
Due date:
% Done:

40%

Severity:
normal
Tags:

Description

Due to the "table to div regression" the Configure UI is completely broken after upgrade to 2.264 for jobs which are making use of the scriptler plugin. This incident has been reported as JENKINS-65030.

affected jobs

edit-int

  • cdm-vaadin-HFX-START [✓]
  • cdm-vaadin-DEPLOY [✓]
  • taxeditor-SITE-DEPLOY dynamic parameter scriptler already replaced by git-parameter
  • cdm-server-HFX-START [✓]
  • cdm-vaadin-RLS-FINISH [✓]
  • cdm-server-RLS-FINISH [✓]
  • taxeditor-PROVISION [✓]
  • taxeditor-RLS-FINISH [✓]
  • taxeditor-HFX-START [✓]
  • cdm-vaadin-HFX-FINISH - dynamic parameter with scriptler [✓] but ScriptlerBuilder still TODO, see below
  • cdm-dataportal-RLS-FINISH [✓]
  • cdmlib-HFX-FINISH [✓]
  • cdm-webapp-HFX-START [✓]
  • taxeditor-RLS-START [✓]
  • taxeditor-HFX-FINISH [✓]
  • cdmlib-RLS-FINISH [✓]
  • cdm-webapp-RLS-FINISH [✓]
  • cdm-webapp-HFX-FINISH [✓]
  • cdm-server-HFX-FINISH [✓]

TODO in the belos jobs org.jenkinsci.plugins.scriptler.builder.ScriptlerBuilder is being used to read for example the cdmlib.version from the pom.xml and to store it in the ${WORKSPACE}/env.properties which is read and injected as env variable in the next step.

  • cdm-vaadin-HFX-FINISH [✓]
  • cdm-vaadin-RLS-START [✓]
  • cdm-vaadin-HFX-FINISH [✓]
  • cdm-webapp-RLS-START [✓]
  • cdm-server-INTEGRATION [✓]

Solution:

  1. downgrade jenkins to version 2.263 - not easy, see #note-2
  2. replace scripter + dynamic parameter plugins by something else. The scripter plugin has security issues and the maintained is searching for someone to adopt the plugin.

existing groovy scripts

edit-int:

edit-jobber:

  • cdmserver-find-last-instance: Finds the last instance in a cdmserver
  • cdmserver-index-job: Triggers and monitors an index or purge job on a cdmserver for a specific instance
  • cdmserver-instance-action: Allows stopping and starting a cdmserver instance.
  • cdmserver-monitor-instance-status: monitors the cdmsever until the specified instace shows as specific status or if the timeout is exceeded. Returns true (success) if no instances are configured. If no status is given the script will use 'started' as default.
  • cdmserver-monitor-instance-up: monitors the cdmsever until the specified instace is started up or if the timeout is exceeded. Returns true (success) if no instances are configured.
  • cdmserver-monitor-up: monitor cdmsever for all instaces started up. Returns true (success) if no instances are configured.
  • filtered-cdmserver-instance-names: list datasource bean names in datasources.xml as whitespace separated text (suitable for dynamic axix), the instance names listed in the filter_str are either used as include ot exclude filter depending on the value of the filter_includes parameter. If the propertiesFile parameter is specified the final instance names will be written into the property key: 'INSTANCE_NAMES'. WRNING!!! You need to use the absolute path of the file!!!!
  • list-maven-version: Returns a list of all available versions of an e-taxonomy.eu artifact in the wp5.e-taxonomy.eu maven repository

plugins and options to replace existing scriptler groovy scripts:

git-parameter

xml config snippets

replace GIT Branch Lookup

<net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition plugin="git-parameter@0.9.13">
    <name>BRANCH</name>
    <uuid>ef8737cf-24cd-47f2-9388-17f7ae481dc4</uuid>
    <type>PT_BRANCH</type>
    <branch/>
    <tagFilter>*</tagFilter>
    <branchFilter>origin/hotfix/.*</branchFilter>
    <sortMode>DESCENDING_SMART</sortMode>
    <defaultValue>origin/master</defaultValue>
    <selectedValue>TOP</selectedValue>
    <quickFilterEnabled>true</quickFilterEnabled>
    <listSize>5</listSize>
</net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition>

replace Git Tag Lookup

<net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition plugin="git-parameter@0.9.13">
          <name>RELEASE_TAG</name>
          <uuid>58781131-e61b-434d-9f52-42c3b89089a2</uuid>
          <type>PT_TAG</type>
          <branch/>
          <tagFilter>*</tagFilter>
          <branchFilter>.*</branchFilter>
          <sortMode>DESCENDING_SMART</sortMode>
          <defaultValue>origin/master</defaultValue>
          <selectedValue>TOP</selectedValue>
          <quickFilterEnabled>true</quickFilterEnabled>
          <listSize>5</listSize>
        </net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition>

extended-choice-parameter

NOTE:

Problems

  • I could not figure out how to print log entries. println "" does not work as expected.

for how to use groovy scripts, see https://stackoverflow.com/questions/24730186/jenkins-extended-parameter-plugin-groovy-script#24731061

according xml snippet:

<com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition plugin="extended-choice-parameter@0.82">
    <name>GIT_BRANCH_GROOVY</name>
    <quoteValue>false</quoteValue>
    <saveJSONParameterToFile>false</saveJSONParameterToFile>
    <visibleItemCount>5</visibleItemCount>
    <type>PT_SINGLE_SELECT</type>
    <groovyScriptFile>/var/lib/jenkins/tmp-groovy-scripts/git-branch-lookup.groovy</groovyScriptFile>
    <bindings>project=taxeditor
branch_prefix=hotfix
version_regex=.*
add_default_option=
    </bindings>
    <groovyClasspath/>
    <multiSelectDelimiter>,</multiSelectDelimiter>
    <projectName>Tables to divs regression</projectName>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>

groovy plugin

provides build steps to execute groovy scripts and script files either as isolated or system Groovy script

Differences Groovy script vs. system Groovy script

  • A Groovy System Script is run inside the master's JVM, that is imports like import hudson.model.*; can be directly be used. For isolated Groovy scripts you do need to add the jenkins-core jar to your classpath, and the stapler jar too.
  • Working directory
    • Groovy Script working directory $WORKSPACE
    • system Groovy Script working directory /
  <builders>
    <hudson.plugins.groovy.Groovy plugin="groovy@2.3">
      <scriptSource class="hudson.plugins.groovy.FileScriptSource">
        <scriptFile>/var/lib/jenkins/workspace/jenkins-groovy-scripts/getXPathSingleValue-args.groovy</scriptFile>
      </scriptSource>
      <groovyName>groovy-3.0</groovyName>
      <parameters/>
      <scriptParameters>pom.xml properties/cdmlib.version env.properties</scriptParameters>
      <properties/>
      <javaOpts/>
      <classPath/>
    </hudson.plugins.groovy.Groovy>
    <EnvInjectBuilder plugin="envinject@2.4.0">
      <info>
        <propertiesFilePath>${WORKSPACE}/env.properties</propertiesFilePath>
      </info>
    </EnvInjectBuilder>
  </builders>

picture576-1.png View (46.5 KB) Andreas Kohlbecker, 03/08/2021 02:29 PM

picture324-1.png View (40 KB) Andreas Kohlbecker, 03/08/2021 03:42 PM

History

#1 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#2 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

downgrading to v2.263 is not easily possible as this will require to downgrade a couple of plugins also

#3 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#4 Updated by Andreas Kohlbecker about 1 month ago

  • Subject changed from "table to div regression": replace scripter + dynamic parameter plugins to "table to div regression": replace scriptler + dynamic parameter plugins

#5 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#6 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#7 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#8 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#9 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#10 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#11 Updated by Andreas Kohlbecker about 1 month ago

#12 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#13 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#14 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#15 Updated by Andreas Kohlbecker about 1 month ago

#16 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#17 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#18 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#19 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#20 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#21 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#22 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#23 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#24 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#25 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#26 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#27 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#28 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#29 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#30 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#31 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#32 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#33 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#34 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#35 Updated by Andreas Kohlbecker about 1 month ago

  • Description updated (diff)

#36 Updated by Andreas Kohlbecker about 1 month ago

  • Status changed from New to Resolved
  • Target version deleted (Unassigned CDM tickets)
  • % Done changed from 0 to 50

#37 Updated by Andreas Kohlbecker about 1 month ago

  • % Done changed from 50 to 40

last TODO

remove

  • Dynamic Parameter Plug-in
  • Scriptler Plug-in

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)