Commit Graph

250 Commits

Author SHA1 Message Date
Vsevolod Fedorov 67645a46eb Fix legacy plugin version comparison; Remove cap on setuptools version
LegacyVersion class is removed from newer setuptools package. But
support for legacy versions is added in python-jenkins 1.8.2.
Switch to that implementation.

Fix broken plugin version comparison for legacy versions.

Assume latest plugin version if no plugin version is found.

Story: 2010990
Story: 2009943
Story: 2009819
Story: 2010842
Task: 49236
Task: 44852
Task: 44396
Task: 48448

Change-Id: Id7f0be1c42357454bd9bedcdee3fefb174943d81
2023-12-19 12:10:43 +03:00
Vsevolod Fedorov e2cf69b4f4 Fix support for obsolete format of pre-scm-buildstep
'pre-scm-buildstep' wrapper has two modes:
1. Older: no 'buildsteps' element is specified. Build steps is a list under
   wrapper name. For example:

    - pre-scm-buildstep:
      - shell: echo hello
      - shell: echo bye

2. Newer: build steps specified inside 'buildsteps' mapping element:

    - pre-scm-buildsteps:
        buildsteps:
        - shell: echo hello
        - shell: echo bye

But, when 'preSCMbuildstep' plugin version is equal or higher 0.3, and first
mode is used, it fails.

Fix that.

Change-Id: I010d9f6c5e06ccd8c2723026aae2c60f79917ff4
2023-12-19 12:10:43 +03:00
Vsevolod Fedorov a1d4f91d1a Add context for macro calls
Change-Id: I674b153770297c3a0abbfcee26d840e0f2be490b
2023-11-22 12:58:37 +03:00
Vsevolod Fedorov 60e8395c62 Add source location and context to error messages
Change-Id: I2e955c01b71a195bb6ff8ba2bb6f3a64cb3e1f58
2023-04-04 13:35:42 +03:00
Ken Dreyer 787164e09a wrappers: omit blank settings for ssh-user-private-key credential
For the ssh-user-private-key credential-wrapper, the "key-file-variable"
setting is mandatory, but the "username-variable" and
"passphrase-variable" settings are optional.

Prior to this commit, if a user omitted "username-variable" or
"passphrase-variable" settings, JJB would write empty
<usernameVariable/> or <passphraseVariable/> entries. When both were
empty, the credentials-binding plugin would crash with an error:

  IllegalArgumentException("Cannot use the same key in both secretValues and publicValues")

To resolve this, do not write XML entries for these optional parameters
when the user does not specify them.

Add a minimal test case reproducer.

Change-Id: I94a4437eee6a8fdaf655c1a3bf69d46844b225bc
2022-06-09 16:37:50 -04:00
Ken Dreyer ce865d4b9c wrappers: rename credentials-binding examples
Rename credentials-binding example files to have a dash to correspond to
the YAML key that users will use.

Add the prefix "-full" to indicate that these are full examples where a
user specifies every variable.

Change-Id: Iae52c037b213c8f5511244ba075063e6b1a1f43a
2022-06-09 16:04:33 -04:00
Adam Romanek 23e6f39287 Fix SSH Agent plugin markup for empty list of users
There are cases when you want SSH Agent plugin to just start and stop
an SSH agent during the build, without adding any keys automatically.
One of such cases is when you want to use an SSH key stored on a
SmartCard -like device, such as NitroKey HSM.

So far, when the "users" property was set to an empty list then the
output XML markup didn't contain the <credentialIds/> tag and the plugin
was then crashing with NullPointerException.

Also, when the "users" property was set to a list with just one value
then the output XML markup was always generated in the "old style"
format (matching plugin versions < 1.5, so like almost 8 years old).

With this change, when using the "users" property the markup is
generated based on the actual plugin version installed in Jenkins. More
importantly, the generated markup is now properly handled by the plugin,
no matter if the input is an empty list or a list with one or more
entries.

Finally, fixed the parent of the <ignoreMissing> tag, which was wrongly
put under <credentialIds> tag when generating the "new style" markup
(1.5+), while it should simply be a top-level tag, laying next to
<credentialIds>, as in the corresponding implementation class [1].
This means the "ignore-missing-credentials" property was broken when the
"users" property was set to a list with more than one entry and it's now
fixed.

[1] https://github.com/jenkinsci/ssh-agent-plugin/blob/ssh-agent-1.5/src/main/java/com/cloudbees/jenkins/plugins/sshagent/SSHAgentBuildWrapper.java#L83

Change-Id: Ife5a08739da9ea1130f0ea7daa08c16675f6c75d
2022-02-13 17:47:39 +01:00
Pat Long d352ed9656 Fix documentation links
Jenkins Wiki has been fully taken off line, so update the remaining
links to reference either the relevant plugin page or the github repo.

Add extlink target for repo in jenkinsci github org.

The sonatype-clm plugin seems to be more-or-less completely deprecated,
so update the description to indicate this and link to the
nexus-artifact-uploader plugin.

Update the jjb sphinx plugin so that it generates references for the
yamlfunctions.

