Commit Graph

227 Commits

Author SHA1 Message Date
Vsevolod Fedorov 137586d548 Fix changelog formatting
Change-Id: I6e2bbff49479e8cd6561f78736e88bb7021fa8c0
2024-03-26 09:45:37 +03:00
Vsevolod Fedorov 1ead727a2d Story 2011049: Add --force flag to update-all command
Without it, using this command in scripts is impossible.

Change-Id: Ifd44fe0171a7753c9a09e9b05047ce2965c183f3
2024-03-25 13:08:25 +03:00
Vsevolod Fedorov eb08e60765 Story 2011049: Delete also old views when --delete-old option is specified
Improve 'update' command to handle old views also, not just jobs.

Task: 49601

Change-Id: I60431f662d5a69c084b2698d08104a1524d02767
2024-03-25 12:47:40 +03:00
Vsevolod Fedorov 1f320ad9f9 Do not delete unmanaged jobs when --views-only option specified
Change-Id: I54e4d62db56824bfa020bbc1a711b95a5b15fcc5
2024-03-25 12:20:43 +03:00
Vsevolod Fedorov e9a7e4ef32 Update changelog
Change-Id: Id304f62bec331360e6c0d556237ff16b169441ba
2024-03-25 11:34:04 +03:00
Vsevolod Fedorov e5f77255a2 Macro now can define defaults for parameters
Change-Id: Idc6688a76b80b904d24ff537a3df514b6d24b700
2024-03-19 11:44:08 +03:00
Vsevolod Fedorov fb913725e2 Macro now use parameters from defaults
Also fix error message for missing defaults.

Change-Id: I5d912c2bfb607c8388010ac6e39780be93073f5a
2024-03-19 11:39:37 +03:00
Vsevolod Fedorov 97bc4e69cf Update documentation on Macros
Change-Id: I177a3eea4b4f9732934bb861c02c5f7781ee6d7e
2024-03-14 12:47:25 +03:00
Vsevolod Fedorov f6e2b405c4 Add changelog to documentation
Change-Id: I5f80960649e6d6f977a579d90b860e8285fd4048
2024-02-22 12:55:18 +03:00
Vsevolod Fedorov 18efe5066b Unify variable and tags expansion inside jobs and macros
Expand variables inside macros without parameters and jobs
the same way as they are expanded inside macros with parameters
and job templates.
Make tags behave inside macros without parameters and jobs
the same way as they are expanded inside macros with parameters
and job templates.
Update or fix affected tests.

Story: 2010588
Story: 2010963
Story: 2010535
Task: 47394
Task: 49069
Task: 47151

Change-Id: Ie05ae6aa386c62ebbf68dd3e2c7001a4e444a47a
2024-01-19 12:31:42 +03:00
Vsevolod Fedorov c1ac0e03d6 Story: 2010984 Fix folder tests and defaults for folders
Folders was not actually tested by tests. Fix tests and add more tests.
Fix bug in code unearthed by now-working tests: defaults were not checked
for job folders.

Task: 49188

Change-Id: I922af7a28b0ec0c99ef3f8a17b3d5a9c10f2dce0
2023-12-04 10:51:55 +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
Thomas Bechtold 7c5300459d doc: add current year to documentation
That way, it's clear that the doc is not from 2012 and feels
outdated.

Change-Id: I63029c7b100ddfe41cd1ac242d57d5f8a41515eb
2023-02-28 11:37:02 +01:00
Vsevolod Fedorov 6b92807cd7 Tests: Rename yamlparser tests and fixture directories
Rename fixtures directory to job_fixtures to prepare for adding view_fixtures
directory in the following commits.

Change-Id: Ic20997cae020b542ddc22bf444fa6b92fbcae064
2023-01-26 11:06:23 +03:00
Vsevolod Fedorov 09f5e0362c Update documentation, tox environment
Python 2.7 is no longer supported.

Change-Id: I35d9c24d493dea254a823cce528e9fc482d9f4cd
2022-07-14 10:47:30 +03:00
Zuul 1980ca2271 Merge "add list command reference" 2022-05-03 13:19:22 +00:00
Donghui Wang 72bddfedbb update pip install cmd when install jjb from source
Change-Id: I77d00710c0b99765204aa116e404585b3fd27e5f
2022-04-30 23:18:41 +08:00
Donghui Wang eca2e713a5 add list command reference
Change-Id: I8c55a4a9dd562da0f182891ab54f3e33070ba396
2022-04-30 16:44:32 +08:00
Zuul 6001ebc28f Merge "update the heading level of execution.rst" 2022-04-29 17:23:40 +00:00
wangdonghui 3c0d09e353 update the heading level of execution.rst
The heading level of 'Recursive Searching of Paths' and 'Excluding Paths' should be below 'Running'.

Change-Id: I9069b2c205e0dfc945855ea5d7bff02149e1cd51
2022-04-28 10:43:38 +08:00
Zuul 5e66a5fbea Merge "Bumping black to 22.3.0" 2022-04-27 14:37:33 +00: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
Jiri Podivin 352b93d586 Bumping black to 22.3.0
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
2022-03-31 09:27:41 +02:00
Fatih Degirmenci 471483029e doc: Fix links to yaml spec
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
2021-10-13 21:58:58 +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
Matthieu Baerts 71cbf4399e
doc: fix link to YAML spec
It looks like the YAML specifications are no longer available in:

  yaml.org/spec/1.2/spec.html

but in:

  yaml.org/spec/1.2/

See:

  $ curl https://yaml.org/spec/1.2/spec.html
  <meta http-equiv="refresh" content="0; url=https://yaml.org/spec/1.2/" />

