GithubHelp home page GithubHelp logo

jenkinsci / extended-choice-parameter-plugin Goto Github PK

View Code? Open in Web Editor NEW
75.0 105.0 97.0 1.11 MB

Jenkins extended-choice-parameter plugin

Home Page: https://plugins.jenkins.io/extended-choice-parameter/

License: MIT License

Java 11.07% HTML 0.90% CSS 39.10% JavaScript 48.94%

extended-choice-parameter-plugin's Introduction

Extended Choice Parameter Plugin

Build
Contributors
Jenkins Plugin Installs
Plugin

END OF LIFE

Given the age of this plugin and the number of security issues with the code base, no further development is expected. There are many excellent alternatives that may suit your purpose.

ALTERNATIVES

There are other parameter plugins to use for user inputs.

File Inputs and Outputs

Any file I/O will be removed in a future version. Use another step to read or write files:

Groovy Scripting

Any Groovy Scripting will be removed in a future version. Use pipeline or another plugin to execute groovy:

Introduction

The extended-choice-parameter-plugin creates various types of choice fields for use with the Input Step plugin.

This is accomplished using json-editor, which generates an HTML form from a JSON Schema. The json editor requires two inputs: the html id of the section holding the form and options which drive the form creation.

Help Wanted

Additional documentation is desired. Please create pull requests with better documentation of the params. Thanks!

Params

name

The name of the parameter.

type

The type of parameter

  • Single Select: user chooses a single selection from a drop-down menu, populated by either explicit values (see Value field below) or a property file (see Property File and Property Key fields below)
  • Multi Select: a user can choose multiple selections from a multi-line box, populated by either explicit values (see Value field below) or a property file (see Property File and Property Key fields below)
  • Check Boxes: user can check off zero or more check boxes, labeled by either explicit values (see Value field below) or a property file (see Property File and Property Key fields below)
  • Multi-Level Single Select: user chooses a selection from a drop-down, and then a another drop down appears with selections that depend on the first value, and upon second selection a third drop down may appear depending on the first two selections, and so on.
  • Multi-Level Multi Select: same as single select, but after all levels are chosen, a button appears to "Select another..." and an additional multi-level selection is presented.

value

Comma separated list of values for the single select or multi-select box. This field can be left blank if the comma separated values need to be picked up from a properties file (set via 'Property File' and 'Property Key').

propertyFile

The properties file is a collection of key,value pairs of the form key=value1,value2,...

propertyKey

The property of the property file to use.

For example, if the property file was the following:

prop1=a,b,c,d,e
prop2=1,2,3,4

Then you could specify the property as either prop1 or prop2.

defaultValue

Initial selection of the single-select or mult-select box.

In case of the multi-select box, default value can be a comma separated string.

defaultPropertyFile

Absolute path (specified without using environment variables).

multiSelectDelimiter

Inserts this value between selections when the parameter is a multi-select.

The default when empty is ','

projectName

If specified, this adds a currentProject entry to the groovy script context. The entry's value is set to the specified Jenkins project.

quoteValue

If true, the value or selected values will be formatted with quotes.

visibleItemCount

If specified, this will limit the amount of options displayed by creating a scrolldown list with the only the specified amount visible at once.

groovyScript

A groovy script used to generate the list of values.

groovyScriptFile

A file containing a groovy script used to generate the list of values.

defaultGroovyScript

A groovy script used to generate the list of values used in the initial selection of the single-select or mult-select box.

defaultGroovyScriptFile

A file containing a groovy script used to generate the list of values used in the initial selection of the single-select or mult-select box.

bindings

groovyClasspath

defaultBindings

defaultGroovyClasspath

defaultPropertyKey

descriptionPropertyValue

descriptionPropertyFile

descriptionGroovyScript

descriptionGroovyScriptFile

descriptionBindings

descriptionGroovyClasspath

descriptionPropertyKey

javascriptFile

javascript

saveJSONParameterToFile

More

For info on how to use groovy script feature see this link

