Commit Graph

170 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 a1d4f91d1a Add context for macro calls
Change-Id: I674b153770297c3a0abbfcee26d840e0f2be490b
2023-11-22 12:58:37 +03:00
Piotr Falkowski 288308b476 Support for Build Failure Analyzer plugin
Change-Id: Iac57193984751a8e93b83a38e7e3bf140821edab
2023-01-16 21:34:52 +01:00
Ruan Bahia da50ce7320 fix branch-api valid time periods
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
2022-12-19 10:27:27 -03:00
trunov_ms 2aec5fc2e6 STORY: 2009856
added support for Matrix Authorization Stategy 3.0+ version

Change-Id: I46521033d9fd6f7f4ae59d8784f9fbfdd49958ed
2022-03-09 10:05:12 +05: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
Bracken Dawson 59317562ec
Second & Minute are now supported by branch-api
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
2021-07-11 21:47:54 +01:00
Zuul 4f615ee5ec Merge "Fix 'authorization' property one more time" 2021-02-15 19:53:03 +00:00
Adam Romanek c0866c56b9 Fix 'authorization' property one more time
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
2021-02-02 16:20:52 +01:00
Oliver Gondza 572cb7abdd Add support for Jenkins Gating property
https: //github.com/jenkinsci/gating-core-plugin
Change-Id: Ia649fe13e3add2c8d6125b775e376621d9d0408d
2021-02-01 10:56:22 +01:00
Zuul ba91e9165d Merge "Added support of Office-365-Connections plugin properies configuration" 2021-01-17 14:20:17 +00:00
Zuul cbc9876189 Merge "Add Gogs Plugin" 2021-01-17 14:16:28 +00:00
Unpublished fedd4b52ab Add Gogs Plugin
Change-Id: I0230a605fd2c3d0c8f7df2c497f3b837499f8758
2021-01-16 12:21:15 +01:00
Igor Lakhtenkov 7cb8169c83 Added support of Office-365-Connections plugin properies configuration
Change-Id: I2108023da57d2d412c0dcca5e513d20fdf059059
Task: #41566
2021-01-15 06:07:29 +03:00
Igor Lakhtenkov 5dd51be6e6 Added property for configuration of speed/durability setting of the job
Change-Id: Ic20aaa55a21fdd88ede95e15ce81c0c613493819
Task: #41581
2021-01-13 18:10:58 +03:00
Eren ATAS 5fcd882d41 Update Naginator-Opt-Out property documentation
Fixed a documentation error.

Change-Id: Ie8d08a479a96b2cf692a037cab57cc3245a54c0b
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
2020-10-02 13:38:43 +02:00
Eren ATAS fed356f4ac Support for Naginator-Opt-Out property
Test case is added.

Change-Id: I3d26391b9f8f4cd5e3ca8df38271c4a01f7b8ce2
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
2020-09-25 14:55:36 +00:00
Adam Romanek 703a76650f Fix Authorization Matrix property - inheritance strategy
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
2020-07-15 13:11:33 +02:00
Adam Romanek 074985c7ff Fix Authorization Matrix property support on jobs in a folder
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
2020-05-13 14:16:45 +02:00
Matt Kucia 08be52c23e modules/properties: Multibranch projects have folder structure
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
2020-03-24 21:57:05 +08: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
Artem Nikitin ad94757a4a Fix authorization property issue
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
2020-01-17 09:55:59 +03: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
Jo Rhett 895d8f3f7a Fix Authorization properties for folder and job in Folder
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
2019-10-02 12:07:13 -07: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
Zuul ead185134d Merge "Add support for two new plugins, and a new version of one" 2019-08-15 19:00:57 +00:00
kendallpcdoctor 5117d87e8c Add support for two new plugins, and a new version of one
Added new support for the following plugins:
Perforce plugin: https://wiki.jenkins.io/display/JENKINS/Perforce+Plugin
InfluxDB plugin: https://wiki.jenkins.io/display/JENKINS/InfluxDB+Plugin

Added support for v3.0 of the following plugin
https://wiki.jenkins.io/display/JENKINS/Priority+Sorter+Plugin

Change-Id: If109863a91710c08b34dee622496e551a7b3b520
2019-07-25 13:12:49 -07:00
Aviel Yosef c907f7708c Adding support for the cachet gating plugin
Change-Id: Ie50d25d09a094f2315e790288f3c3f1619ffdb7f
2019-07-19 09:14:06 +03:00
Alexander Evseev 43f002c65a Property to disable job resume on Jenkins restart
Change-Id: I1bb63ecc02b9f74e59aec70811eaca7c082665be
2019-04-03 16:11:27 +03:00
Thiago Miotto 0f2c43fccf Adds match-script and groovy-sandbox to Lockable Resources Plugin properties
Change-Id: I45db7b1a58f2dea4d46aba61aaf16383d30f1b50
2019-02-22 12:03:11 -03:00
Norbert Grünwald 91a3624c45 Add support for the "Gitlab Logo Plugin"
This adds support for the "Gitlab Logo" plugin
to the properties module.

