Dependencies required for pipeline jobs in hpi:run

213 views
Skip to first unread message

Parichay Barpanda

unread,
Jul 5, 2019, 12:04:09 AM7/5/19
to Jenkins Developers
Hi all,

I am working Branch Source part of GitLab Plugin. There are a different bugs that needs attention but for now, the basic branch indexing and branch building for Multibranch Pipeline Jobs works just fine.

I want to test the pipeline jobs with `mvn hpi:run`. But when a branch is getting built I get an error:

Branch indexing
Querying the current revision of branch master...
Current revision of branch master is fb65543c24719f77167dcb3967423f349094b4d3
Obtained Jenkinsfile from fb65543c24719f77167dcb3967423f349094b4d3
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: No such DSL method 'pipeline' found among steps [archive, build, catchError, checkout, deleteDir, dir, echo, error, fileExists, getContext, git, isUnix, load, mail, parallel, properties, pwd, readFile, readTrusted, resolveScm, retry, sleep, stash, step, timeout, tool, unarchive, unstash, waitUntil, withContext, withEnv, wrap, writeFile] or symbols [all, always, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanP
.....

The logger also doesn't log `[Pipeline] Start of Pipeline`(Idk what that means). 

When I install the same plugin in `Jenkins docker with the recommended plugins installed`, the pipeline job is performed successfully. I am not quite sure but I think `pipeline jobs` don't work with `hpi:run` as there is/are some missing dependencies. Here is the pom of my plugin https://github.com/baymac/gitlab-branch-source-plugin/blob/feature/branch-source/pom.xml.

Kindly let me know what I am missing something. If this is something other than just missing dependency then can someone with branch source plugins experience have a look at the pr and suggest changes: https://github.com/baymac/gitlab-branch-source-plugin/pull/20.

We can also have further discussions in JIRA https://issues.jenkins-ci.org/browse/JENKINS-58268.

Thank you.

Gavin

unread,
Jul 5, 2019, 3:29:28 AM7/5/19
to jenkin...@googlegroups.com
You need to depend (I recommend scope of test) on the pipeline plugin that implements that feature. I think it would be the following but I can't remember

  <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-step-api</artifactId>
            <version>2.19</version>
            <scope>test</scope>
</dependency>


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7962e605-16d0-40b6-a7fb-a4bb67b2fbe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Devin Nusbaum

unread,
Jul 5, 2019, 9:20:42 AM7/5/19
to jenkin...@googlegroups.com
“pipeline” in a Jenkinsfile comes from Pipeline: Declarative Plugin, groupId is org.jenkinsci.plugins, artifactId is pipeline-model-definition. That has a lot of dependencies, so depending on your use case, it might be preferable to convert your test case to scripted and depend only on workflow-cps, workflow-job, and workflow-basic-steps in test scope (perhaps also a few others such workflow-durable-task-step for the `node` step).

Parichay Barpanda

unread,
Jul 6, 2019, 8:39:43 PM7/6/19
to jenkin...@googlegroups.com
Thanks Gavin and Devin. Pipeline: Declarative dependency was required.

Jesse Glick

unread,
Jul 8, 2019, 1:54:59 PM7/8/19
to Jenkins Dev
On Fri, Jul 5, 2019 at 9:20 AM Devin Nusbaum <dnus...@cloudbees.com> wrote:
> it might be preferable to convert your test case to scripted and depend only on workflow-cps, workflow-job, and workflow-basic-steps in test scope (perhaps also a few others such workflow-durable-task-step for the `node` step).

Seconded. For purposes of testing a branch source, you should not
require anything beyond, say,

node {
checkout scm
echo(/checked out: ${readFile 'something-versioned'}/)
}

so better to keep the dependencies minimal.

Robin Jansohn

unread,
Jul 22, 2019, 10:29:09 AM7/22/19
to Jenkins Developers
I've just run into a similar problem and followed the instructions in https://jenkins.io/doc/developer/testing/ which suggest to use the workflow-aggregator dependency. Unfortunately that does not really solve the problem with the latest parent-plugin POM as the maven-enforcer-plugin throws several upper bound dependencies errors.

I think it might make sense to update those instructions or better yet fix the workflow-aggregator dependency as that would make testing the pipeline functionality a lot easier. For now there seems to be a lot of trial/error necessary to get a working combination of plugins to test the pipeline functionality.

Thoughts?

Jesse Glick

unread,
Jul 22, 2019, 10:50:20 AM7/22/19
to Jenkins Dev
On Mon, Jul 22, 2019 at 10:29 AM 'Robin Jansohn' via Jenkins
Developers <jenkin...@googlegroups.com> wrote:
> followed the instructions in https://jenkins.io/doc/developer/testing/ which suggest to use the workflow-aggregator dependency

Not sure who wrote that. I will file a documentation patch to correct
the advice.

> For now there seems to be a lot of trial/error necessary to get a working combination of plugins

I am working on this.
Reply all
Reply to author
Forward
0 new messages