Commit Graph

590 Commits

Author SHA1 Message Date
patchback[bot]
f06c872304 pr_labeler: stop adding needs_triage labels to new PRs (#643) (#647)
(cherry picked from commit e43d253f6c)

Fixes: https://github.com/ansible/ansible-documentation/issues/628
Co-authored-by: Maxwell G <maxwell@gtmx.me>
2023-10-18 12:22:08 -05:00
patchback[bot]
3d5863ef33 pr_labeler: change link to the DAWGs meeting agenda (#497) (#506)
The agenda is now housed on the Ansible Community forum.

Fixes: https://github.com/ansible/ansible-documentation/issues/411
(cherry picked from commit cad44e79ca)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
2023-10-04 11:12:01 -04:00
Maxwell G
7ce357caf8 pr_labeler: allow setting custom repo via CLI (#354)
This makes testing on a different repo easier.

(cherry picked from commit 72f4983406)
2023-09-09 09:05:52 -05:00
Maxwell G
63d324f459 pr_labeler: add nag comment for issues and PRs without description (#353) (#360)
* pr_labeler: add issue member to IssueLabelerCtx

Pull requests also support the Github issue API. This allows more easily
writing code that works with both issues and pull requests without extra
conditionals.

* pr_labeler: add dependency on jinja2

* pr_labeler: comment on PRs/issues w/o descriptions

This change adds a job to pr_labeler to leave a comment on PRs and
issues without body text.

It also includes necessary plumbing for rendering jinja2 templates and
idempotently leaving comments on issues.

Fixes: https://github.com/ansible/ansible-documentation/issues/333

* pr_labeler: improve nag comment wording

Co-authored-by: Don Naro <dnaro@redhat.com>

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
(cherry picked from commit 9e32d15f29)
2023-09-06 13:32:22 +02:00
Maxwell G
e9ea5be201 Use the new CLI docs generator from ansible-core (#220) (#225)
This tool provides a stable interface for generating RST documentation for ansible-core CLI programs.

It avoids having the docs generation process in this repo depending on ansible-core internals that are subject to change.

Relates: https://github.com/ansible/ansible/pull/81395
(cherry picked from commit 4bbb445c1f)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-08-03 20:24:54 -07:00
Maxwell G
7220c811ef labeler: retrieve author_association from event data
The Github Actions API token apparently doesn't have sufficient ACLs to
retrieve this from the API.

Fixes: https://github.com/ansible/ansible-documentation/issues/204
(cherry picked from commit feabfb631b)
2023-07-31 15:02:55 +01:00
Maxwell G
06b51f3e1c labeler: pass Github Action event data to script
This way, the script can take action based on specific events when that
data is available.

(cherry picked from commit 1f1252d356)
2023-07-31 15:02:55 +01:00
Maxwell G
c4eaf2aa9d labeler: make LabelerCtx un-frozen
This is needed so that the dataclass can have dict and other mutable
types as fields.

(cherry picked from commit 47a86baeb4)
2023-07-31 15:02:55 +01:00
Maxwell G
69e0faaceb labeler: remove global get_previously_labeled()
Using a @cached_property that's tied to the class instance makes more
sense than a global cache.

(cherry picked from commit b2ffdfc84f)
2023-07-31 15:02:55 +01:00
patchback[bot]
65a1cab7f1 Exclude internal options from man pages and docs (#192) (#198)
(cherry picked from commit efe9afccc4)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-31 10:54:04 +01:00
patchback[bot]
879596172a Fix "Edit on GitHub" links for CLI programs (#188) (#193)
(cherry picked from commit eb4dc6c59e)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-31 10:52:21 +01:00
Matt Clay
5f6ee6d61f Fix misrendered sections in manpage generation (#191)
This change fixes bugs in the manpage generator that existed since it
was first added.

It exposes CLI `ARGUMENTS` value to manpage templates.

Before this change, the code contained a typo, causing the `for`-loop
iterate over individual characters of the `'ARGUMENTS'` string rather
than iterating over a tuple. A missing comma was at fault.

The updated code gets rid of the `for`-loop and conditionals since it
seems to have been a premature complexity increase and no other things
than `'ARGUMENTS'` were ever added into the broken iterable.

The functional change is that `arguments` is now always present in the
Jinja2 context, unlike being missing sometimes because of the previous
design (not that it was ever present, because of the bug! sigh...)

The Jinja2 templates perform an `{% if arguments %}` check, letting
the template engine silently ignore the missing variable. The clause
was always falsy, meaning that the arguments section was not included
in the manpages for at least the last 6 years. With this fix, it will
be.

This patch also deduplicates calling `opt_doc_list` @ generate_man.

It was called late in the execution, more times than necessary. This
patch makes sure it happens once by putting it at the top of the scope.

It fixes rendering library and inventory in manpages.

The corresponding Jinja2 templates have blocks wrapped with
conditionals like `{% if inventory %}` and `{% if library %}` but said
variables were never injected into the context, nor were they even
deduced on the Python side of the generator. This means that the
conditional clauses were always falsy, never showing the portions of
the manpages.

The Python script has hints for how the `inventory` variable was to be
calculated, which is confirmed through the Git paleontology efforts.

The block of code that references to the `inventory` bit was
incorrectly checking a variable with a list of nested objects for the
presence of a string which was never going to work.

This patch fixes this check by verifying the CLI flag against the
correct variable containing a list of options and exposes it to the
Jinja2 templates.
It also exposes the `library` variable in a similar way.

The block displaying other binaries in Sphinx CLI docs has been
synchronized with the manpage template.
Previously, the current binary was displayed also. This patch gets rid
of the unwanted trailing comma there too.

Finally, the CLI executables list in the manpage template now reuses
the same variable as the RST template that doesn't need any
post-processing in Jinja2.
Before, it was already used in the RST template so this patch aligns
both templates to use the same logic as they got out-of-sync over time.

PR #80450.

(cherry picked from commit a84b3a4e72)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2023-07-29 08:17:32 +02:00
Maxwell G
9a740895f6 [stable-2.13] Add Github Action to label issues and PRs (#169)
* Add Github Action to label issues and PRs (#118)

* labeler: welcome new contributors

Fixes: https://github.com/ansible/ansible-documentation/issues/69

* labeler: improve logging

* labeler: add --authed-dry-run flag

Some data such as author_association is only available to authenticated API
users. This helps with testing.

* ci labeler: fix `Print event information` step (#166)

* labeler: fix log() type annotations (#165)

print() coerces any object to a str.
2023-07-25 13:00:56 -05:00
Matt Clay
be6a990a89 [stable-2.13] Remove docs dir dependency from man page build (#81003) (#81024)
* [stable-2.13] Remove docs dir dependency from man page build (#81003)
(cherry picked from commit b3f1290bcd)

Co-authored-by: Matt Clay <matt@mystile.com>

* Update path in Makefile
2023-06-09 20:29:41 -07:00
Matt Davis
2765ab6f28 Remove straight.plugin dependency (#80084) (#81020)
(cherry picked from commit f587856)
2023-06-09 17:03:11 -07:00
Felix Fontein
5c8928fa44 stable docs build: do not use YAML parsing/serialization for .deps files (#79233) (#79237)
* Do not use YAML parsing/serialization for .deps files.

* Prevent crash.

(cherry picked from commit 9545f2e0de)
2022-10-27 13:07:27 -05:00
Sandra McCann
27890cd659 Backportapalooza 06 30 (#78176)
* fixed hyperlinks to galaxy.ansible for issue #78104 (#78152)

(cherry picked from commit 4bd7e50612)

* Fix documentation with misleading data type (#78157)

##### SUMMARY
The sample value given for the 'mode' parameter is shown without quotes, but the data type is string. If you actually try to use an unquoted numeric string for this value you're in for a nasty surprise! I added quotation marks to the sample value.
##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

(cherry picked from commit 4c9385dab7)

* Update README.md (#78139)

Update Python version requirement to >= 3.8.

(cherry picked from commit 58b42abede)

* elaborate on import/include conditional example (#78138)

(cherry picked from commit 7ec84c511f)

* Update vault.rst (#78140)

(cherry picked from commit 84105e39f4)

Co-authored-by: Lewis Brogan <ilewisbrogan@gmail.com>
Co-authored-by: mlevens-hw <55262896+mlevens-hw@users.noreply.github.com>
Co-authored-by: Diana S. Cardona <89112552+Flecha21@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: jlownie <jlownie@hotmail.com>
2022-07-05 08:35:27 -07:00
samccann
f4f1f772c1 [stable-2.13] shift to ansible_core_version
(cherry picked from commit 7471c036ec)

Co-authored-by: samccann <samccann@redhat.com>
2022-05-05 12:19:07 -07:00
Felix Fontein
cad892125c [stable-2.13] Replace antsibull with antsibull-docs (#77504)
(cherry picked from commit 841bdb74eb)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-22 10:30:49 -07:00
Matt Clay
93d0ea0215 Update core porting guide generation. 2022-03-28 13:16:28 -07:00
Matt Clay
3e491db466 Porting guide fixes. (#77376)
* Update porting guide generation.
* Fix 2.13 porting guide link.
2022-03-28 11:57:10 -07:00
Cindy Park
1bdcb56249 Improve documentation to fix outdated file paths (#77341)
Co-authored-by: njthanhtrang <njthanhtrang@users.noreply.github.com>
2022-03-24 14:18:33 -04:00
Philip Douglass
e6f63be7a4 Honor --quiet parameter properly in fish shell (#77180)
* The `^` stderr redirection is deprecated
* Setting `-q` for `setup.py` in `gen_egg_info` is redundant
2022-03-05 07:04:54 +10:00
Brian Coca
9a4ff01a4f Cleanup of cannned responses (#76689)
* removed those made obsolete by bot
 * tried to rephrase to be more informative and require less updates in the future

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2022-02-04 10:37:53 -05:00
Pascal Höhnel
7cd94dd452 Fix unsafe handling of variable PYTHON_BIN (#76767)
The previous state lead to errors, when cloning the repo to a path with spaces in it.
2022-01-18 16:13:33 +01:00
Matt Clay
bb63c97c16 ansible-test - Update import test and sanity requirements. (#76308)
* Add script to freeze sanity requirements.
* Declare sanity test requirements and freeze
* Use pinned requirements for import.plugin test.
* Expand scope of import test for ansible-core.
* Add ignores for galaxy import errors.
* Update test-constraints sanity test.
2021-11-16 18:16:42 -08:00
Matt Martz
66a83314b9 Modernize install (#76021)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-10-19 14:24:57 -05:00
Matt Martz
96b221b344 Update vendored copy of distro to 1.6.0 (#75732)
* Update vendored copy of distro to 1.6.0

* copy pasta mistake

* ci_complete
2021-09-22 11:43:25 -05:00
Matt Martz
208014422d Fix markdown links that were errantly formatted as rst (#75697) 2021-09-14 10:15:37 -05:00
Sam Doran
5af0420cab hacking - account for job names that contain separators (#75454)
Some job names contain '/' which causes the download job to fail.

Example job name: `Post-job: Checkout ansible/ansible@refs/pull/75445/merge to ansible.log`
2021-08-11 20:33:23 -07:00
Matt Clay
a5b0626176 Cleanup hacking scripts to prepare for pylint update. (#75474)
* Use generator in get_recent_coverage_runs.py
* Use from import in test-module.py
2021-08-11 13:18:40 -07:00
Toshio Kuratomi
a901ff2bc0 Allow docs-build to use a local ansible-build-data checkout.
This is useful for testing the effects on docs of changing what
collections are in a version of ansible.  ansible-build-data can be
cloned locally, modified, and then build-ansible.py docs-build can be
told to use the local checkout instead of the canonical one on github.
2021-07-08 22:54:24 -07:00
Sam Doran
93e72c96f0 Update hacking env_setup to prefer Python 3 (#75213)
* env_setup - Prefer Python3

Prefer the 'python3' executable over 'python'.

* Add shebang for syntax detection

While the script isn't executable and we recommend sourcing it, having a shebang allows
variuos text editors to detect that it is a shell script and apply proper syntax highlighting.
2021-07-08 15:14:34 -04:00
Felix Fontein
47c50c38bb Use antsibull-docs devel for devel docs (#74988)
* Require antsibull 0.34.0.
* Remove Makefile comment about the devel docs building only the core
(formerly base) docs; the behavior was updated in ccbfdec334
Currently 'make coredocs' builds core-only docs; 'make webdocs' builds the full docs even on the devel
branch

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-06-23 14:31:13 -05:00
Felix Fontein
e6a7bc854c Only consider directories which do have .deps files other than ancestor.deps. (#74987) 2021-06-15 14:35:34 -05:00
Toshio Kuratomi
80e7e1a17c Due to the takeover of freenode we're moving to a different irc network. (#74775)
* Due to the takeover of freenode we're moving to a different irc network.

* Our channels updated to point at the same channel name on libera.chat
* Some links went to webchat.freenode.net.  At this time, libera.chat
  doesn't point you to an official webchat client so I changed these to
  https://libera.chat. (kiwi irc does work with libera.chat so that
  could be another option).
* In general, I used the name irc.libera.net for link names and
  https://libera.chat for link targets.  This is because the irc service
  is hosted on irc.libera.chat but the project web server is hosted on
  libera.chat.  (This appears to also be true for freenode but we were
  using http://irc.freenode.net which doesn't seem to work.  Oops).
* Removed http://irc.freenode.net from the linkcheck exceptions.
  linkcheck was actually correct to flag that as invalid (should have
  been http://frenode.net instead).

* Looks like hte important people in #yaml are now in libera.chat

* Link to where contributors should get help

Add a link target and then link to where contributors should get support
for developing groups of modules.

* Update docs/docsite/rst/dev_guide/developing_modules_in_groups.rst

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-01 08:48:09 +01:00
Matt Martz
8d1cf7f266 Vendor distutils.version (#74644)
* Vendor distutils.version

* Fix import order. ci_complete

* remove distutils warning filter

* Don't remove warnings filter from importer

* ci_complete

* Add pylint config for preventing distutils.version

* Add changelog fragment
2021-05-11 12:33:51 -05:00
Matt Clay
c48f80d062 Rename hacking/shippable to hacking/azp.
References to Shippable were changed to Azure Pipelines.

Also remove rebalance.py as it does not work with Azure Pipelines due to the required data not being present.
2021-05-05 17:21:14 -07:00
Alexander Sowitzki
26214788ee Retrofit shippable scripts to work with AZP
Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-28 09:43:41 -07:00
Matt Clay
ecc5a53288 Update default containers to 3.4.0. (#74415)
* Update default containers to 3.4.0.

The 3.4.0 containers use Python 3.6 (the system Python) for `/usr/bin/python3`.

Python 3.9 continues to be the default Python version selected by `ansible-test` for these containers.

* Fix shebang on build-ansible.py.

Using `python` instead of `python3` allows `ansible-test` python interception and requirements install to function.
2021-04-25 21:25:32 -07:00
Ikko Ashimine
176beddb3f Fix typo in incidental.py (#73737)
successfull -> successful
2021-03-01 17:37:58 +05:30
Sandra McCann
ccbfdec334 Split Ansible docs from core docs (#73616)
* excludes scenario guides from core docs, splits porting guides and roadmaps, symlinks indices to create index.html pages, and adds .gitignore entries for conf.py and the toplevel index.rst files generated by the docs build

This solution builds three types of docs:
* ansible-2.10 and earlier: all the docs.  Handle this via `make webdocs
  ANSIBLE_VERSION=2.10`
* ansible-3 and later: a subset of the docs for the ansible package.
  Handle this via `make webdocs ANSIBLE_VERSION=3` (change the
  ANSIBLE_VERSION to match the version being built for.
* ansible-core: a subset of the docs for the ansible-core package.
  Handle this via `make coredocs`.

* `make webdocs` now always builds all the collection docs
*  Use `make coredocs` to limit it to core plugins only
*  The user specifies the desired version. If no ANSIBLE_VERSION is specified, build plugins for the latest release of ansible
 
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2021-02-17 09:57:05 -06:00
Brian Coca
1202dd000f Allow restricting config values to enumerated list (#73162)
* Allow restricting config values to enumerated list
* dont document internal entries
* also ignore private defs for ansible-config
* remove invalid value from tests
* added porting entry
2021-01-14 15:11:30 -05:00
Rick Elrod
7f0eb7ad79 [facts] Differentiate CentOS vs CentOS Stream (#73034)
Change:
- On CentOS Stream, make distribution_release be "Stream"
- On CentOS Core, it continues to be "Core"
- Implement custom distribution file parser for CentOS, so we can look
  for "CentOS Linux" and "CentOS Stream"
- Two new fixtures introduced (CentOS Linux 8.1 and CentOS Stream 8)
- Removed two dicts from `Distribution` class that were seemingly not
  used anywhere.

Test Plan:
- ci_complete
- New test fixtures

Tickets:
- Fixes #73027

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-13 17:54:04 -05:00
Vincent Bernat
4afc228108 hacking: replace use of "which" with "command -v" (#71278)
"command -v" is the POSIX compliant way to get the path to a command.
It returns the path to the command if it exists and exits with a
non-zero status when it does not, without any output. "which" is not
POSIX and it can have various different effects. With Zsh, it says
"python not found" on stdout.

See:
 - https://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
2020-08-18 11:31:28 -04:00
Toshio Kuratomi
22d2c97b81 Updates to docs build for new antsibull CLI
* --ansible-base-cache renamed to --ansible-base-source
* _acd_version in the .deps file has been renamed to _ansible_version
2020-08-14 13:01:29 -07:00
Toshio Kuratomi
37a7485ac8 Fix version comparison for determining what ansible to build against
* The version comparison for determining what ansible package to build
  docs against was comparing the version number for ansible-base but it
  needed to check the version number for ansible instead

* add a comment about some bad logic than needs to be fixed after 2.10.0
2020-08-07 07:59:59 -07:00
Rick Elrod
75e8da0950 hacking: fix announce script version parsing (#71008)
Change:
- Fix a bug where rc/beta versions throw off the "is this an
  ansible-base release"? check.

Test Plan:
- Used it for 2.10.0rc4

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-30 21:28:43 -05:00
Rick Elrod
34f18a97f4 Add ansible-releases@redhat.com to announce template (#70812)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-22 11:08:32 -05:00
Abhijeet Kasurde
4f96f9826c distribution: Add support for DragonFly (#70748)
partially fixes #43739

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-21 13:47:11 -04:00