Contributing

Refer to contribution guidelines

LICENSE

Licensed under MIT, see LICENSE

extended-choice-parameter-plugin's People

Contributors

based2 avatar chonton avatar ciis0 avatar daniel-beck avatar darxriggs avatar dependabot[bot] avatar gounthar avatar jdimatteo avatar jesstruck avatar jetersen avatar jgreffe avatar jhosmer avatar johngregg avatar lrobertson39 avatar mamh2021 avatar mat1e avatar mikec-bullhorn avatar ndeloof avatar oleg-nenashev avatar olhado avatar olivergondza avatar pascalmartin avatar res0nance avatar rodrigc avatar saluev avatar stefanspieker avatar therealsujitk avatar vimil avatar vlatombe avatar yonahd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extended-choice-parameter-plugin's Issues

Rebuild makes dropdown changes to edit text.

Jenkins and plugins versions report

Issue
So the plugin is working fine to create a dropdown when we do build with parameters but the dropdown get change to text field when in rebuild state.

What Operating System are you using (both controller, and any agents involved in the problem)?

NA

Reproduction steps

1.Click on rebuild the job
2.you should able to see text field instead of dropdown

Expected Results

It always should remain as dropdown even in rebuild state

Actual Results

As of now dropdown gets converted into text field

Anything else?

when build with params

image

when rebuild

image

Are you interested in contributing a fix?

No response

Logical operators are converted to HTML chars in javascript

Jenkins and plugins versions report

Environment

Jenkins: 2.401.2
OS: Windows Server 2019 - 10.0
Java: 11.0.19 - Azul Systems, Inc. (OpenJDK 64-Bit Server VM)

Plugin:
Name: extended-choice-parameter
Version: 373.v1a_ecea_fdf2a_a_

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows (Controller)
Windows (Agent)

Reproduction steps

  1. Create a new 'Extended Choice Parameter'
  2. Name 'Test'
  3. Select 'JSON Parameter Type'
  4. Select 'JSON Parameter Config Javascript'
  5. Put simple IF statement with alert message if (0 < 5) alert ('Test')
  6. Save configuration
  7. Click on Build with Parameters
  8. (!) Syntax error caught in debug mode in web browser (see the attached screenshot below)
ECP_Error

Expected Results

It pops up an alert message when go on 'Build with Parameters' page

Actual Results

No popup with an alert message appears because of syntax error in used javascript when go on 'Build with Parameters' page

Anything else?

It worked fine in the previous version extended-choice-parameter:359.v35dcfdd0c20d Currently when logical operators like <, >, &&, || are used in javascript they are converted to HTML chars

Bootstrap version

What feature do you want to see added?

Is it possible to update bootstrap version to 5.x or 4.x ? Used one is realy outdated, and got some issues with formats, specialy zoom.

Upstream changes

No response

startval in JSON Parameter Config Groovy Script not being used as default value when the job is executed by Timer or by other jobs

Jenkins and plugins versions report