Change-Id: If2241e751d01a60a8cb4cbaea5b3176aeb92eab4
Signed-off-by: Pat Long <pllong@arista.com>
2021-09-09 18:34:40 -04:00
Zuul 7c1c936478 Merge "Updated BuildTimeoutWrapper plugin" 2020-11-16 14:06:38 +00:00
Zuul 24b3b9c87b Merge "Update Build Name support" 2020-11-16 14:06:38 +00:00
Sagar Khushalani 7b805f9c0c Add missing vault-secrets options
This patch adds the following options that are missing from JJB
but available in the UI:

- fail if path not found
- skip ssl verification
- k/v engine version

Change-Id: Id8e14d63c668a1ef826ae88ae3ce0360609bde99
2020-10-13 07:51:16 -05:00
Eren ATAS 5768260ecc Update Build Name support
Added the missing tags, also added a test case.

Change-Id: Ic1cb6c3991afe7ef99dd448e6ba49d510f54bd59
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
2020-10-02 13:35:45 +02:00
Eren ATAS 6b3d7d806b Updated BuildTimeoutWrapper plugin
On version 1.17 of BuildTimeoutWrapper plugin, new option
called "AbortAndRestart" has been introduced. The plugin support
has been updated in order to support this option. A test case
also added.

Change-Id: I4bcbdbc45e177fc4d302baa68898e89463535f6f
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
2020-10-02 13:34:16 +02:00
Adam Romanek 8625fe2a97 Pipelines: stop producing unsupported and deprecated XML tags
The changes include:
- <concurrentBuild> should now be represented as
  <org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
  property
- <triggers> should now be localed inside
  <org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
  property, in <properties> section
- unsupported XML elements got removed:
  - <blockBuildWhenDownstreamBuilding>
  - <blockBuildWhenUpstreamBuilding>
  - <assignedNode>
  - <canRoam>
  - <customWorkspace>
- got rid of publishers from project_pipeline_template005.{xml,yaml} as
  these are not supported in Pipeline jobs

The above changes align the produced XMLs with the ones from Jenkins 2.190.1
and Pipeline plugin v2.6.

Task: 39836
Story: 2007708

Change-Id: I650ef2ee60e872cce8f93de5f391933d68ec81f0
2020-05-25 13:59:13 +02:00
Zuul a3dc53b381 Merge "Ignore py:obj warnings and fail on warnings" 2020-02-07 16:17:45 +00:00
Zuul 29b0e366ab Merge "Fix some typos in documentation" 2020-02-04 15:38:15 +00:00
Mattia Rizzolo d69208c0c4
Fix some typos in documentation
Change-Id: I67d82228bb37b8b4634c07e76a421964e227c3cb
Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2020-02-03 23:46:57 +01:00
Mattia Rizzolo dc83d5161f
Re-order some XML attributes, to preserve ordering
Python 3.8 changed things, so now the order of the attributes is not
alphabetic anymore but reflect the order they where added.
See this CPython commit for more details:
6367391646

This lets the testsuite pass with both CPython 3.8 as well as previous
versions.

Change-Id: I315abda0465d882d9673c9a7faac0990e38b6840
Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2020-02-02 00:18:13 +01:00
Thanh Ha c3ef26c1b0
Ignore py:obj warnings and fail on warnings
* Enables fail on warnings and enable nitpicky
* Consolidate string -> str for args

Change-Id: Id5c29d48813fd6f772816dc74c7c4e408097113d
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 20:43:52 -05:00
Thanh Ha 29b8795753
Update Jenkins wiki -> plugins URLs
The Jenkins Wiki page is deprecated and Jenkins community is expected
to migrate their documentation to plugins.jenkins.io URL. This patch
updates all plugins that have a relevant plugins.jenkins.io URL
documentation link.

Change-Id: Iba7df7eada7b8ca0bb9aad93f5499ac6365a9293
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 19:47:02 -05:00
Thanh Ha 7b00932d2c
Enable docs-linkcheck
This toxenv will allow us to flag URLs that no longer work. We
also switch from using old style setup.py build_sphinx to the
newer sphinx-build command.

Change-Id: I62f42918814fb6eea4876e0d22c6bccddf86a826
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-06 09:50:13 -05:00
Thanh Ha 4d90c187a9 Auto-generated output from python-black
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.

Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2019-09-09 19:23:24 +01:00
Sergii Kipot 38aa498df3 Add support of "disableDeferredWipeout" option to workspace cleanup plugin
Change-Id: I2edd0343966e1720161c291b811b989f005495fb
2019-08-14 20:50:06 +02:00
Andrey Kostrov 2bff652b03 Add `Specs support` for `artifactory_generic`
Add support of Artifactory Specs
https://www.jfrog.com/confluence/display/RTF/Using+File+Specs

As for now, JJB doesnt support of Artifactory Specs,
only deprecated way is supported.

