Interview Prep/Jenkins/Plugins, JCasC & Kubernetes agents

Job DSL in JCasC fails: `ERROR: (script, line 3) No signature of method: javaposse.jobdsl.dsl.helpers.workflow.BranchSourcesContext.github() is applicable`

AdvancedTroubleshootingPlugins, JCasC & Kubernetes agents
Answer

Likely causes → Static DSL method not available; GitHub branch source is exposed only through the dynamic DSL (branchSource { source { github { ... } } }), or the plugin is missing.

Diagnose → Check the Job DSL API viewer on your controller (/plugin/job-dsl/api-viewer/index.html) for available methods.

Fix →

branchSources { branchSource { source { github {
  id('shack-app'); repoOwner('devopsshack'); repository('shack-app')
  repositoryUrl('https://github.com/devopsshack/shack-app'); configuredByUrl(true)
  credentialsId('github-app')
} } } }

Prevent → Use the API viewer of your own controller as the reference, not internet examples.

All Jenkins questions Roadmap: Jenkins

More on Plugins, JCasC & Kubernetes agents