Environment
Jenkins: 2.361.2
OS: Linux - 5.15.0-1033-aws
Java: 11.0.19 - Ubuntu (OpenJDK 64-Bit Server VM)
---
ace-editor:1.1
ant:481.v7b_09e538fcca
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61
aws-credentials:191.vcb_f183ce58b_9
aws-java-sdk-ec2:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-minimal:1.12.287-357.vf82d85a_6eefd
bitbucket:223.vd12f2bca5430
bitbucket-approve:1.0.3
bitbucket-build-status-notifier:1.4.2
bitbucket-pullrequest-builder:1.5.0
bitbucket-push-and-pull-request:2.8.3
bootstrap5-api:5.2.1-3
bouncycastle-api:2.26
branch-api:2.1046.v0ca_37783ecc5
build-timeout:1.24
build-user-vars-plugin:1.9
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
checks-api:1.7.5
cloudbees-folder:6.758.vfd75d09eea_a_1
command-launcher:90.v669d7ccb_7c31
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-27.vb_fa_3896786a_7
conditional-buildstep:1.4.2
config-file-provider:3.11.1
configuration-as-code:1569.vb_72405b_80249
copyartifact:1.47
credentials:1189.vf61b_a_5e2f62e
credentials-binding:523.vd859a_4b_122e6
cucumber-slack-notifier:0.8.3
custom-folder-icon:2.3
display-url-api:2.3.6
durable-task:501.ve5d4fc08b0be
ec2:2.0.4
echarts-api:5.4.0-1
email-ext:2.92
extended-choice-parameter:359.v35dcfdd0c20d
extensible-choice-parameter:1.8.0
external-monitor-job:203.v683c09d993b_9
font-awesome-api:6.2.0-3
generic-webhook-trigger:1.85.2
git:4.12.1
git-client:3.12.1
git-parameter:0.9.18
global-variable-string-parameter:1.2
instance-identity:116.vf8f487400980
ionicons-api:31.v4757b_6987003
jackson2-api:2.13.4.20221013-295.v8e29ea_354141
jacoco:3.3.2
jakarta-activation-api:2.0.1-2
jakarta-mail-api:2.0.1-2
javadoc:226.v71211feb_e7e9
javax-activation-api:1.2.0-5
javax-mail-api:1.6.2-8
jaxb:2.3.7-1
jdk-tool:55.v1b_32b_6ca_f9ca
job-dsl:1.81
jobConfigHistory:1176.v1b_4290db_41a_5
jquery:1.12.4-1
jquery3-api:3.6.1-2
jsch:0.1.55.61.va_e9ee26616e7
junit:1153.v1c24f1a_d2553
ldap:2.12
mailer:438.v02c7f0a_12fa_4
matrix-auth:3.1.5
matrix-project:785.v06b_7f47b_c631
mercurial:1260.vdfb_723cdcc81
mina-sshd-api-common:2.9.1-44.v476733c11f82
mina-sshd-api-core:2.9.1-44.v476733c11f82
miniorange-saml-sp:1.0.14
momentjs:1.1.1
multiple-scms:0.8
node-iterator-api:49.v58a_8b_35f8363
nodejs:1.5.1
nodelabelparameter:1.11.0
pam-auth:1.10
parameterized-trigger:2.45
pipeline-build-step:2.18
pipeline-graph-analysis:195.v5812d95a_a_2f9
pipeline-groovy-lib:613.v9c41a_160233f
pipeline-input-step:456.vd8a_957db_5b_e9
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2118.v31fd5b_9944b_5
pipeline-model-definition:2.2118.v31fd5b_9944b_5
pipeline-model-extensions:2.2118.v31fd5b_9944b_5
pipeline-rest-api:2.27
pipeline-stage-step:296.v5f6908f017a_5
pipeline-stage-tags-metadata:2.2118.v31fd5b_9944b_5
pipeline-stage-view:2.27
pipeline-utility-steps:2.13.0
plain-credentials:139.ved2b_9cf7587b
plugin-util-api:2.18.0
popper2-api:2.11.6-2
publish-over:0.22
publish-over-ssh:1.24
resource-disposer:0.20
role-strategy:562.v44e9a_e828d0e
run-condition:1.5
saml:4.369.v13507586ef8c
scm-api:621.vda_a_b_055e58f7
script-security:1189.vb_a_b_7c8fd5fde
slack:629.vf00ea_cb_40d53
slave-status:1.6
snakeyaml-api:1.32-86.ve3f030a_75631
sonar:2.14
ssh-agent:295.v9ca_a_1c7cc3a_a_
ssh-credentials:305.v8f4381501156
ssh-slaves:2.854.v7fd446b_337c9
ssh-steps:2.0.39.v831c5e6468b_c
sshd:3.249.v2dc2ea_416e33
structs:324.va_f5d6774f3a_d
token-macro:308.v4f2b_ed62b_b_16
trilead-api:2.72.v2a_3236754f73
uno-choice:2.6.5
variant:59.vf075fe829ccb
windows-slaves:1.8.1
workflow-aggregator:590.v6a_d052e5a_a_b_5
workflow-api:1200.v8005c684b_a_c6
workflow-basic-steps:994.vd57e3ca_46d24
workflow-cps:2803.v1a_f77ffcc773
workflow-durable-task-step:1210.va_1e5d77e122b
workflow-job:1249.v7d974144cc14
workflow-multibranch:716.vc692a_e52371b_
workflow-remote-loader:1.5
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
ws-cleanup:0.43

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 20.04

