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
removes first letter capitalization from the valid time periods, e.g.:
- Second -> second;
- Minute -> minute;
- Hour -> hour;
- and so on...
- only lowercase time periods are recognized by Jenkins Branch API Plugin:
- that can be observed on the plugin implementations themselves:
- https://github.com/jenkinsci/branch-api-plugin/search?q=Minute
- on the Message.properties file it can be verified that the
value of the "Minute" property is actually "minute", and that
can also be validated pratically, setting the durationName
XML to "Minute" is not effective, Jenkins effectively
interprets it as default "Hour" since "Minute" is not valid.
Change-Id: I25f0a3945b9d708fa2de5c5fdb7f39a9432b5cc3
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>
Since version 2.5.3 the branch-api plugin allows users to specify Minute
and Second as the time period for rate limiting.
Task: 42803
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
Change-Id: Id3558d818e2927ecc3d775870ad1929f0fda2e6f
Due to the fact how dispatching works the 'authorization' property
handler was not always invoked through Properties.gen_xml(), leading to
a bug and an invalid test case: project-with-auth-properties.(yaml/xml)
This change pushes the logic for determining if the object is a
folder/multi-branch project from Properties.gen_xml() to the
authorization() function itself. For that to work the authorization()
function needed access to the top-level job object, which is now
conditionally passed to each dispatched function as a keyword argument,
if the function takes 'job_data' argument. Note that taking this
argument is completely optional so no changes were required in other
handlers. In the future the same approach could be taken to eliminate
the hacks for 'uno-choice' in Parameters.gen_xml().
Additionally ModuleRegistry.dispatch() now merges the top-level job
object with any template data before deep-formatting, so that job-level
properties are now available in Jinja templates. A very nice use case
is in project-with-auth-j2-yaml.yaml test case.
Change-Id: I9a49de74055cd9acfdc87dbad1fc454548643e8f
Up until now <inheritanceStrategy> tag was only added to jobs-in-a-folder
and folder configs. In JJB the tag's class is always set to
"InheritParentStrategy" which according to the docs means the "item will
inherit its parent items permissions". Apparently <inheritanceStrategy>
tag needs to be present on top-level jobs also. For top-level jobs
setting the tag's class value to "InheritParentStrategy" means the job
"will inherit the global security security settings" and this is the
default behavior.
The code has simplified a bit - if it's a folder then we use a different
property name for authorization matrix property, other than that the
code is the same for all three "variants": folder, job-in-a-folder and
job-outside-a-folder (top-level job).
Also this change fixes the missing <inheritanceStrategy> tag for
job-in-a-folder, where the folder name was specified as part of the
"name" key instead of the standalone "folder" key. With this change we
no longer check if a job is in a folder or not, so it's implicitly
fixed. Added a test case to catch potential regressions in the future.
The copyright notice reflects this and the previous contribution in this
module.
Change-Id: I84b22c09c8a107aab2b4eca20feffc9b61675a92
Without the fix:
> 2020-05-11 10:56:12.238+0000 [id=29522] WARNING
> o.e.j.s.h.ContextHandler$Context#log: Error while serving http://localhost/job/someFolder/createItem
> java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty cannot be cast to hudson.model.JobProperty
It turns out com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty
should only be applied to Folders, not Jobs. The latter should use
hudson.security.AuthorizationMatrixProperty.
Task: 39760
Story: 2007666
Change-Id: I64907265b214fb1e489e1e657a30c90d6ee08c3f
Without this change, multibranch project creation with authorization
parameter would fail with
hudson.security.AuthorizationMatrixProperty cannot be cast
to com.cloudbees.hudson.plugins.folder.AbstractFolderProperty
Change-Id: Ie83355705f0526f2984eca0e5f1f80fba8b1ba5f
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>
The change fixes a XML generating error (KeyError: '_use_folder_perms')
for project, which isn't contained in a folder and has got authorization
properties.
Task: 38110
Story: 2007087
Change-Id: I2e0ec6e524d07a935333b35e10eb4204af9256f7
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>
This outputs the correct XML schema for authorization properties for
both a folder, and a job inside a folder.
Story: 2006493
Story: 2006611
Change-Id: I14662855613ce146f74b85f5978a0ed828f4439b
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>
In the process of taking advantage of 'convert_mapping_to_xml()',
commit:7ebe78979166e36a038a116788c33383878ced20 renamed 'block-level' to
'blocking-level' in the build-blocker property.
Another unrelated commit modified the test to use 'block_level' instead
of 'block-level'.
Change-Id: I2dd642ec4966c4c48e0a35e986a69b3b74803358
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
The groovy-plugin has introduced with it's 2.0 release on April 10th 2017
the notion of SecureGroovyScript with the associated sandbox for groovy code
To enable JJB jobs relying on the sandbox groovy execution we need to enable
the expected SecureGroovyScript XML stanza.
When used with the groovy 2.0 plugin this will
enable the following JJB YAML stanza
properties:
- inject:
groovy-content: test groovy-content location 004
groovy-sandbox: true
Needed for groovy code sandbox mode
This implementation is the same as the wrapper implementation in
jenkins_jobs/modules/wrappers.py L949- L989
Change-Id: I93e890a7a0496520246532adbdfd84e3be746abf
In [version 2.0](8f2ae302bd)
of the priority sorter plugin, the long name of the plugin was renamed
to "Jenkins Priority Sorter Plugin", which broke the `priority_sorter`
function in the `properties` module.
The short name did not change, so we now use that instead to ensure
that we generate a configuration that matches the latest required by
the plugin.
Change-Id: I89a8fdabeac63ea482b3b1bd8ddf2dd83c1c7435
Task: 3112
Story: 2000655