Problems with deprecated DSL regarding authenticationToken with pipelineJobs

862 views
Skip to first unread message

Brandon Fryslie

unread,
Jul 9, 2018, 5:42:36 PM7/9/18
to job-dsl-plugin
The recent release of the Job DSL Plugin broke several jobs that were previously working due to 'deprecating' features for pipelineJobs.  We were using the 'authenticationToken' DSL and the 'scm' DSL, and the recent code changes broke the jobs that were using them.

As for the 'scm' DSL, previously this set the 'github project' property on the job.  Removing this causes the 'github pull request builder plugin' to throw an error when receiving a webhook w/ a PR for the configured repo.  I have verified that the DSL works properly (sets 'github project' field) with v1.69 of the DSL plugin, but does not set that field on v1.70.  There is a workaround for this issue so it's not a big issue.

The 'authenticationToken' DSL is used to configure the remote trigger plugin, allowing a remote jenkins instance to trigger a pipeline job.  This does not seem to be possible any more.  What is the suggested solution for this case?

Please get back to me with information about how we are now supposed to configure an authenticationToken with a pipelineJob.  Thanks

Greg Lonnon

unread,
Jul 22, 2018, 2:12:59 PM7/22/18
to job-dsl-plugin
Does anyone have a solution for the second issue regarding jobdsl 1.70, authenicationToken and pipelineJob types.

The use case I am trying to solve is using a generic webhook + build authentication token to call a pipeline job.  Is there a migration path in place?

Thanks!
Greg

Keith Yates

unread,
Aug 15, 2018, 6:12:53 PM8/15/18
to job-dsl-plugin
I'd also like to know how to get a pipelineJob to set the token as the job still has the functionality it seems only jobDSL lost the functionality to set it.

Keith Yates

unread,
Aug 15, 2018, 6:41:50 PM8/15/18
to job-dsl-plugin
This is the offending pull request (https://github.com/jenkinsci/job-dsl-plugin/pull/1131) that I believe incorrectly removed this (still working) functionality, as rolling back to 1.69 lets the jobs to continue working correctly.

Jasper Siepkes

unread,
Aug 19, 2018, 10:10:46 AM8/19/18
to job-dsl-plugin
I've bumped into the issue as well. It's mentioned in the migration guide for 1.70 ( https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration ) the 'authenticationToken' function was removed. I've done a bit of digging but as far as I can tell there is no alternative to set it from the actual pipeline job. That means there is currently no way to trigger a pipeline job created by jenkins-dsl from a webhook (for example via a Phabricator diff). Can anyone shed some light on how one is supposed to set the auth token via jenkins-dsl for a pipeline job?

Moa Chung

unread,
Sep 4, 2018, 9:39:58 PM9/4/18
to job-dsl-plugin
if you are using Generic Webhook Trigger Plugin
It support token parameter https://github.com/jenkinsci/generic-webhook-trigger-plugin#token-parameter in version 1.43
sees: https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/70

Brandon Fryslie於 2018年7月10日星期二 UTC+8上午5時42分36秒寫道:

Martin van Dijken

unread,
Sep 17, 2018, 4:31:14 AM9/17/18
to job-dsl-plugin
+1 for restoring this functionality.

Op zondag 19 augustus 2018 16:10:46 UTC+2 schreef Jasper Siepkes:

Jasper Siepkes

unread,
Oct 14, 2018, 4:06:42 AM10/14/18
to job-dsl-plugin
Thanks Moa! Switched to the Generic Webhook trigger to work around the problem and it works like a charm!

Keith Yates

unread,
Oct 23, 2018, 6:45:11 PM10/23/18
to job-dsl-plugin
Bumping this thread again, I don't think using another plugin is an acceptable solution to get around this issue. Currently, my company has rolled back to 1.69 and can't upgrade until this issue is fixed.

testat...@gmail.com

unread,
Feb 18, 2019, 5:05:16 AM2/18/19
to job-dsl-plugin
Regarding to Migrating to 1.70 - scm is marked as deprecated. A deprecated message is thrown in jenkins. Are there any alternatives for doing sth like:

scm {
        git
("www.yyy/zzz.git", 'branch')
}

to check out a repository for job descriptions? Currently we use a main Job  (a "super-Seed-job") that spreads Seed-jobs - which then spread worker jobs.
Or is there another way to do it better? Im open to new.

Im asking because currently we are going to run in trouble if scm will be removed in the next weeks.

With kind regards,
Justus Metzler

Bon Prix

unread,
Feb 18, 2019, 10:52:19 AM2/18/19
to job-dsl-plugin
I forgot,  its just deprecated for the pipelineJob step. But how could i create a "init workspace" when i create a pipelineJob?
I would like to load a definition from a scm source.
definition {
cps {
script(readFileFromWorkspace('jenkins/work.groovy'))
sandbox()
}
}

--
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/456b420a-94aa-4655-bf02-82d8a5e2eb89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shinto cv

unread,
Sep 20, 2021, 9:34:29 AM9/20/21
to job-dsl-plugin
Hi, how do I use an external repo for storing my pipelines. This can be done by `scm` directive in `jobs`. How do I do this in `pipelinejob`?

ulysses santos

unread,
Sep 22, 2021, 1:23:54 AM9/22/21
to job-dsl...@googlegroups.com
Try using the checkout {} method

--
Reply all
Reply to author
Forward
0 new messages