Reproduction steps

  1. Create a simple pipeline with an extended choice parameter named config.
  2. The parameter is JSON Parameter Config with following Groovy Script :
return new groovy.json.JsonSlurper().parseText(/{
  "disable_edit_json": true,
  "disable_properties": true,
  "no_additional_properties": true,
  "disable_collapse": true,
  "disable_array_add": true,
  "disable_array_delete": false,
  "disable_array_reorder": true,
  "theme": "bootstrap2",
  "iconlib":"fontawesome4",
  "schema":{
  "type": "array",
  "disable_array_delete_all_rows" : true,
  "disable_array_delete_last_row" : true,
 "title": "Build Configurations",
  "format": "table",
  "items": {
    "type": "object",
    "properties": {
      "service" : {
        "type": "string",
        "readOnly": "true",
        "propertyOrder" : 1
      },
      "source_branch" : {
        "type": "string",
        "readOnly": "true",
        "propertyOrder" : 2
      },
      "deploy" : {
        "type": "boolean",
        "format": "checkbox",
        "propertyOrder" : 3
      },
    }
  }
},
"startval":[
{
  "service": "service1",
  "source_branch": "dev"
},
{
  "service": "service2",
  "source_branch": "dev"
},
{
  "service": "service3",
  "source_branch": "master"
}
]
}/);
  1. The jenkins job has simple following pipeline groovy script to print the value of CONFIG parameter :

pipeline {
    agent any

    stages {
        stage('test') {
            steps {
                script{
                    echo "${params.CONFIG}"                   
                }
            }
        }
    }
}
  1. When this job is manually triggered, I'm getting the value of startval JSON as the output. But when the job is triggered by a timer or by an upstream job with the help of groovy script, I'm getting null as the output.

Expected Results

I'm expecting the plugin the return the startval as the default value for the parameter when it's triggered by a timer or by any other job.

Actual Results

null

Anything else?

No response

buildWithParameteres

Describe your use-case which is not covered by existing documentation.

how to use it in the URL.
my config
image

one choice is OK:

http://192.168.1.131:8081/job/oms/buildWithParameters?token=xxxx&MICROSERVICES=start-data-base

image

but the multipart choice is not working

http://192.168.1.131:8081/job/oms/buildWithParameters?token=xxxx&MICROSERVICES=start-data-base%2Cstart-web-public

image

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

effectiveValue always auto strip whitespace for each item

Jenkins and plugins versions report

for selectContent.jelly <j:forEach var="value" items="${effectiveValue}">

ParameterDefinitionInfo.effectiveValue always auto strip whitespace in forEach tag, so it will not match value to description

value is 111,22222 ,3333,444444

description is aaa,bbb,ccc,ddd

in computeDefaultValueMap method defaultValues always trim

in computeDescriptionPropertyValueMap method , the map keys not were trim

so I suggest make the three to same strategy

What Operating System are you using (both controller, and any agents involved in the problem)?

extended-choice-parameter-plugin with the lastest source code at df7ecf9 * Update pom.xml

Reproduction steps

select "Basic Parameter Types"
set value to 111,22222 ,3333,444444
set description to aaa,bbb,ccc,ddd
image

Expected Results

image

Actual Results

image

image

Anything else?

No response

http url not working with property file

Jenkins and plugins versions report

I used a property file as http url which is a properties file path. but jenkins cant read it

What Operating System are you using (both controller, and any agents involved in the problem)?

