question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GHPRB Job DSL for pipelines breaks with Job DSL >= 1.70

See original GitHub issue

GHPRB Job DSL for pipelines breaks with Job DSL >= 1.70

If I understand correctly, the GHPRB Job DSL example tracks the GitHub repo specified in the scm, git, remote context - see the example Job DSL below taken from the plugin site.

However, support for the scm{} context (and others) has been dropped for Pipeline Jobs in Job DSL 1.70 (see https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration#migrating-to-170).

If scm{} is deprecated, it would seem that the remote for tracking must be specified some other way.

pipelineJob('example') {
    scm {
        git {
            remote {
                github('test-owner/test-project')
                refspec('+refs/pull/*:refs/remotes/origin/pr/*')
            }
            branch('${sha1}')
        }
    }
    triggers {
        githubPullRequest {
            admin('user_1')
            admins(['user_2', 'user_3'])
            userWhitelist('you@you.com')
            userWhitelist(['me@me.com', 'they@they.com'])
            orgWhitelist('my_github_org')
            orgWhitelist(['your_github_org', 'another_org'])
            cron('H/5 * * * *')
            triggerPhrase('OK to test')
            onlyTriggerPhrase()
            useGitHubHooks()
            permitAll()
            autoCloseFailedPullRequests()
            allowMembersOfWhitelistedOrgsAsAdmin()
            extensions {
                commitStatus {
                    context('deploy to staging site')
                    triggeredStatus('starting deployment to staging site...')
                    startedStatus('deploying to staging site...')
                    statusUrl('http://mystatussite.com/prs')
                    completedStatus('SUCCESS', 'All is well')
                    completedStatus('FAILURE', 'Something went wrong. Investigate!')
                    completedStatus('PENDING', 'still in progress...')
                    completedStatus('ERROR', 'Something went really wrong. Investigate!')
                }
            }
        }
    }
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jmbowmancommented, Nov 9, 2018

Having just helped diagnose a problem updating a pipeline job to seed correctly with a newer version of the Job DSL plugin, I think what you want is pipelineJob -> definition -> cpsScm -> scm. I’ve only tested it with Job DSL 1.67 so far, but it looks like it should continue working past the deprecation of the top-level scm context you’re worried about; all of those contexts are still present in the 1.70 documentation.

0reactions
nocode99commented, Jan 12, 2021

@danielstoian you still get a deprecation warning

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with deprecated DSL regarding ...
The recent release of the Job DSL Plugin broke several jobs that were previously working due to 'deprecating' features for pipelineJobs.
Read more >
pipelineJob - Jenkins Job DSL Plugin
Create or updates a pipeline job. Requires Pipeline: Job Since 1.47. pipelineJob(String name) {}. Create or updates a pipeline job.
Read more >
Migrating to 1.81
The following methods in the pipelineJob are deprecated and will be removed because they are not available for the Pipeline job type. DSL...
Read more >
How to configure a Jenkins pipelineJob via jenkins job dsl ...
pipelineJob("Test GHPRB") { properties { pipelineTriggers { triggers { githubPullRequest { useGitHubHooks() orgWhitelist('orgName') ...
Read more >
Online Meetup: From Freestyle jobs to Pipeline, with JobDSL
Recording of the Online Jenkins Meetup on May 19, 2020. Presenter: Nicolaj Græsholt, Eficode Praqma. Journey with Nicolaj, as he talks about ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found