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
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
The heading level of 'Recursive Searching of Paths' and 'Excluding Paths' should be below 'Running'.
Change-Id: I9069b2c205e0dfc945855ea5d7bff02149e1cd51
Plugins are no longer following semantic versioning, and frequently
include additional versioning information.
pkg_resources.parse_version generally handles this well, but some
versions with a hyphen will return a LegacyVersion object rather than
a Version object, causing it to always compare as lower than any
Version object.
Simply replacing any '-' with '+' fixes this issue, and does not
materially change the versioning.
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I5ad949d688ce7ebd0d183d69f4ce87b35343357f
Change I42660519c1cbe94a4322767b1940e113b0e5a276 missed dropping support
for Python 3.6 which is also EOL.
This is not noted as a breaking change as the release email that went out
for JJB 4.0.0 already addresses that we will be dropping support for
Python 3.6 and older so this simply removes the CI testing associated with
that statement.
Change-Id: Ia146401460c8978d1b53213413bf92d5aef9a3cf
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Sphinx was pinned to >1.5.0 <=1.7.0 4 years ago. It is now on v4.4.0,
and we're seeing an incompatibility with the latest version of jinja2.
Along with updating the Sphinx version, this also includes fixes for
several warnings generated in the latest version:
* Outdated docs due to the removal of the "parser" param from
Base.get_xml
* Class lookup issues
* External links for which we have extlinks defined
* Deprated PyModulelevel is replaced by PyFunction
* sphinx.ext.autodoc.Documenter.get_doc signature changed
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: Iba65fb724f098f3e4a0b20f2a183cb2ea3c450ea
Setting desired version of black to 22.3.0 prevents issues with
the click dependency described in the #1966879.
Introduction of black 22.3.0 forced style changes in following files:
- doc/source/conf.py
- jenkins_jobs/local_yaml.py
- tests/base.py
These changes do not modify behavior of the programs concerned.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I42a46f9ed31ea0f404d698eec73d30975e2e6f4c
FIPS restricts usage of md5 and requires the flag 'usedforsecurity' to be set False in order to avoid error:
ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
Change-Id: I99a4ad0bf78bbeb898fb9dcfc79c03a14d596235
Jinja2 formatter wasn't applied in case of macro parameter
without arguments, due to `ModuleRegistry.dispatch`
couldn't find the parameter definition in the registry.
On other hand, project properties weren't applied for
uno-choice parameter macro with arguments, so it makes
impossible to use these parameters with macros.
Change-Id: Idaff9307dff30567a80b917f6e5ac0717100c349
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
Black dropped Python 2 support in 22.1.0. Unfortunately we can't pin
the version as <22.1.0 becasue in the past Black was versioned using
just main.major, not main.major.minor, and they were only releasing beta
versions, hence the 'b' suffix.
Pluggy 1.0.0 dropped Python 2 support.
It seams JJB should drop support for Python 2 too. Otherwise it will
be harder and harder to maintain dependencies...
Change-Id: I13b82a02bb50ab46183ff04aae521b44e475f743
This change adds support for git publisher rebase before push. [0]
[0] https://plugins.jenkins.io/git/
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Change-Id: I3cb0eecbbee6c51433cb4e3b856a3165462f49d1
Multibranch pipelines that use a checker with a query may want to
specify a custom queryString in ChangeDiscovery to cut down on indexing
time.
This is especially useful for repos with a large number of open changes.
Change-Id: Ia9cfd8b637deeb23ac88f7fe9c4ddbd54a5ad17b
This change adds support for Artifactory Trigger. [0]
In order to use this trigger in JJB Templates, Artifactory
Instances the jobs are polling the paths from must be configured
on Jenkins Global Configuration in advance.
[0] https://plugins.jenkins.io/artifactory/
Change-Id: I7b4651c54c5d4dc14916d58ab6c7d6c7e1e8d4c5
The links pointing to full example and anchor & aliases on
yaml website are no longer valid, causing failures for
docs-linkcheck. This change updates the links in the doc.
curl https://yaml.org/spec/1.2/#id2761803
<meta http-equiv="refresh" content="0; url=/spec/1.2.2/" />
curl https://yaml.org/spec/1.2/#id2765878
<meta http-equiv="refresh" content="0; url=/spec/1.2.2/" />
Change-Id: I1d57e9b414694e2dd8e0dca24ef2e6ea96cb35a0
Support was previously added for the other multibranch pipeline scms,
but not for gerrit. This change makes adds support for available git
extensions to the gerrit multibranch pipeline scm.
Previous review: https://review.opendev.org/c/jjb/jenkins-job-builder/+/601323
Change-Id: Ie7553ff310e844bbe912b694b09f97450c609491
Signed-off-by: Pat Long <pllong@arista.com>
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>
This new option has been added in JUnit v1.51
https://github.com/jenkinsci/junit-plugin/releases/tag/junit-1.51
The user can decide not to mark a build as unstable on test failure.
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Change-Id: I960ed98cf4b0f8f632546492f6dbb6d1aa0055c9
This new option has been added in JUnit v1.39
https://github.com/jenkinsci/junit-plugin/releases/tag/junit-1.39
The user can decide not to publish issues to SCM provider platforms.
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Change-Id: I543dbd5cb355acc5106336afd8953a03245df2fa