Centos

Reproduction steps

NA

Expected Results

read the value from the http property URL

Actual Results

it wasnt reading the values, working only as a normal file on a machine

Anything else?

No response

Security issue with the plugin

Jenkins and plugins versions report

Warning: This plugin version may not be safe to use. Please review the following security notices:
Stored XSS vulnerability
Stored XSS vulnerability
Arbitrary JSON and property file read vulnerability
CSRF vulnerability and missing permission checks allow SSRF

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

Warning: This plugin version may not be safe to use. Please review the following security notices:
Stored XSS vulnerability
Stored XSS vulnerability
Arbitrary JSON and property file read vulnerability
CSRF vulnerability and missing permission checks allow SSRF

Expected Results

Warning: This plugin version may not be safe to use. Please review the following security notices:
Stored XSS vulnerability
Stored XSS vulnerability
Arbitrary JSON and property file read vulnerability
CSRF vulnerability and missing permission checks allow SSRF

Actual Results

Warning: This plugin version may not be safe to use. Please review the following security notices:
Stored XSS vulnerability
Stored XSS vulnerability
Arbitrary JSON and property file read vulnerability
CSRF vulnerability and missing permission checks allow SSRF

Anything else?

No response

jobDSL requires even empty options - bloats jobDSL

Jenkins and plugins versions report