Update these links to avoid errors reported by jjb-tox-docs-linkcheck.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Change-Id: Ie928adf2e4c321e900bfbf36c19ae34a3dc7311d
2021-08-31 18:18:48 +02:00
Eric Ball a833d1fde6
Feat: Add GitHub Organization job type
This adds a job type "githuborg", which creates multibranch pipelines
for all repos in the org that contain the specified Jenkinsfile.

Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I148e2300f3b1ee148b51d25a2a805ed0b5a97862
2021-07-09 16:46:11 -07:00
John Fragoulis c4c49cd8da
Update docs to reflect query_plugins_info default
Commit 30d61a21e8 changed the default but
missed updating the documentation to mention that it is False by
default. This update resolves the documentation mismatch.

Change-Id: Ibe2c31d7e9ca0380efe0e6ef5014c05f1c42eae8
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2021-04-10 09:43:10 -04:00
Jiri Tyr 0f9dd4e805 Adding view for the Delivery Pipeline Plugin
Change-Id: I8a9a71267562734b078b7260c79d299db7fb4e2b
Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
2020-02-07 17:35:13 +00:00
Zuul a3dc53b381 Merge "Ignore py:obj warnings and fail on warnings" 2020-02-07 16:17:45 +00:00
Mattia Rizzolo d69208c0c4
Fix some typos in documentation
Change-Id: I67d82228bb37b8b4634c07e76a421964e227c3cb
Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2020-02-03 23:46:57 +01: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 197226c538
Fix links causing redirects
Some links have been permanently redirected to a new URL so
adjust the links to go directly to the new URL.

Change-Id: I900091f8bdc39aa5fd06eae04a9b18ef23add8f2
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 18:23:25 -05:00
Thanh Ha ee706cbdf1
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 publishers that have a relevant plugins.jenkins.io URL
documentation link.

Change-Id: I94448d04f2b28fbf3befde2e49c76d196e352d7e
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 13:13:26 -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
Jan Zerebecki 587740ec75 Support nested views
Change-Id: I13532a16efc6e970ab5a7c021ec4d77be98d3de8
2019-10-24 14:27:34 +02: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
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 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
Anil Belur 9399b1f986
Add config options --jobs-only and --views-only
Add options --jobs-only and --views-only to job_builder
section in config file.

By default JJB updates both jobs and views. Some cases
non-admin users are not allowed to update views on Jenkins
which requires explicity using -j flag.

Allow users to set a config option 'update=jobs|views|all'
in the 'job_builder' section implicitly use --jobs-only or
--views-only and control these flags from the config file.

Note: CLI options takes precedence over the config file.

Change-Id: I2a94e5a2d671ccbfc505de2f19b578ecfef9e9d7
Co-Authored-By: Thanh Ha <zxiiro@linux.com>
Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Thanh Ha <zxiiro@linux.com>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-09-19 02:24:05 +05:30
Thanh Ha ce040d8ad6
Document practical use case for variable defaults
Took inspiration from my StackOverflow reply here
https://stackoverflow.com/questions/50177308 to document a practical
use of setting variable defaults and inheritenence.

Change-Id: I45934341d3ff3fbf4ff711a435924197d2f12712
Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-09-06 18:07:10 -04:00
Sorin Sbarnea 4953756c27
adopt pre-commit hooks
Change-Id: I98bc0b5717c3921b35e74f53c55f896427880a84
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-07-12 13:40:38 +01:00
Sorin Sbarnea c2781e670f
Normalize newlines at end of file
Preparatory move for adopting pre-commit hooks.
Shoudl only remove newlines and spaces at end of files.

Change-Id: Ia33679467c533722b9308f7e7b74be395c926428
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-06-29 16:07:06 -04:00
Vicky Chijwani 75d78b6540 Add retain_anchors config option.
If set to True, YAML anchors can be referenced across files, allowing jobs to be
composed from bits of YAML defined in separate files. False by default.

Story: 2000338
Task: 2547
Change-Id: I034ce3bce0030093cb8d4266dabbdb06d96306d6
2018-05-31 20:30:09 +05:30
Zuul 18bf3239c0 Merge "Add support for view-templates" 2018-05-23 07:41:50 +00:00
Anushka Bhandari a77d29dcd5 Fix a typo in doc
Fix correct link to CloudBees Folders Plugin
Add missing comma in line 1290 of module wrappers

Change-Id: Idb0311064945965c58c0cc608fc6cab00eef3ee9
2018-05-19 13:47:59 +00:00
Zuul 96f112e915 Merge "Document use of | character for variable defaults" 2018-04-25 15:46:57 +00:00
Luca Pierri 3264b244b5 fix spelling errors
Change-Id: I42b6bb46a9e5574f88ec5c0cb5726a65353a4fd7
2018-04-16 23:57:41 +02:00
Thanh Ha 90663ea8a6
Document use of | character for variable defaults
Change-Id: Id20fc7a49fef6684170a73834f2df06db3f0ca7f
Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-04-13 13:38:07 -04:00
Thanh Ha 418e7c628d Add support for view-templates
Allow views to also be configured via templates similar to
job-templates.

This adds a new project key called "views" and parser type called
"view-template" allowing the user to add custom views.

Example:

- view-template:
    name: '{name}-template-{seq}'
    description: 'testing view templates feature'
    view-type: list
    regex: 'test-view-.*'

- project:
    name: 'test-view'
    views:
        - '{name}-template-{seq}'
    seq:
        - a
        - b
        - c

Change-Id: I6eb225f24bc3c7d790c7dcab6391735c579ac71a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2018-04-12 19:42:31 +01:00