Commit Graph

199 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
Oleg Stiplin 6d71ade6bd Add tokenCredentialId parameter support to generic-webhook-trigger
Change-Id: Ied3cbe3758967659f83637ccea78d834079a1470

Add tokenCredentialId parameter support to generic-webhook-trigger

Change-Id: Ied3cbe3758967659f83637ccea78d834079a1470
2023-06-13 13:18:45 +03:00
Vsevolod Fedorov af9e03ec08 Rewrite YAML parser
Rewrite YAML parser, YAML objects and parameters expansion logic to
enable better control over expansion logic.
Broken backward compatilibity:
* More agressive parameter expansion. This may lead to parameters
  expanded in places where they were not expanded before.
* Top-level elements, which is not known to parser (such as 'job',
  'view', 'project' etc), are now lead to parse failures.
  Prepend them with underscore to be ignored by parser.
* Files included using '!include-raw:' elements and having formatting in
  it's path ('lazy-loaded' in previous implementation) are now expanded
  too.
  Use '!include-raw-escape:' for them instead.
  See changes in these tests for examples:
    tests/yamlparser/job_fixtures/lazy-load-jobs-multi001.yaml
    tests/yamlparser/job_fixtures/lazy-load-jobs-multi002.yaml
    tests/yamlparser/job_fixtures/lazy-load-jobs001.yaml
* Parameters with template value using itself were substituted as is.
  For example: "timer: '{timer}'" was expanded to "{timer}". Now it
  leads to recursive parameter error.
  See changes in this test for example:
    tests/yamlparser/job_fixtures/parameter_name_reuse_default.*
    ->
    tests/yamlparser/error_fixtures/parameter_name_reuse_default.*
* When job group includes a job which was never declared, it was just
  ignored. Now it fails: job is missing.
  See changes in this test for example:
    tests/yamlparser/job_fixtures/job_group_includes_missing_job.*
    ->
    tests/yamlparser/error_fixtures/job_group_includes_missing_job.*

Change-Id: Ief4e515f065a1b9e0f74fe06d7e94fa77d69f273
2023-02-28 20:16:57 +03:00
Mateusz Rygiel 456e64513f Add properties for Gitlab trigger
Add source branch regex property for gitlab trigger
Add merge request label filtering options to gitlab trigger

Change-Id: Idbcec2952459b80b8b35133a1c4913ec195b5ff7
2023-01-27 16:26:38 +01:00
Max Trunov 0fdb576ee5 STORY: 2009994
add support triggerOnlyIfNewCommitsPushed option

Change-Id: I1e777bdd47d7cd93839c6edde6f75737972c242a
2022-04-15 10:57:34 +05:00
Eric Ball 930dd24dd2
Fix: Update sphinx version pin, fix warnings
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
2022-03-31 15:44:40 -07:00
Unpublished 7b621cf626 doc: Fix anchor link to gerrit plugin
Change-Id: I1de92c842dfcb724e5b8c7477684a754bde8a8a8
2021-12-28 18:43:57 +01:00
Fatih Degirmenci 210a70fb4a Add support for Artifactory Trigger
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
2021-10-15 16:15:24 +02: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
Eren Atas 08678825a9 Update Gerrit Trigger Plugin Implementation
The changes between plugin version 2.30.0-2.32.0 have been
implemented. Current test cases are updated, and also new
test cases are added in order to verify old version XML
output has not been altered.

Documentation uses gerrit004.yaml as an exampple, therefore,
`build-cancellation-policy` have also been implemented to
show as example.

Signed-off-by: Eren Atas <eatas.contractor@libertyglobal.com>
Change-Id: I55fb6f8dd722d50cff369a6fba0e11c96b0c08aa
2021-05-20 15:14:46 +02:00
David Aguilar 4393f8ba1a triggers/gitlab: allow setting the merge request pending build name
Add a "pending-build-name" parameter to control the pendingBuildName XML
attribute which controls the pending build name in the Gitlab merge request.

Change-Id: Iee229a047cbeef6fe842c010feb7963412667066
2021-02-19 22:46:48 -08:00
Unpublished fedd4b52ab Add Gogs Plugin
Change-Id: I0230a605fd2c3d0c8f7df2c497f3b837499f8758
2021-01-16 12:21:15 +01:00
Thanh Ha 5a98ebb8bb
Fix flake8 BLK100 and BLK999 issues
Resolves flake8 BLK related issues.

"BLK100 Black would make changes."
"BLK999 Unexpected exception: ..."

Change-Id: Ic6d4265e3d02b2f2a15ab851eaed98288c62730c
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-08-31 10:54:19 -04:00
Eren ATAS 987dbc4d2b Updated GHPRB plugin support
Implemented the following tags that have been missing:
- displayBuildErrorsOnDownstreamBuilds
- blackListCommitAuthor
- GhprbCommentFile
- GhprbNoCommitStatus

Following tags are printed when the value of the key is empty:
    - whiteListTargetBranches
    - blackListTargetBranches
    - buildDescTemplate
    - triggeredStatus
    - startedStatus
    - statusUrl
    - addTestResults