Environment
Jenkins: 2.387.1
OS: Linux - 5.14.0-162.18.1.el9_1.x86_64
Java: 11.0.18 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
PrioritySorter:4.1.0
ace-editor:1.1
analysis-model-api:11.1.0
ant:481.v7b_09e538fcca
antisamy-markup-formatter:159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
audit-trail:333.vb_e1b_b_0f1238c
authentication-tokens:1.4
authorize-project:1.5.1
backup:1.6.1
bootstrap4-api:4.6.0-5
bootstrap5-api:5.2.2-2
bouncycastle-api:2.27
branch-api:2.1071.v1a_188a_562481
build-failure-analyzer:2.4.1
build-monitor-plugin:1.14-667.vfb_ef30539e07
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
checks-api:2.0.0
claim:516.v36293563731d
cloud-stats:267.v577e3742c282
cloudbees-folder:6.815.v0dd5a_cb_40e0e
command-launcher:90.v669d7ccb_7c31
commons-httpclient3-api:3.1-3
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
conditional-buildstep:1.4.2
config-file-provider:3.11.1
configuration-as-code:1616.v11393eccf675
copyartifact:686.v6fd37018d7c2
credentials:1224.vc23ca_a_9a_2cb_0
credentials-binding:523.vd859a_4b_122e6
crowd2:3.2.1
data-tables-api:1.13.3-3
dependency-check-jenkins-plugin:5.4.0
description-setter:1.10
disk-usage:0.28
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
docker-workflow:563.vd5d2e5c4007f
durable-task:504.vb10d1ae5ba2f
echarts-api:5.4.0-3
email-ext:2.95
envinject:2.901.v0038b_6471582
envinject-api:1.199.v3ce31253ed13
extended-choice-parameter:359.v35dcfdd0c20d
external-monitor-job:203.v683c09d993b_9
font-awesome-api:6.3.0-2
forensics-api:2.1.0
generic-webhook-trigger:1.86.2
git:5.0.0
git-client:4.2.0
git-parameter:0.9.18
git-server:99.va_0826a_b_cdfa_d
github-api:1.303-417.ve35d9dd78549
gitlab-api:5.0.1-78.v47a_45b_9f78b_7
gitlab-branch-source:647.vdee7766b_cfa_e
gitlab-plugin:1.7.9
greenballs:1.15.1
groovy:453.vcdb_a_c5c99890
h2-api:1.4.199
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
http_request:1.16
instance-identity:142.v04572ca_5b_265
ionicons-api:45.vf54fca_5d2154
jackson2-api:2.14.2-319.v37853346a_229
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:226.v71211feb_e7e9
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdk-tool:63.v62d2fd4b_4793
jersey2-api:2.39.1-1
jira:3.9
job-dsl:1.83
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.4-1
jsch:0.1.55.61.va_e9ee26616e7
junit:1189.v1b_e593637fa_e
ldap:671.v2a_9192a_7419d
lockable-resources:1131.vb_7c3d377e723
mailer:448.v5b_97805e3767
mapdb-api:1.0.9-28.vf251ce40855d
mask-passwords:150.vf80d33113e80
matrix-auth:3.1.6
matrix-project:785.v06b_7f47b_c631
maven-plugin:3.21
metrics:4.2.13-420.vea_2f17932dd6
mina-sshd-api-common:2.9.2-62.v199162f0a_2f8
mina-sshd-api-core:2.9.2-62.v199162f0a_2f8
momentjs:1.1.1
multibranch-build-strategy-extension:1.0.10
nexus-artifact-uploader:2.14
okhttp-api:4.10.0-132.v7a_7b_91cef39c
openstack-cloud:2.63
pam-auth:1.10
parameterized-trigger:2.45
pipeline-build-step:487.va_823138eee8b_
pipeline-cps-http:0.3.1
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:629.vb_5627b_ee2104
pipeline-input-step:466.v6d0a_5df34f81
pipeline-maven:1279.v5d711113020f
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2125.vddb_a_44a_d605e
pipeline-model-definition:2.2125.vddb_a_44a_d605e
pipeline-model-extensions:2.2125.vddb_a_44a_d605e
pipeline-rest-api:2.32
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2125.vddb_a_44a_d605e
pipeline-stage-view:2.32
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.2.0
popper-api:1.16.1-3
popper2-api:2.11.6-2
prism-api:1.29.0-4
publish-over:0.22
pubsub-light:1.17
resource-disposer:0.21
run-condition:1.5
scm-api:631.v9143df5b_e4a_a
script-security:1229.v4880b_b_e905a_6
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
sonar:2.15
sse-gateway:1.26
ssh-agent:327.v230ecd01f86f
ssh-credentials:305.v8f4381501156
ssh-slaves:2.877.v365f5eb_a_b_eec
sshd:3.275.v9e17c10f2571
structs:324.va_f5d6774f3a_d
syslog-logger:1.0.5
thinBackup:1.17
throttle-concurrents:2.12
token-macro:321.vd7cc1f2a_52c8
translation:1.16
trilead-api:2.84.v72119de229b_7
variant:59.vf075fe829ccb
view-job-filters:364.v48a_33389553d
warnings-ng:10.1.0
workflow-aggregator:596.v8c21c963d92d
workflow-api:1208.v0cc7c6e0da_9e
workflow-basic-steps:1010.vf7a_b_98e847c1
workflow-cps:3653.v07ea_433c90b_4
workflow-durable-task-step:1241.v1a_63e465f943
workflow-job:1289.vd1c337fd5354
workflow-multibranch:733.v109046189126
workflow-scm-step:408.v7d5b_135a_b_d49
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
ws-cleanup:0.44
xvfb:1.2

What Operating System are you using (both controller, and any agents involved in the problem)?

Controller and Agent Rocky 9.1

Reproduction steps

  1. create a job via jobDSL and use an extendedChoice parameter
  2. use only the needed options
  3. seed job fails with log output

ERROR: (unknown source) the following options are required and must be specified: propertyFile, groovyScript, groovyScriptFile, bindings, groovyClasspath, propertyKey, defaultPropertyFile, defaultGroovyScript, defaultGroovyScriptFile, defaultBindings, defaultGroovyClasspath, defaultPropertyKey, descriptionPropertyValue, descriptionPropertyFile, descriptionGroovyScript, descriptionGroovyScriptFile, descriptionBindings, descriptionGroovyClasspath, descriptionPropertyKey, javascriptFile, javascript, saveJSONParameterToFile, quoteValue
Finished: FAILURE

Expected Results

