Commit Graph

65 Commits

Author SHA1 Message Date
Michal Szelag 429118b487 Fixing ignore-tags-newer-than inverted with ignore-tags-older-than.
Also fix test Scenario name.

Story: 2004614
Task: 28518

Change-Id: I0d0f633ffa4d10f4d1491589dc9da69ae9d3f463
2023-12-17 13:10:49 +03:00
Vsevolod Fedorov 60e8395c62 Add source location and context to error messages
Change-Id: I2e955c01b71a195bb6ff8ba2bb6f3a64cb3e1f58
2023-04-04 13:35:42 +03:00
Piotr Falkowski cd8c8bfbb7 Added configuration for Suppress SCM Triggering
In version 2.1045.v4ec3ed07b_e4f Branch API Plugin added options to
configure suppressing SCM trigger. Previously this feature could
be only turned on or off, now it's possible to select what to suppress
and on which branches.
(see https://github.com/jenkinsci/branch-api-plugin/pull/244)

This commit adds support for this option by allowing dictionary syntax
for `suppress-scm-triggering` element:
  ```
  - suppress-scm-triggering:
      suppression-strategy: suppress-branch-indexing
      branch-regex: ^.*test.*$
  ```
while preserving support for currently existing syntax:
  ```
  - suppress-scm-triggering: true
  ```

Change-Id: I5d0b32042fc07d674bf2f26e5b468f051077fb02
2023-03-30 13:17:39 +02:00
Piotr Falkowski 5cea04aa2a New permissions option for GitHub PR Comment Build plugin
In version 78.v2dcf62ba199b GitHub Pull Request Comment Build Plugin
introduced permissions check for users triggering jobs with comments.
This added a new checkbox/XML element that allows untrusted users to
trigger builds.
(see https://github.com/jenkinsci/github-pr-comment-build-plugin/pull/46)

This commit adds support for this option by allowing dictionary syntax for GH PR Comment Build plugin:
 ```
 - trigger-build-on-pr-review:
    allow-untrusted-users: true
 ```
 while preserving support for currently existing syntax:
 ```
 - trigger-build-on-pr-review: true
 ```

Change-Id: I554129c779161b47cba4566f7821ef7590a242e0
2023-02-27 09:07:52 +01:00
Piotr Falkowski 695872835f Support for GitHub Checks plugin
Change-Id: I0dcf84a56a26f8cccbfdcc6fe60567a4120e78f9
2023-02-09 11:32:55 +00:00
Zuul 47f99b23a2 Merge "Add support for abort-builds" 2023-01-23 10:17:24 +00:00
Zuul d9f6b1ffbb Merge "Add head-filter-regex to gerrit_scm" 2023-01-23 10:13:33 +00:00
Vsevolod Fedorov f4d64f9f66 Move tests to pytest
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.

Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
2022-12-20 10:44:43 +03:00
Johannes Carlsson 76cc236d8a Add support for abort-builds
This was added to the cloudbees-folder-plugin JENKINS-60677.

Change-Id: Iacc1afcee0355d6b60a2f4e76364b4b980da7908
2022-06-22 14:07:39 +02:00
Johannes Carlsson e064158d05 Add head-filter-regex to gerrit_scm
This makes it possible to filter branches with regular expressions
also when using the gerrit_scm.

Change-Id: Ie43674cccf942420d42e1ee4fd194db30b09d19f
2022-06-22 10:44:06 +02:00
Kristian Kraljic bf38568363 add: type-suffix for GitHub notification-context trait
Change-Id: Ibadc0de88d87df95d0319da8872c881247cd1ba6
Story: 2009995
2022-04-29 22:52:13 +02:00
Pat Long 46082807fa Extend multibranch pipeline project gerrit scm
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>
2021-09-10 10:47:03 -04:00
Andrew Reusch c362756350 Add filter-by-name-wildcard to scm_github multibranch plugin.
Change-Id: Idf65d271fd97317c80ae98c797bb57e8f9801249
2021-06-04 16:43:47 -07:00
Zuul 760d255a54 Merge "Add git submodule threads" 2021-04-10 13:47:25 +00:00
Pawel Piatek b8f0e75d34 Add git submodule threads
Signed-off-by: Pawel Piatek <xj@wp.pl>
Change-Id: I3dbc0e710460a5f55d4146cb1dd70e1ac3560e68
2021-03-18 12:39:34 +01:00
sp-ricard-valverde c1d8a41666 feat(scm): add git extension for lfs-pull
Add a missing extension to git scm which enables the option to do
"Git LFS pull after checkout"

Add lfs-pull fixtures

Change-Id: Ie8b98877f3f282ac0b32dbeb089e6d0d9ccc25c8
2021-03-16 18:29:56 +01:00
Igor Lakhtenkov 05149cf329 Added SparseCheckout trait to the git extentions
Change-Id: I01e01cf1f6c07220de7f05ae67ffee6a924f5d08
Task: #41625
2021-01-20 20:42:22 +03:00
Zuul f80afac754 Merge "Added support of SCM Filter branch PR behavior filters for multibranch projects" 2021-01-12 14:47:09 +00:00
Igor Lakhtenkov bdedf1460c Added support of SCM Filter branch PR behavior filters for multibranch projects
Change-Id: I29d1050f021d509ca021136cc90a113756cd11cf
Task: #41308
2021-01-04 12:50:11 +03:00
Anna Tikhonova c12e41844c Add refspecs trait for github SCM
Change-Id: Ibdcd5621fa1d030cda26f29cadb3ae4c3c3f3704
Signed-off-by: Anna Tikhonova <anna.m.tikhonova@gmail.com>
2021-01-02 15:25:30 +00:00
Adam Romanek 118ac858c4 tests: fix mixed imports of 'unittest.mock' and 'mock'
The 'mock' package is imported in 'tests.base'. Whenever possible
'tests.base' prefers 'unittest.mock' over 'mock' (which is the case on
Python 3.3+). Importing 'mock' together with 'unittest.mock' causes
unexpected behavior that results in exceptions when running tests, at
least on Python 3.6.12, like:

>  File "/usr/lib/python3.6/unittest/mock.py", line 1196, in patched
>    patching.__exit__(*exc_info)
>
>  File "/home/zuul/src/opendev.org/jjb/jenkins-job-builder/.tox/cover/lib/python3.6/site-packages/mock/mock.py", line 1545, in __exit__
>    return exit_stack.__exit__(*exc_info)
>
>  File "/usr/lib/python3.6/contextlib.py", line 339, in __exit__
>    received_exc = exc_details[0] is not None
>
>  IndexError: tuple index out of range

From now on, to avoid similar issues in the future, the 'mock' package
is only installed for Python 2.x.

Change-Id: Ib3044312f0770735d88d8657d1f953e5a33e771f
2021-01-01 12:58:28 +01:00
Zuul 63dbc6752e Merge "Support "All Strategies Match" and "Any Strategies Match"" 2020-11-03 15:52:45 +00:00
AnnA Tikhonova 6ddb8f7d35 Support "All Strategies Match" and "Any Strategies Match"
Support recursive build strategies from Basic Branch Build
Strategies Plugin

Change-Id: Idc1d2bc679ba489f5ef487648cca1e9044084990
Signed-off-by: Anna Tikhonova <anna.m.tikhonova@gmail.com>
2020-11-02 23:30:49 +03:00
Anna Tikhonova d80d6bf723 Support raw XML injection in multibranch build strategies
build-strategies:
     - raw:
         xml: |
           <c.i.j.p.m.b.IncludeRegionBranchBuildStrategy plugin="...">
             <includedRegions>my/cool/project/*.cpp</includedRegions>
           </c.i.j.p.m.b.IncludeRegionBranchBuildStrategy>

Change-Id: I3679c81a4a4b28204460b1563bb7585a3e67a449
Signed-off-by: Anna Tikhonova <anna.m.tikhonova@gmail.com>
2020-11-02 23:28:55 +03:00
Zuul 35457bfd1c Merge "feat: support the skip-notifications-trait plugin for git repos" 2020-09-25 07:45:27 +00:00
Giel van Schijndel c1e3807ac7 feat: support the skip-notifications-trait plugin for git repos
Change-Id: If466d36671a8d87e0543d625f5b4e5302111874d
2020-09-16 18:53:18 +02:00
Giel van Schijndel eec4770574 feat: add support for specifying the git user's identity
This gives control over who's identity gets used for newly created
commits.

Change-Id: I8ceaabdaafa2be9c4abcfea8a2afb847d01ed0e6
2020-09-16 18:48:22 +02:00
Zuul afc2b6fd42 Merge "multibranch: Add refspecs trait to bitbucket scm" 2020-09-08 13:57:43 +00:00
Matt Kucia 6367f04fcf multibranch: Add lfs pull trait to bitbucket scm
Change-Id: Ibf89cdfbfb6fc791f92a21d07442475325f46a3c
2020-09-02 12:32:25 +00:00
Matt Kucia 74d2e1302c multibranch: Add refspecs trait to bitbucket scm
Change-Id: Id0d65a89d044cbf0c7455f5c79bfaae226f74ada
2020-09-02 12:32:16 +00:00
Zuul 784a38ecc9 Merge "Implement disable discover_pr_origin" 2020-07-15 14:04:43 +00:00
Zuul 156861a149 Merge "Implement GitHub PR Comment Build Plugin" 2020-07-15 14:04:10 +00:00
Rotaru Sergey ff0ecac7c6 Implement script-id for multibranch with default.
Main feature to use multibranch with defaults project type is
build configuration mode with default groovy script
stored in global Jenkins store provided by config-file provider
plugin. Options "script-id" and "sandbox" fully implements this
feature.

Besides both project type support "script-path" and "script-id"
mode. It may be convenient to switch mode without changing project
type in order to save project history.

Change-Id: I4cd62e69c9abe7d8fc2e0dfdbe25d8b07ddf51c5
2020-06-15 13:51:13 +03:00
Sergey Rotaru 67c2decc3a Implement GitHub PR Comment Build Plugin
Added support of trigger-build-on-pr-comment, trigger-build-on-pr-rewiev,
trigger-build-on-pr-update options for multibranch project. Modified
multibranch test case to cover new options.

Change-Id: Ia8658b49e7f7806ef1a8f34de10eaee5b3b7b488
Signed-off-by: Rotaru Sergey <badwings@yandex.ru>
2020-06-14 17:19:05 +03:00
Rotaru Sergey 4e15ad0536 Implement disable discover_pr_origin
In my opinion the best choise for default value of discover_pr_origion
is not specified(None value) like it is done for bitbucket scm.
Currently there is no way to disable this option for github scm.
Added false value as one of valid value for this option, like is done
for discover-pr-fork-strategy. In fact any of yaml specification false
implementation should work.

Change-Id: Ibc26d6b5c39b5455160ba5c84be99575b79fc102
2020-06-14 12:28:10 +03:00
Luca Milanesio 9797703801 Experimental support for filterChecks trait
The gerrit-code-review-plugin v0.4.0 introduces the
integration with Gerrit Checks plugin. Introduce the option
to query for pending checks.

Change-Id: Idb3f290121aa6fbcdc25a0821c9bdc3dd03e21af
2020-01-08 21:58:12 +01:00
Luca Milanesio 8a27ad1ed1 Fix gerrit-code-review plugin name
The GerritSCMSource type for the multibranch pipeline does not
belong to the 'gerrit' plugin but rather to the 'gerrit-code-review'
plugin.

Change-Id: I5edd81a3506847c3e5910ad66d4498a2b8c899e9
2020-01-03 10:43:47 +00: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
Ivan Fernandez Calvo 073e7bb5e5
Add support for GH Custom Notification Context
Task: #35637
Story: #2006141
Change-Id: Id4bbc73a709a7cd292072ab66666bd647f0514a6
2019-07-02 12:25:34 -04:00
Chris Koehnke a90f084f93 Add 'skip-initial-build' to project multibranch
Adds support for the skip initial build option added by
https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/4.

Change-Id: I903de7605fa1f0e3ada027ada07a7972d2ca9603
2019-04-26 13:14:09 -04:00
Zuul 51e2a99d58 Merge "Adds named branches to property strategy support" 2019-01-08 16:23:54 +00:00
amit lin ff338dc948 Adds github scm multibranch regex branch filter
This commit adds the ability to filter discovered branches in a multibranch project using a regex filter.
This is done by adding a 'head-filter-regex' key in the github scm configuration inside the multibranch job yaml - it maps to a <jenkins.scm.impl.trait.RegexSCMHeadFilterTrait>
element containing a <regex> element in the resulting job.

Change-Id: I8c88a8b131cdc51d2c8abb13397637ebbf6d1373
Signed-off-by: amit lin <amitl@totango.com>
2019-01-07 18:12:29 +02:00
sbussetti cf152d67c7 Adds named branches to property strategy support
My previous submission added support for property strategy: all branches
get the same properties.  This patch adds support for the second of 2
options, "named branches get different properties", which allows for
a default definition of properties + exceptions for individual refspecs
based on their literal branch name.  Also includes some re-org of the
existing prop. strat. support in order to DRY up the code for both.

Also adds sphinx.ext.doctest to docs/src/conf.py extensions to allow for
running `make doctest` locally.

Change-Id: Icd143fe25b1e2d5c8d1e7e8b0650d91f40838043
Signed-off-by: sbussetti <steve.bussetti@gmail.com>
2018-12-10 13:44:14 -05:00
sbussetti dbbca01833 Adds support for Property Strategies
Multibranch pipeline jobs also support "Property Strategy" elements.
These are fairly limited, but do contain the very useful "Suppress
automatic SCM triggering" trait.  This commit adds support for
defining these for the "All branches get the same properties"
strategy, and could be easily amended to also support the "Named
branches get different properties" strategy in a future update.

Change-Id: I3d9281657e341260a23f357f6e247793379b0eed
Signed-off-by: sbussetti <steve.bussetti@gmail.com>
2018-11-27 09:01:20 -05:00
sbussetti 7d065af894 Adds support for Disable GitHub Multibranch Status
Jenkins2 GitHub scms default to automatically sending updates on build
status to github for pull requests.  The plugin this enables allows
control of this by enabling or disabling the feature via an SCM trait,
allowing you to either no notify at all or manually notify via other
means.

Change-Id: I4f5629c3ee8031d41054e3be5e853201d8f0fed6
Signed-off-by: sbussetti <steve.bussetti@gmail.com>
2018-11-01 09:51:37 -04:00
sbussetti dab3156465 Adds option to specify secret id for github
Same as existing bitbucket checkout-over-ssh
ssh-checkout for github must needs the option
for a user to specify the id of the secret
containing the ssh credentials to be used
for checkout.

Change-Id: I675c94c971e78d6ecd71d6f1446e0388430dab80
Signed-off-by: sbussetti <steve.bussetti@gmail.com>
2018-10-16 20:02:55 +00:00
Zuul 494f5d3cc2 Merge "Extend multibranch pipeline project scm" 2018-09-20 14:47:59 +00:00
Duncan Hutty d076675ca1 Support SSHCheckout trait
Change-Id: Ie00ad2e68a8c9100d055df220ac68bfb8f0ba184
Closes-bug: 2003749
2018-09-12 23:03:21 -04:00
trane9991 92f18515b4 Extend multibranch pipeline project scm
Add suport of available extensions from default git scm
Story #2003620
Task #25743
Change-Id: I62f8018fb49d239ab634b502e51005a1465a81d9
2018-09-12 19:37:25 +03:00
Paul Theunissen c56d688c43 Add multibranch features
Adds the following features:
* discover-pr-forks-strategy
* discover-pr-forks-trust
* local-branch
* checkout-over-ssh
* checkout-over-ssh-credentials
* filter-by-name-wildcard
* filter-by-name-wildcard-include
* filter-by-name-wildcard-exclude

Change-Id: I475086b73e1e485552279ee7ba03866d610afb07
2018-09-06 10:37:55 +02:00