Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-34617] Add a @Symbol for "extendedChoice" #25

Merged
merged 1 commit into from Apr 1, 2019

Conversation

Projects
None yet
7 participants
@rodrigc
Copy link
Contributor

commented Mar 4, 2019

This allows extendedChoice() to be used in the parameters
block of a declarative pipeline.

For example:

parameters {
    extendedChoice( 
        defaultValue: 'One,Two,Three,Four', 
        description: '', 
        multiSelectDelimiter: ',', 
        name: 'SAMPLE_EXTENDED_CHOICE', 
        quoteValue: false, 
        saveJSONParameterToFile: false, 
        type: 'PT_CHECKBOX', 
        value:'One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten', 
        visibleItemCount: 10)
    }
[JENKINS-34617] Add a @symbol for "extendedChoice"
This allows extendedChoice() to be used in the parameters
block of a declarative pipeline.
@agray

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

Can the value attribute be "calculated" as the result of a groovy script? :)

From a shared library?

@rodrigc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

@agray I don't know. I just tried this patch and used extendedChoice() in one of my pipelines

@agray

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

@rodrigc would be a great feature to add that has been missing from declarative pipelines (AFAIK).

Happy for someone to tell me if such functionality exists elsewhere to extend this lack of functionality in choice() parameter.

@zentavr

This comment has been minimized.

Copy link

commented Mar 20, 2019

I wonder when this functionality will be available for the wide public?

@rodrigc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 20, 2019

@zentavr I emailed the plugin maintainer about this plugin. He did not respond yet

@zentavr

This comment has been minimized.

Copy link

commented Mar 20, 2019

@oleg-nenashev I wonder how the PR gets accepted in this organization?
We do really need this feature in the wide public!

@oleg-nenashev

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

@zentavr PRs are being accepted and released by the plugin maintainers. If there is no active plugin maintainers, there is an adoption process: https://wiki.jenkins.io/display/JENKINS/Adopt+a+Plugin .

If anyone is interested to get this fix out of the door, please feel free to request ownership of the plugin.

@zentavr

This comment has been minimized.

Copy link

commented Mar 21, 2019

I forked this repo and did a build with this patch here. Testing that locally now.

@zentavr

This comment has been minimized.

Copy link

commented Mar 21, 2019

Works like a charm! :)

        extendedChoice(
            name: 'lambda_api_key',
            description: 'Artifact for api_key AWS Lambda',
            multiSelectDelimiter: ',',
            visibleItemCount: 10,
            quoteValue: false,
            type: 'PT_SINGLE_SELECT',
            /* Default Property Value Settings */
            defaultPropertyFile: "${lambdasArtifactsListFile}",
            defaultPropertyKey: 'API_KEY_LATEST',
            /* Values List Settings */
            propertyFile: "${lambdasArtifactsListFile}",
            propertyKey: "API_KEY_LIST"
            )

Знімок екрана  о 16 31 55

@afrancoc2000

This comment has been minimized.

Copy link

commented Mar 21, 2019

I've been waiting for this for a while hope it gets merged soon, I will use the patch for now Thanks!!!

@dilipdesing

This comment has been minimized.

Copy link

commented Mar 29, 2019

When I tried to use the above code, I have got the following error,

java.lang.NoSuchMethodError: No such DSL method 'extendedChoice' found among steps [ansiColor, ansiblePlaybook, ansibleVault, archive, bat, build, catchError, checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerNode, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, getContext, git, input, isUnix, jiraComment, jiraIssueSelector, jiraSearch, junit, library, libraryResource, load, lock, mail, milestone, node, parallel, powershell, properties, publishHTML, pwd, readFile, readTrusted, resolveScm, retry, script, sh, slackSend, sleep, sshagent, stage, stash, step, svn, timeout, timestamps, tm, tool, unarchive, unstash, validateDeclarativePipeline, waitUntil, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, wrap, writeFile, ws] or symbols [all, allOf, always, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, artifactManager, attach, authorizationMatrix, batchFile, bitbucket, booleanParam, branch, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDiscarder, buildingTag, caseInsensitive, caseSensitive, certificate, changeRequest, changelog, changeset, checkoutToSubdirectory, choice, choiceParam, cleanWs, clock, cloud, command, credentials, cron, crumb, culprits, defaultView, demand, developers, disableConcurrentBuilds, disableResume, docker, dockerCert, dockerfile, downloadSettings, downstream, dumb, durabilityHint, envVars, environment, equals, expression, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, fromScm, fromSource, git, github, githubPush, gradle, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, inheriting, inheritingGlobal, installSource, isRestartedRun, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobName, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM, list, local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, modernSCM, myView, newContainerPerStage, node, nodeProperties, nonInheriting, nonStoredPasswordParam, none, not, overrideIndexTriggers, paneStatus, parallelsAlwaysFailFast, parameters, password, pattern, permanent, pipeline-model, pipelineTriggers, plainText, plugin, pollSCM, preserveStashes, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, rateLimitBuilds, recipients, remotingCLI, requestor, run, runParam, schedule, scmRetryCount, scriptApprovalLink, search, security, shell, skipDefaultCheckout, skipStagesAfterUnstable, slackNotifier, slave, sourceRegexFilter, sourceWildcardFilter, ssh, sshUserPrivateKey, stackTrace, standard, status, string, stringParam, swapSpace, tag, text, textParam, tmpSpace, toolLocation, triggeredBy, unsecured, upstream, upstreamDevelopers, usernameColonPassword, usernamePassword, viewsTabBar, weather, withAnt, zfs, zip] or globals [currentBuild, docker, env, params, pipeline, scm]

Looks like Jenkins doesnt support this function yet.?

@zentavr

This comment has been minimized.

Copy link

commented Mar 29, 2019

@dilipdesing - you can try the compiled version. Use my link above.

@rodrigc rodrigc referenced this pull request Mar 30, 2019

Closed

Add rodrigc to extended-choice-parameter #1081

4 of 4 tasks complete
@rodrigc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 30, 2019

@zentavr I'm going to try to obtain write permissions to this plugin: jenkins-infra/repository-permissions-updater#1081

@vimil vimil merged commit c795ff0 into jenkinsci:master Apr 1, 2019

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details
@zentavr

This comment has been minimized.

Copy link

commented Apr 1, 2019

@vimil - do we expect a new build soon?

@vimil

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

yes I have released version 0.78 which has the requested changes. My email in github was outdated which is why I couldn't respond sooner.

@rodrigc rodrigc deleted the rodrigc:JENKINS-34617-rodrigc branch Apr 3, 2019

@rodrigc

This comment has been minimized.

Copy link
Contributor Author

commented Apr 3, 2019

@vimil Thanks!

@rodrigc

This comment has been minimized.

Copy link
Contributor Author

commented Apr 5, 2019

@vimil If possible please update your contact email in GitHub to one that is accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.