Commit Graph
47 Commits
Author SHA1 Message Date
Sviatoslav Sydorenko (Святослав Сидоренко)andGitHub f7766cf843 Trim selinux_policytype @ integration tests (#84136)
The shell command sometimes prints a trailing whitespace which breaks
the tests on old RHELs. This patch is supposed to fix that.
2024-10-18 09:25:40 -07:00
Sviatoslav Sydorenko (Святослав Сидоренко)andGitHub 59b3e49d70 Stop suggesting easy_install in hacking (#83909)
It's been discouraged for the past decade. And CPython actually ships
with pip nowadays, that is bundled within the built-in `ensurepip`
stdlib module.
2024-09-06 17:13:06 +02:00
Sviatoslav Sydorenko (Святослав Сидоренко)andGitHub 0d5460df16 🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627) 2024-07-19 16:22:33 +02:00
Sviatoslav Sydorenko (Святослав Сидоренко)andGitHub 5d15af3a95 Split the unified PR template into few (#82734)
Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
2024-03-07 22:22:05 +00:00
Sviatoslav Sydorenko (Святослав Сидоренко)andGitHub 386edc666e Add macOS 14.3 to CI and ansible-test
Additionally, this patch takes care of installing GPG within the
`ansible-galaxy-collection` test when running under macOS 14 and higher.

PR #82697

ci_complete
2024-02-16 21:26:16 +01:00
Sviatoslav Sydorenko (Святослав Сидоренко)andGitHub a3e5546e43 🔥 Exterminate __builtin__ import from tests (#82569)
This patch removes an import fallback that was only executed under
Python 2. Now that we don't run tests against that runtime, it
generates an uncovered line. Dropping it will slightly increase the
coverage metric as a side effect.
2024-01-19 14:33:25 +01:00
Sviatoslav SydorenkoandGitHub dd0138ba21 🧪 Replace GitHub SVN integration test with local TLS (#82334)
* Run svn integration test locally with TLS

This patch uses a `trustme` to make an ephemeral CA, and server, and
client TLS artifacts for testing. These are integrated into the Apache
web server via it's `mod_ssl`.

Resolves #82207

* Replace GitHub SVN HTTPS URL w/ localhost over TLS

This change gets rid of the need to use GitHub, which is just about to
drop support for SVN [[1]]. Moreover, it eliminates the need to use
external network for any SVN commands in the test.

[1]: https://github.blog/2023-01-20-sunsetting-subversion-support/
2023-12-06 17:10:56 +01:00
Sviatoslav SydorenkoandGitHub d2ba76c117 Remove Python < 3.5 selectors fallbacks (#81872) 2023-10-11 08:36:20 -07:00
Sviatoslav SydorenkoandGitHub 46623b0a96 Deprecate pycompat24 (#81896) 2023-10-10 12:00:05 -04:00
Sviatoslav SydorenkoandGitHub 350a394185 Remove Python 2 importlib.import_module compat (#81879) 2023-10-10 11:52:47 -04:00
Sviatoslav SydorenkoandGitHub ec265ec08a Bump coverage.py to v7.3.2 in ansible-test (#81844) 2023-10-02 20:45:57 +00:00
7662a05085 Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree
PR #81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c345b, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-09-20 16:35:54 +02:00
Sviatoslav SydorenkoandGitHub c59bcbe627 Bump coverage.py to v7.3.0 in ansible-test (#81077) 2023-08-30 08:58:45 -07:00
b6ebb9d41a Replace reboot_command integration test with unit tests (#78956)
Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-13 19:26:21 +02:00
Sviatoslav SydorenkoandGitHub 796d41ff18 Bump azure-pipelines-test-container to v4.0.1 @ CI (#80916)
This patch updates the test container used in CI to the new v4 that
defaults to using Python 3.10 and is based on Ubuntu 22.04 Jammy[[1]].

[1]: https://github.com/ansible/azure-pipelines-test-container/pull/17
2023-06-12 09:23:03 -07:00
Sviatoslav SydorenkoandGitHub 42ca0803a1 Bump azure-pipelines-test-container to v4.0.1 @ CI (#80916)
* Bump azure-pipelines-test-container to v4.0.1 @ CI

This patch updates the test container used in CI to the new v4 that
defaults to using Python 3.10 and is based on Ubuntu 22.04 Jammy[[1]].

[1]: https://github.com/ansible/azure-pipelines-test-container/pull/17
2023-06-12 09:22:35 -07:00
Sviatoslav SydorenkoandGitHub 2b6d5536d7 Fix docstrings RST markup in ansible-console CLI module (#80719)
* 📝🐛 Fix RST list @ `ansible-console` manpage

Said CLI entrypoint docstring is used to construct the corresponding
manpage. `docutils` were producing the following warning with the
current RST markup used there, as follows:

  :36: (WARNING/2) Bullet list ends without a blank line; unexpected unindent.

This change puts a portion of the first list entry on a separate line
which allows the RST parser stomach it without any problems and
produce correct output without gibberish in it.

* 🎨📝 Use RST inline code @ ansible-console doc

The single backtick syntax was causing things to be interpreted as
italics text. The inline code needs double backticks.
2023-05-04 11:15:31 -05:00
Sviatoslav SydorenkoandGitHub a84b3a4e72 Fix misrendered sections in manpage generation
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.
2023-04-08 14:04:59 +02:00
88a380c8f0 📝 Document macOS user deletion over SSH (#80358)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-04-06 18:08:24 +01:00
Sviatoslav SydorenkoandGitHub a45dd2a01c 🐛📝 Undouble trailing colon @ faq.rst (#80359)
It is causing parsing/representation problems of the following
explicit RST code block.
2023-03-30 12:20:38 -07:00
Sviatoslav SydorenkoandGitHub eebfd71a6d Make PEP 517 mutation tests use pinned old setuptools (#80262)
* Pin setuptools to lowest supported @ PEP 517 test

This allows catching the behavior of builds under old setuptools.

* Stop invoking `setup.py install` in tests

This is not the part we care about since it involves dealing with the
external runtime dependencies rather than building our source
distribution.
2023-03-20 14:53:13 -07:00
7097df3eed 📦 Switch sdist build-system to pure setuptools (#80255)
This patch modifies the in-tree build backend to build sdists that swap
out pointers to it in the `pyproject.toml`'s `[build-system]` section.

The effect of this is that the first build from source (for example,
from a Git checkout) uses our PEP 517 in-tree build backend. But the
produced tarball has `build-backend` set to `setuptools.build_meta`
which is the native build backend of `setuptools`. So any following
builds from that sdist will skip using the in-tree build backend,
calling the setuptools' one.
The good news is that if the first build generated the manpages, they
will be included and won't go anywhere even though, a different build
system is in place.

Combined with #80253, this will make sure not to modify the current
source checkout on that first build.

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-20 12:01:16 -07:00
Sviatoslav SydorenkoandGitHub 888abf5d6e Make isolated source changes @ PEP 517 backend (#80253) 2023-03-20 11:26:53 -07:00
Sviatoslav SydorenkoandGitHub 701f8852ec Revert "🧪 Switch macOS 13.2 to 12.0 in CI (#80145)" (#80156)
This reverts commit 326e70c02a.
2023-03-07 23:13:42 -08:00
Sviatoslav SydorenkoandGitHub 326e70c02a 🧪 Switch macOS 13.2 to 12.0 in CI (#80145)
* 🧪 Switch macOS 13.2 to 12.0 in CI

The former revealed unexpected flakiness while the latter is the
previous value that was used to be stable. This is a temporary revert.

* Skip lookup_url integration test under macOS 12.0
2023-03-06 14:55:12 -08:00
Sviatoslav SydorenkoandGitHub 8fec2d2a82 Add macOS 13 to CI and ansible-test (#79508)
*  Add macOS 13.2 to `ansible-test`

* 🧪 Replace macOS 12.0 with 13.2 in the CI matrix

* Skip `lookup_url` under macOS 13.2

This is due to https://wefearchange.org/2018/11/forkmacos.rst.html
that manifests itself as follows:

    TASK [lookup_url : Test that retrieving a url works] ***************************
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in t
    he fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
    ERROR! A worker was found in a dead state

* 📝 Extend ansible-test change note w/ macOS 13.2
2023-03-03 04:30:30 +01:00
Sviatoslav SydorenkoandGitHub 82ff7efa94 Fix how/what+look/like grammar in dev process doc (#76410) 2021-12-02 11:37:44 -08:00
392b16c21c Test integration of loop and until options (#44927)
Ref #44741
Ref ansible/proposals#140

* Replace select filter with a more portable thing
* Add context
    This is needed for split controller/remote

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-11-30 10:11:27 -05:00
Sviatoslav SydorenkoandGitHub d75d9443fc Bump sphinx_ansible_theme to v0.7.0+ (#75059)
This version relies on an external lib implementing lexers and styles.
That lib pulls in proper Pygments version so this patch also drops it
from direct requirements.
2021-06-29 10:23:04 -05:00
Sviatoslav SydorenkoandGitHub 346c7a765d Use sphinx_ansible_theme Sphinx theme in docs (#74318) 2021-06-08 14:38:23 -05:00
9f002d9f60 📝 Make issue forms verbose and helpful (#74185)
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Sloane Hertel <shertel@redhat.com>
2021-04-13 15:52:03 +02:00
Sviatoslav SydorenkoandGitHub 1d5110db6f Unify additional info + WYSIWYG as optional input in the documentation report issue form (#73796) 2021-03-09 20:55:14 +01:00
fca85db56a Convert markdown issue templates into issue forms (#73751)
* Convert markdown issue templates into issue forms

* Limit allowed issues to the form based ones

* Title-case the form field labels

Co-authored-by: John R Barker <john@johnrbarker.com>

* Remove CoC checkboxes from the forms

Co-authored-by: John R Barker <john@johnrbarker.com>
2021-03-03 11:53:33 +00:00
Sviatoslav SydorenkoandGitHub c22bc46cb9 Mention ansible-core @ "Release and maintenance" (#73612) 2021-02-22 19:07:25 -06:00
Sviatoslav SydorenkoandGitHub f327e65d11 Use iskeyword and str.isidentifier for "is FQCN" (#73279)
* Use valid FQCN in test_verbosity_arguments

* Use iskeyword and str.isidentifier for "is FQCN"
2021-02-11 18:23:57 -08:00
6f4b4c345b Match user-requested transitive pre-releases in collection dependency resolver (#73416)
* Add direct+transitive pre-release regression test

* Match user-requested transitive pre-releases

This change makes sure that in scenario when a user requests
collectionA-pre and collectionB that depends on collectionA,
collectionA-pre would actually match that collectionA requirement
while `--pre` is unset.

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2021-02-01 14:26:49 +10:00
595413d113 Replace the inhouse collection dependency resolver with resolvelib
PR #72591

This change:

  * Adds an artifacts manager that abstracts away extracting the
    metadata from artifacts, downloading and caching them in a
    temporary location.

  * Adds `resolvelib` to direct ansible-core dependencies[0].

  * Implements a `resolvelib`-based dependency resolver for
    `collection` subcommands that replaces the legacy
    in-house code.

    This is a dependency resolution library that pip 20.3+ uses
    by default. It's now integrated for use for the collection
    dependency resolution in ansible-galaxy CLI.

  * Refactors of the `ansible-galaxy collection` CLI.
    In particular, it:

      - reimplements most of the `download`, `install`, `list` and
        `verify` subcommands from scratch;

      - reuses helper bits previously moved out into external modules;

      - replaces the old in-house resolver with a more clear
        implementation based on the resolvelib library[0][1][2].

  * Adds a multi Galaxy API proxy layer that abstracts accessing the
    version and dependencies via API or local artifacts manager.

  * Makes `GalaxyAPI` instances sortable.

  * Adds string representation methods to `GalaxyAPI`.

  * Adds dev representation to `GalaxyAPI`.

  * Removes unnecessary integration and unit tests.

  * Aligns the tests with the new expectations.

  * Adds more tests, integration ones in particular.

[0]: https://pypi.org/p/resolvelib
[1]: https://github.com/sarugaku/resolvelib
[2]: https://pradyunsg.me/blog/2020/03/27/pip-resolver-testing

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
Co-Authored-By: Matt Clay <matt@mystile.com>
Co-Authored-By: Sam Doran <sdoran@redhat.com>
Co-Authored-By: Sloane Hertel <shertel@redhat.com>
Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com>

Signed-Off-By: Sviatoslav Sydorenko <webknjaz@redhat.com>
2021-01-27 22:23:22 +01:00
Sviatoslav SydorenkoandGitHub ab667200cc Mention renaming ansible-base to -core @ roadmap (#73354)
* Mention renaming ansible-base to -core @ roadmap

* Replace ansible-base with ansible-core @ roadmap
2021-01-25 12:34:40 -05:00
Sviatoslav SydorenkoandGitHub ece0be30ab Move ansible.galaxy.collection module into package
This change preserves how all the external imports refer to this code
while allowing us to start cutting the spaghetti into more easily
maintainable pieces.

This is a start of the upcoming refactoring effort destined to
eliminate tight coupling, implicit data manipulation, god objects,
abstraction leaks and other code smells.

Essentially, `ansible.galaxy.collection` is going to be a package that
holds parts of the collection management code spread across loosely
coupled modules.

PR: #71931
2020-09-25 16:15:10 +02:00
Sviatoslav SydorenkoandGitHub 9c12f20f27 Update the number of contributors in README: 5000+ (#70880) 2020-07-24 21:48:23 +02:00
Sviatoslav SydorenkoandGitHub 20bb915092 Refactor Python API examples and docs
PR #70446: it's a follow-up for #70445.

It includes a merge of `examples/scripts/uptime.py` and a similar
code snippet from `docs/docsite/rst/dev_guide/developing_api.rst`.

This patch also changes the docs RST file to include contents of
the example file instead of holding a copy of a similar code.
2020-07-23 18:24:02 +02:00
918388b85f Fix building Ansible dist w/ setuptools>=48,<49.1 (#70525)
* Fix building Ansible dist w/ setuptools>=48,<49.1

This change addresses the deprecation of the use of stdlib
`distutils`. It's a short-term hotfix for the problem and we'll
need to consider dropping the use of `distutils` from our `setup.py`.

Refs:
* https://github.com/ansible/ansible/issues/70456
* https://github.com/pypa/setuptools/issues/2230
* https://github.com/pypa/setuptools/commit/bd110264

Co-Authored-By: Jason R. Coombs <jaraco@jaraco.com>

* Add a change note for PR #70525

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-07-13 17:16:26 -04:00
Sviatoslav SydorenkoandJohn R Barker ff35103bf9 Add external refs to the GH issue template chooser (#66743)
This change replaces a dummy template for security issues with a
proper reference to the doc. It also adds pointers to a few other
useful community pages.

Ref:
https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2020-01-24 07:56:03 +00:00
Sviatoslav SydorenkoandSandra McCann 2969614c2c Fix link syntax and a typo in dev collections doc (#62650) 2019-09-20 09:36:23 -04:00
Sviatoslav SydorenkoandSandra McCann d7604844c2 Update the number of contributors in README: 4600+ (#61949) 2019-09-06 15:07:27 -04:00
Sviatoslav SydorenkoandGitHub 4c7fff315e Fix module_utils.common.test_collections testsuite
PR #57181
2019-05-31 13:40:18 +02:00
ab96d22b61 📝 Add a GitHub-specific security policy note
PR #56866

It'll show up at
https://github.com/ansible/ansible/security/policy
and will help us guide users to the proper docs page

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2019-05-23 21:48:58 +02:00