freeStyleJob('abcd') {
description('a description')
parameters {
extendedChoice {
name('TARGET')
description('a parm description')
type('Multi Select')
visibleItemCount(21)
multiSelectDelimiter(',')
value('option 1,option 2')
defaultValue('option 1,option 2')
}
}
...
}

Actual Results

freeStyleJob('abcd') {
description('a description')
parameters {
extendedChoice {
name('TARGET')
description('a parm description')
type('Multi Select')
visibleItemCount(21)
multiSelectDelimiter(',')
value('option 1,option 2')
defaultValue('option 1,option 2')
// options still required
projectName('')
propertyFile('')
groovyScript('')
groovyScriptFile('')
bindings('')
groovyClasspath('')
propertyKey('')
defaultPropertyFile('')
defaultGroovyScript('')
defaultGroovyScriptFile('')
defaultBindings('')
defaultGroovyClasspath('')
defaultPropertyKey('')
descriptionPropertyValue('')
descriptionPropertyFile('')
descriptionGroovyScript('')
descriptionGroovyScriptFile('')
descriptionBindings('')
descriptionGroovyClasspath('')
descriptionPropertyKey('')
javascriptFile('')
javascript('')
saveJSONParameterToFile(false)
quoteValue(false)
}
}
...
}

Anything else?

Using the wonderful jobDSL approach I would love to get a better support from plugin projects.

Spilling the jobDSL with not needed options could not be the preferred solution, I think.

Would be glad I can remove all useless options from my jobDSL so it is reduced to the really needed options only.

BTW, the documentation of type is not precise enough. In the jobDSL type('PT_MULTI_SELECT') is correct, but that is not clear from the docs.

Javascript should not be escaped (broken plugin)

Jenkins and plugins versions report

Environment
Jenkins: 2.426.2
OS: Linux - 3.10.0-1160.80.1.el7.x86_64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
extended-choice-parameter:376.v2e02857547b_a_
(not all plugins are listed for security reasons)

What Operating System are you using (both controller, and any agents involved in the problem)?

This is not the problem

Reproduction steps

Use the plugin with a javascript file containing the character "&".

Expected Results

Character "&" should stay as it.

Actual Results

Characters like "&" of "<" are escaped (to "&amp;", "&lt;"...)

This is a huge problem because the plugin become unusable right now.

Anything else?

Was working as expected with version 359.v35dcfdd0c20d

Are you interested in contributing a fix?

Maybe

Warning: The currently installed plugin version may not be safe to use. Please review the following security notices: Stored XSS vulnerability Stored XSS vulnerability Arbitrary JSON and property file read vulnerability CSRF vulnerability and missing permission checks allow SSRF

Describe your use-case which is not covered by existing documentation.

Warning: The currently installed plugin version may not be safe to use. Please review the following security notices:
Stored XSS vulnerability
Stored XSS vulnerability
Arbitrary JSON and property file read vulnerability
CSRF vulnerability and missing permission checks allow SSRF

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

HTML tags no longer work in the description field

Jenkins and plugins versions report

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux (Controller)
Windows (Agent)

Reproduction steps

  1. Create an "Extended Choice Parameter"
  2. "Name": "Test"
  3. "Basic Parameter Types"->"Parameter Type": "Check Boxes"
  4. "Basic Parameter Types"->"Number of Visible Items": "1"
  5. "Basic Parameter Types"->"Delimiter": ","
  6. "Basic Parameter Types"->"Choose Source for Value"->"Value": "a"
  7. "Basic Parameter Types"->"Choose Source for Default Value"->"Default Value": "a"
  8. "Basic Parameter Types"->"Choose Source for Value Description"->"Description": "<span style="color:white;background-color:#F14E32;float:left;padding-left:5px;padding-right:5px;width:300px;">Nice Description</span>"

extended-choice-config

Expected Results

Until 359.v35dcfdd0c20d HTML tags were interpreted.

expected

Actual Results

Since 373.v1a_ecea_fdf2a_a_ it looks like.

current

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.