This patch adds possibility for using of Specs inside Jenkins
plugin
https://www.jfrog.com/confluence/display/RTF/Jenkins+Artifactory+Plug-in
Change-Id: I69e64202972f9f9b9147fdd65daffc2734a7d0cd
2019-04-10 13:58:31 +03:00
Zuul 192286d700 Merge "docker-custom-build-env: Add support for new options" 2018-09-21 13:43:00 +00:00
tanhengyeow 55310657f0
docker-custom-build-env: Add support for new options
Change-Id: I9482d2e3c98cf8058d5689cd688b8cc489bbb016
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-09-21 18:38:31 +05:30
Zuul ed468042ba Merge "config-file-provider: Add tests" 2018-09-21 11:38:36 +00:00
Zuul 6f412c8450 Merge "build-keeper: Add support for RunCondition" 2018-09-21 01:43:53 +00:00
Zuul c32bb73d70 Merge "artifactory-generic: Utilize convert_mapping_to_xml" 2018-09-16 17:50:14 +00:00
tanhengyeow b76d4da653 config-file-provider: Add tests
Change-Id: Id8e36d1745bd05527985d5ee9ddfba32c5fa197d
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-09-07 22:50:46 +08:00
Zuul 01ec6d761e Merge "vault-secrets: Utilize convert_mapping_to_xml" 2018-09-04 19:51:05 +00:00
Zuul 75854f6a7e Merge "credentials-binding: Add support for more options" 2018-09-04 19:21:57 +00:00
Zuul 3e4c4afa29 Merge "jclouds: Utilize convert_mapping_to_xml" 2018-09-04 19:13:04 +00:00
tanhengyeow d30af4616a credentials-binding: Add support for more options
Change-Id: I0d193dbab5967b362d92bde58c5a43bacac86bd2
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-09-01 21:20:41 +08:00
Zuul 060542a3fe Merge "rbenv: Utilize convert_mapping_to_xml" 2018-08-31 23:38:28 +00:00
Zuul 6f5a787b45 Merge "ci-skip: Refactor to improve readability" 2018-08-31 23:33:49 +00:00
tanhengyeow 854bec35af build-keeper: Add support for RunCondition
Change-Id: I05e7f9930c18e4cf803eb0d50dbd626bb081c915
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-27 22:26:40 +08:00
tanhengyeow 32a5abfe1d vault-secrets: Utilize convert_mapping_to_xml
Change-Id: If0d4080e6df0b5ab51b36eabce4c721eba8dc987
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-27 20:53:39 +08:00
tanhengyeow 2889530b23 jclouds: Utilize convert_mapping_to_xml
Change-Id: I8830ef72ae50d9a51d8ee3e0ba5d766b7ddcbad9
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-27 20:45:36 +08:00
tanhengyeow 01dc48dcf7 artifactory-generic: Utilize convert_mapping_to_xml
Change-Id: I9add96bfb2e8d55cd9175465326660ab2144e944
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-25 01:15:38 +08:00
tanhengyeow 8f5b0f247c ci-skip: Refactor to improve readability
Change-Id: I7e601edb2a269a2f74c6aec6ee2aa5bb50275720
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-22 23:46:46 +08:00
tanhengyeow 2f693aa4d5 rbenv: Utilize convert_mapping_to_xml
Change-Id: I8da4a843f18aa3c845f4c15cc9ecd346c2c69498
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-22 00:10:34 +08:00
tanhengyeow 4cce3d6a78 ansicolor: Enforce valid types
Change-Id: Ie14dcfc289bc0a88da8071cb4e308a49afd47a2a
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-16 22:03:42 +08:00
tanhengyeow fada164a7d ssh-agent-credentials: Support ignore-missing-credentials param
Change-Id: I5f78648600ef045dfe539a950daae14b304a74d9
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-07-29 17:10:14 +08:00
Thanh Ha 95aaec00a0 [wrappers] Update helpers import to common style
Change-Id: I0c5961b2dbeffecdaf9f25e67a8e4773a7f82dc0
Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-07-24 21:33:31 +08:00
Roman Iuvshyn 465e860684 Adds wrapper for vault plugin
Change-Id: I85ab23670a1d89b04eba01ddd4cc024da1d879a9
Signed-off-by: Roman Iuvshyn <riuvshyn@redhat.com>
2018-06-28 13:29:34 +00:00
Zuul 4167c80d3d Merge "Add support for new option in config_file_provider_builder" 2018-06-21 17:35:52 +00:00
Alphadose 69477f814c Improve support for rvm plugin
rvm version greater than 0.5 requires
a different ruby-class. This patch handles
this case while maintaining backwards
compatibility.

Change-Id: I1fd03922e6125dd17c2bd41bf91560679edaeafc
Story: #2000857
Task: #3476
2018-06-19 11:56:50 +05:30
tanhengyeow 1f857fc816 Improve support for EnvInject plugin
Adds support for groovy script option and sandbox option.
Updated new example YAML and XML files.

Story: #2000922
Task: #3553

Change-Id: Iad44f9a0a776060c6fb1acfc3ebb44fa3c5acef2
2018-06-16 00:30:21 +08:00
Yolande Amate 843929143b Add support for new option in config_file_provider_builder
Change-Id: Iab4ab936a44868abd4e0dbf3033107c0cf33e312
Task: 4669
story: 2001062
2018-05-21 14:18:43 -04:00