Change-Id: I7bcffbcb31e478da3e4dd43dedb47e13d6364802
2018-10-17 08:43:08 +02:00
Norbert Grünwald 1709ba73c8 Add support for the "Disk Usage" plugin
This adds support for the "Disk Usage" plugin
to the properties module.

Change-Id: Icead10ae6e4e2e637dddd542128779bf5579d293
2018-10-11 10:52:07 +02:00
Trevor Bramwell 7f51d01631
Fix 'block-level' Build Blocker Plugin Property
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>
2018-10-09 19:37:10 -07:00
Zuul 21d902a633 Merge "docker-container: Improve support for more options" 2018-09-22 16:14:29 +00:00
tanhengyeow f3f2e3ea58
docker-container: Improve support for more options
Change-Id: I261959adcbba235f38fe4ac32b39a88ae96f636f
Co-Authored-By: Anil Belur <askb23@gmail.com>
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-09-21 18:21:20 +05:30
Arne Luehrs 8f1ade81ce Enable groovy sandbox for properties-inject
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
2018-09-17 22:33:48 +02:00
Zuul 8ab1c56b09 Merge "build-blocker: Refactor to increase code quality" 2018-08-21 06:48:30 +00:00
tanhengyeow 2d80dd00d4 branch-api: Support skip-rate-limit param
Change-Id: I4d86b24519381cc76e669f89d8e313f9c30ad999
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-16 22:20:07 +08:00
tanhengyeow 52f5e99ff8 build-blocker: Refactor to increase code quality
Change-Id: I9e2e291c0a99e3fe01dacd0744752fe398b1938a
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-16 22:00:00 +08:00
akulakhan e9702144be Add matching parameter to throttle concurrent jobs
Change-Id: I6d211508d774df2312942d56a840bf311bb455d4
Co-Authored-By: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-01 23:35:25 +08:00
tanhengyeow 1bf06f3fb5 Add commas to all mapping tuples in properties.py
Inserted appropriate commas after the last entry of
the mapping variable to ensure consistency.

Change-Id: I0519cae693f13994bc64f20b40d681a8eafdca55
2018-07-09 23:03:12 +08:00
Randy Coulman 14ac6e9850 Access priority sorter plugin info via short name
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
2018-06-21 12:11:33 -07:00
Zuul f498ef4b2e Merge "Missed Replay property of authorization matrix" 2018-05-22 11:27:09 +00:00
Yolande Amate 7ebe789791
Update build_blocker to make use of convert_mapping_to_xml()
Change-Id: I104bbfce6b90f8ce62f28b75230ea0e86a5e2295
2018-04-20 15:56:19 -04:00
Luca Pierri 3264b244b5 fix spelling errors
Change-Id: I42b6bb46a9e5574f88ec5c0cb5726a65353a4fd7
2018-04-16 23:57:41 +02:00
John Fragoulis 5e5baa114f Support version 2.0 and greater of the Priority Sorter Plugin
The Priority Sorter Plugin changed the xml specification after 2.0. The commit
reflects that change but also keeps support for version 1.0.

References:
[1] https://storyboard.openstack.org/#!/story/2001534
[2] https://wiki.jenkins.io/display/JENKINS/Priority+Sorter+Plugin

Change-Id: I2f861265dfa64cde930c6a8e66c967bf1e6fc831
Closes-Bug: 2001534
2018-02-14 12:51:26 +02:00
Sorin Sbarnea d8ace6802d docs: sphinx upgrade and warnings as erros
Change-Id: I455ac0d79cca3883d3a758a2709c8c0255f4cc7d
2018-01-26 23:57:53 +00:00
Dmitry Burmistrov 62b26140af Missed Replay property of authorization matrix
Add support for Run.Replay property of authorization matrix

Change-Id: I1101c6a15a7e9704a3eccf8f194da6280e54d172
2017-09-23 11:12:00 +00:00
Yolande Amate 3e44a52336 Add support for the Branch API Plugin
Change-Id: I3ed06a4ef957cb088bda8b9a5881d642f68cbe3d
2017-08-16 02:34:31 +01:00
Jenkins 8cfe815e88 Merge "Add support for the Jenkins Docker Plugin's.." 2017-07-26 17:04:47 +00:00