Project

General

Profile

Actions

task #9513

closed

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

Added by Andreas Kohlbecker over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Highest
Category:
devOps
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
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.

Note by AM: the regression is fixed since 6-2021

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 below 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'. WARNING!!! 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>

Files

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

Related issues

Related to EDIT - task #9950: remove Scriptler Plug-inNewAndreas Müller

Actions
Related to EDIT - bug #10007: fix reindex jobs on jobberClosedAndreas Müller04/06/202204/08/2022

Actions
Related to EDIT - bug #7579: Set up pipelines in Jenkins to replace the build pipelinesNewAndreas Müller

Actions
Actions #1

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)

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

Actions #3

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #4

Updated by Andreas Kohlbecker over 3 years ago

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

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #6

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #7

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #8

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #9

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #10

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #11

Updated by Andreas Kohlbecker over 3 years ago

Actions #12

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #13

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #14

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #15

Updated by Andreas Kohlbecker over 3 years ago

Actions #16

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #17

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #18

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #19

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #20

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #21

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #22

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #23

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #24

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #25

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #26

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #27

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #28

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #29

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #30

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #31

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #32

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #33

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #34

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #35

Updated by Andreas Kohlbecker over 3 years ago

  • Description updated (diff)
Actions #36

Updated by Andreas Kohlbecker over 3 years ago

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

Updated by Andreas Kohlbecker over 3 years ago

  • % Done changed from 50 to 40

last TODO

remove

  • Dynamic Parameter Plug-in
  • Scriptler Plug-in ---> see #9950
Actions #38

Updated by Andreas Kohlbecker over 2 years ago

Dynamic Parameter Plug-in

edit-int

can be removed from edit-int as this plugin is no longer being used by any active job. it only is referenced in the BACKUP jobs, which can be removed:

./cdm-webapp-HFX-FINISH (BACKUP)/config.xml:35:        <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.0">
./cdmlib-HFX-FINISH (Backup)/config.xml:17:        <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.0">
./cdm-server_trigger_remote-INSTALL/config.xml:17:        <com.seitenbau.jenkins.plugins.dynamicparameter.ChoiceParameterDefinition plugin="dynamicparameter@0.2.0">
./cdm-vaadin-HFX-FINISH (BACKUP)/config.xml:26:        <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.0">
./cdm-server-HFX-FINISH (Backup)/config.xml:17:        <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.0">

edit-test:

plugin used in cdmserver-INSTALL --> needs to be replaced! TODO

./cdmserver-INSTALL/config.xml:17:        <com.seitenbau.jenkins.plugins.dynamicparameter.ChoiceParameterDefinition plugin="dynamicparameter@0.2.0">

edit-jobber-1:

  • REINDEX-col-catalogue-services
  • TRIGGER-cdmserver-reindex
  • cdmserver-update
Actions #39

Updated by Andreas Kohlbecker over 2 years ago

  • Related to task #9950: remove Scriptler Plug-in added
Actions #40

Updated by Andreas Kohlbecker over 2 years ago

status:

  • edit-jobber-1: DONE
  • edit-test: todo
  • edit-int: todo
Actions #41

Updated by Andreas Kohlbecker over 2 years ago

status:

  • edit-jobber-1: DONE
  • edit-test: DONE
  • edit-int: todo
Actions #42

Updated by Andreas Kohlbecker over 2 years ago

status:

  • edit-jobber-1: DONE
  • edit-test: DONE
  • edit-int: DONE
Actions #43

Updated by Andreas Kohlbecker over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 40 to 100
Actions #44

Updated by Andreas Müller over 2 years ago

  • Description updated (diff)
Actions #45

Updated by Andreas Müller over 2 years ago

  • Related to bug #10007: fix reindex jobs on jobber added
Actions #46

Updated by Andreas Müller over 2 years ago

  • Description updated (diff)
Actions #47

Updated by Andreas Müller over 2 years ago

  • Description updated (diff)
Actions #48

Updated by Andreas Müller over 2 years ago

  • Related to bug #7579: Set up pipelines in Jenkins to replace the build pipelines added
Actions

Also available in: Atom PDF