Also updated tests

Change-Id: I1e19841d88728af9ac6aa9e1c78f89fe962a583f
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
2020-07-07 11:20:46 +02:00
Eren ATAS 28e43831e9 Added topic-changed-event on triggers.py
Depends on https://review.opendev.org/#/c/731169/

Change-Id: I8d1ed67b11e1ff1fcf13325108c007d6baff07c4
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
2020-06-19 08:55:54 +02:00
Adam Romanek b04ca3a82c Gerrit Trigger: update support to the latest plugin version
The changes include:

- deprecated the following options and made support for them dependent
  on the Gerrit Trigger plugin version:
  - 'no-name-and-email'
  - 'readable-message'
  - 'trigger-for-unreviewed-patches'

- added a set of new options:
  - 'name-and-email-parameter-mode' (replaced 'no-name-and-email')
  - 'commit-message-parameter-mode' (replaced 'readable-message')
  - 'change-subject-parameter-mode'
  - 'comment-text-parameter-mode'
  all these options can have one of the following values:
  - NONE
  - PLAIN
  - BASE64
  the default value for the first two options is taken from the
  respective options they replaced, if they exist in the input YAML
  file, so the overall change should be backward compatible

- fixed the value generated for <dynamicTriggerConfiguration> element
  it should be "true"/"false" instead of "True"/"False"

- added an empty <dynamicGerritProjects> element when dynamic trigger
  functionality is disabled to match what the plugin does

With the above changes the markup generated by JJB is fully aligned with
Gerrit Trigger plugin v2.30.x. Tested on Gerrit Trigger plugin v2.30.0.

Task: 39871
Story: 2007722
Change-Id: I25800874f51a93a351926a9a1be255cce80b88bd
2020-06-01 15:39:18 +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
Christoph Erhardt 03d99c56e8 Add parameter "cancel-pending-builds-on-update" for trigger "gitlab"
When this boolean parameter is set to true, updating a merge request
cancels any pending merge-request builds.

Change-Id: Ic5ef400cf4cd088680b92bd10b88b79520795729
2020-04-16 16:56:50 +02: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
Waldemar Znoinski 2ea9841a96
Add support for noSquash (no-squash) in jms-messaging trigger
It's sometimes required to trigger a job build on every CI message.
To achieve that the XML's noSquash (jjb: no-squash) has to be set to
True.

see triggers section at:
https://wiki.jenkins.io/display/JENKINS/JMS+Messaging+Plugin

Change-Id: I389e59cca4f649379614f7f6247bf76cf4a0ba95
2019-12-13 14:38:32 -05:00
Joseph Kostreva 8c29f8931c Add Private and WIP change support for gerrit
Updated gerrit trigger support to include the new exclude private and
exclude wip changes.

Change-Id: I75d8113941e4e455ec34fab23d347816c2ef699b
2019-11-06 10:03:30 -06: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
Sergey Lebedev 314d896b83 Added missing 'filters' parameters for rabbitmq trigger plugin
Change-Id: Ide9e02c7b5a327a17521aac8d25ccff285bbd89a
2019-08-06 01:36:54 +03:00
Waldemar Znoinski 079900b4e7 add support for 'override-topic' in jms-messaging trigger
overrides->topic is now supported in the jms messaging Jenkins
plugin hence we need support it in jjb.

see triggers section at:
https://wiki.jenkins.io/display/JENKINS/JMS+Messaging+Plugin

Change-Id: I389e59cca4f649379614f7f6247bf76cf4a0ba94
2019-08-01 18:51:32 +01:00
Brian Kruger 8cb88e0304 [jenkins-job-builder] - Add support for Generic Webhook Trigger
Change-Id: Iced7c16938357a61ce566e3e0732ac2d43b0befa
2019-02-15 16:32:28 -08:00
Daniel Belenky 3806c9c3d7 Handle cancel-builds-on-update values from vars
The code assumes that the value of cancel-builds-on-update is a boolean.
This fails when specifying the value of the param in a variable because when
deep_formatter formats the data, booleans turn into strings.

Also added tests for such case.

Change-Id: Ib1ec3d5545091be550bfe023e49c7982372d5b55
Signed-off-by: Daniel Belenky <daniel.belenky@gmail.com>
2018-11-14 10:47:36 +02:00
Norbert Grünwald 1ee893d595 Add 'secret-token' parameter to gitlab trigger
This adds support for the job specific secret token in the
gitlab build trigger.

This feature was added to the "Gitlab Plugin" with version 1.4.1
(released Sep 24, 2016).
Excerpt from the changelog:
 "Add possiblity to configure secret tokens per job to allow
  only web hooks with the correct token to trigger builds."

Change-Id: Id1ede4a6a51a231f60a39bfaefbadd8f849076e4
2018-10-29 15:06:41 +00:00
Jaime Melis 56c8d33b14 gitlab-merge-request: Add support for 2.x
This patch adds support for gitlab-merge-request 2.x.

As indicated by the plugin homepage [1]:

* GitLab version < 8.1: use v1.2.4 of this plugin
* GitLab version >= 8.1 < 11: use v2.0.1 of this plugin
* GitLab version >= 11: use the latest version of this plugin

GitLab 8.1 was released on Oct 22, 2015.

[1]: https://github.com/timols/jenkins-gitlab-merge-request-builder-plugin#supported-gitlab-versions

Change-Id: I0c7618715ba3fad162bfe20819a7721e1c83ad13
2018-09-21 10:50:08 +02:00
Zuul fe6612ea7d Merge "pollurl: Utilize convert_mapping_to_xml" 2018-09-06 17:39:08 +00:00
tanhengyeow 2fba7e6058 github-pull-request: Utilize convert_mapping_to_xml
Change-Id: I8a5f3ade27d7aeba8054c814ad0dc2bf7993dd42
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-31 22:56:55 +08:00
tanhengyeow 0586d9b3d3 pollurl: Utilize convert_mapping_to_xml
Change-Id: I2d14f0c714e42c268d6fc411355a61347f89934f
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-31 22:12:45 +08:00
Thanh Ha 059fd49f3d [Triggers] Update helpers import to common style
Change-Id: Ic9f6791ab7b701e160a7d8b8ff20fe0615d222a4
Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-07-24 20:27:44 +08:00
Zuul 2801467eb9 Merge "ghprb: blacklist-target-branches support" 2018-07-17 17:03:46 +00:00
tanhengyeow f7d5ef5617 Refactor ivy function in triggers.py to utilize convert_mapping_to_xml
Refactor the code in the function to utilize convert_mapping_to_xml.

Change-Id: Ic62b5cc60d260f9f4820c4260f69771e1f8589ba
2018-07-08 22:47:35 +08:00
Gerard Ryan 70f7ef2291 ghprb: blacklist-target-branches support
Change-Id: I27f49f25d97c810904cb107042380b9e7bb7fd42
Co-Authored-By: Kien Ha <kienha9922@gmail.com>
Signed-off-by: Kien Ha <kienha9922@gmail.com>
2018-07-03 18:26:27 -04:00
Zuul 29f3458e27 Merge "Update BuildResultTrigger plugin" 2018-06-21 17:40:19 +00:00
Sorin Sbarnea 4f7b6ee568
upgrade hacking module
- upgrades hacking to current version
- sorts new linting issues
- sorts bug with sys.reload on py3

Change-Id: I4a18abc93116667a2733e8aec619ac59ea73d630
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-06-19 18:04:37 +01:00
Kien Ha c2db4e9204 Update BuildResultTrigger plugin
- Add full and minimal tests
- Set plugin tag

Change-Id: Ibac51be8cd298bca0c6e8005182b59806d266e51
Signed-off-by: Kien Ha <kienha9922@gmail.com>
2018-05-31 18:00:12 -04:00
Zuul f230b8de76 Merge "Handle string skip-vote parameters in gerrit trigger" 2018-05-31 18:42:13 +00:00
Ken Dreyer 59a0419e30 triggers: correct name of JMS Messaging Plugin
The plugin's name is "JMS Messaging Plugin", and "Pipeline Plugin"
appears to be a bad copy & paste from elsewhere.

Change-Id: I3b955304fd671a95110679947228a5728480bb0e
2018-05-31 10:22:50 -06:00
Daniel Watkins 1d90d0d5ba Handle string skip-vote parameters in gerrit trigger
Prior to this commit, the code assumes that the parameters given in the
YAML will parse as Python bools.  This fails when, for example, the
string "false" is given.

Change-Id: Ia7d0f5954929d13acc268f878ce992808b258a12
Story: 2001466
Task: 6183
2018-05-30 17:00:54 -04:00
Jeremy Phelps 6244fd032a Add support for setting file paths to trigger on
- include minimal and full tests

Change-Id: Ic78c87c3e4388bb124414725bb2da2b406fb5269
Co-Authored-By: Kien Ha <kienha9922@gmail.com>
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
Signed-off-by: Kien Ha <kienha9922@gmail.com>
2018-05-21 16:51:43 -04:00
Luca Pierri 8a11186abd fixed spelling errors
Change-Id: I1cc959265010af590cdc667a4c86dce1fec866b0
2018-04-20 22:40:53 +02:00
Luca Pierri 3264b244b5 fix spelling errors
Change-Id: I42b6bb46a9e5574f88ec5c0cb5726a65353a4fd7
2018-04-16 23:57:41 +02:00
Zuul c1a73eb7cc Merge "gitlab trigger: add support for different MR events" 2018-04-13 10:54:09 +00:00
Yolande Amate e55b3d408c
Add support for jira-changelog trigger
Change-Id: Ib66ed6ed2cc0ae909baf8657e122c8c4d3e42331
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-04-12 18:42:20 -04:00
Evgeni Golov 2fca24be21 gitlab trigger: add support for different MR events
also add tests for branch-filter-type on < 1.2.0 to make Zuul happy :(

Change-Id: Ia0aa807e1139bacc3e808b6bdc9680648b596275
Signed-off-by: Evgeni Golov <evgeni@golov.de>
2018-04-12 19:42:21 +00:00