Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipx: document parameters supported with state=latest, and fix include_injected parameter #6212

Merged
merged 6 commits into from
Mar 30, 2023

Conversation

darkrain42
Copy link
Contributor

SUMMARY

Improve the pipx module so the documentation matches what attributes are allowed with which states.

  • Document which parameters are allowed with state=latest (everything supported with either state=install or state=upgrade)
  • Fix include_injected so that it works with state=upgrade and state=latest

This depends on #6198. Happy to keep it as a separate PR or fold it into that one.

ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
COMPONENT NAME

pipx

ADDITIONAL INFORMATION

@ansibullbot
Copy link
Collaborator

cc @russoz
click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug integration tests/integration language module module module_utils module_utils new_contributor Help guide this first time contributor packaging plugins plugin (any type) tests tests needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 22, 2023
@github-actions
Copy link

github-actions bot commented Mar 22, 2023

Docs Build 📝

Thank you for contribution!✨

The docsite for this PR is available for download as an artifact from this run:
https://github.com/ansible-collections/community.general/actions/runs/4525148063

File changes:

  • M collections/community/general/pipx_module.html
Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

diff --git a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/pipx_module.html b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/pipx_module.html
index dec92e7..c52df2a 100644
--- a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/pipx_module.html
+++ b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/pipx_module.html
@@ -195,7 +195,7 @@
 <a class="ansibleOptionLink" href="#parameter-force" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>Force modification of the application’s virtual environment. See <code class="docutils literal notranslate"><span class="pre">pipx</span></code> for details.</p>
-<p>Only used when <em>state=install</em>, <em>state=upgrade</em>, <em>state=upgrade_all</em>, or <em>state=inject</em>.</p>
+<p>Only used when <em>state=install</em>, <em>state=upgrade</em>, <em>state=upgrade_all</em>, <em>state=latest</em>, or <em>state=inject</em>.</p>
 <p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
 <ul class="simple">
 <li><p><code class="ansible-option-default-bold docutils literal notranslate"><span class="pre">false</span></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
@@ -208,7 +208,8 @@
 <a class="ansibleOptionLink" href="#parameter-include_injected" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>Upgrade the injected packages along with the application.</p>
-<p>Only used when <em>state=upgrade</em> or <em>state=upgrade_all</em>.</p>
+<p>Only used when <em>state=upgrade</em>, <em>state=upgrade_all</em>, or <em>state=latest</em>.</p>
+<p>This is used with <em>state=upgrade</em> and <em>state=latest</em> since community.general 6.5.0.</p>
 <p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
 <ul class="simple">
 <li><p><code class="ansible-option-default-bold docutils literal notranslate"><span class="pre">false</span></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
@@ -221,7 +222,7 @@
 <a class="ansibleOptionLink" href="#parameter-index_url" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>Base URL of Python Package Index.</p>
-<p>Only used when <em>state=install</em>, <em>state=upgrade</em>, or <em>state=inject</em>.</p>
+<p>Only used when <em>state=install</em>, <em>state=upgrade</em>, <em>state=latest</em>, or <em>state=inject</em>.</p>
 </div></td>
 </tr>
 <tr class="row-odd"><td><div class="ansible-option-cell">
@@ -251,7 +252,7 @@
 <a class="ansibleOptionLink" href="#parameter-install_deps" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>Include applications of dependent packages.</p>
-<p>Only used when <em>state=install</em>, <em>state=upgrade</em>, or <em>state=inject</em>.</p>
+<p>Only used when <em>state=install</em>, <em>state=latest</em>, <em>state=upgrade</em>, or <em>state=inject</em>.</p>
 <p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
 <ul class="simple">
 <li><p><code class="ansible-option-default-bold docutils literal notranslate"><span class="pre">false</span></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
@@ -279,7 +280,7 @@
 <a class="ansibleOptionLink" href="#parameter-python" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>Python version to be used when creating the application virtual environment. Must be 3.6+.</p>
-<p>Only used when <em>state=install</em>, <em>state=reinstall</em>, or <em>state=reinstall_all</em>.</p>
+<p>Only used when <em>state=install</em>, <em>state=latest</em>, <em>state=reinstall</em>, or <em>state=reinstall_all</em>.</p>
 </div></td>
 </tr>
 <tr class="row-odd"><td><div class="ansible-option-cell">

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Mar 22, 2023
@felixfontein felixfontein marked this pull request as draft March 22, 2023 06:32
@felixfontein
Copy link
Collaborator

  • ``

Thanks for your contribution!

This depends on #6198. Happy to keep it as a separate PR or fold it into that one.

I've marked this as a draft. It should only be marked as ready for review once that other PR is no longer part of this one. (Alternatively rebase this one to remove the other PR from it so it can be merged independently.)

@ansibullbot ansibullbot added the WIP Work in progress label Mar 22, 2023
@russoz
Copy link
Collaborator

russoz commented Mar 26, 2023

Thanks for the PR, will wait for the adjustments before approving.

@felixfontein
Copy link
Collaborator

#6198 has now been merged, so a rebase is needed.

@ansibullbot ansibullbot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed new_contributor Help guide this first time contributor labels Mar 26, 2023
- Contrary to documentation, "include_injected" doesn't appear to have
  worked with state=upgrade since it was introduced.
- Add support for include_injected with "latest", since "latest" is
  specified as being install+upgrade.
@ansibullbot ansibullbot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Mar 26, 2023
@darkrain42 darkrain42 marked this pull request as ready for review March 26, 2023 14:14
@ansibullbot ansibullbot removed the WIP Work in progress label Mar 26, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's ready, please mark this as ready for review (i.e. no longer a draft).

plugins/modules/pipx.py Outdated Show resolved Hide resolved
changelogs/fragments/6212-pipx-include-injected.yml Outdated Show resolved Hide resolved
changelogs/fragments/6212-pipx-include-injected.yml Outdated Show resolved Hide resolved
darkrain42 and others added 2 commits March 26, 2023 07:42
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
@felixfontein felixfontein requested a review from russoz March 27, 2023 04:44
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Mar 30, 2023
@felixfontein felixfontein merged commit 33093e9 into ansible-collections:main Mar 30, 2023
@patchback
Copy link

patchback bot commented Mar 30, 2023

Backport to stable-5: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 33093e9 on top of patchback/backports/stable-5/33093e9f3e92d2facada017e9927c3303b56918f/pr-6212

Backporting merged PR #6212 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.general.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-5/33093e9f3e92d2facada017e9927c3303b56918f/pr-6212 upstream/stable-5
  4. Now, cherry-pick PR pipx: document parameters supported with state=latest, and fix include_injected parameter #6212 contents into that branch:
    $ git cherry-pick -x 33093e9f3e92d2facada017e9927c3303b56918f
    If it'll yell at you with something like fatal: Commit 33093e9f3e92d2facada017e9927c3303b56918f is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 33093e9f3e92d2facada017e9927c3303b56918f
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR pipx: document parameters supported with state=latest, and fix include_injected parameter #6212 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-5/33093e9f3e92d2facada017e9927c3303b56918f/pr-6212
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Mar 30, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/33093e9f3e92d2facada017e9927c3303b56918f/pr-6212

Backported as #6266

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@darkrain42 thanks for your contribution!
@russoz thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Mar 30, 2023
…e_injected parameter (#6212)

* pipx: Document parameters supported with state=latest

* pipx: Support "include_injected" with states "upgrade" and "latest"

- Contrary to documentation, "include_injected" doesn't appear to have
  worked with state=upgrade since it was introduced.
- Add support for include_injected with "latest", since "latest" is
  specified as being install+upgrade.

* Add changelog fragment

* Update plugins/modules/pipx.py

Co-authored-by: Felix Fontein <[email protected]>

* Update changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

* pipx: Update to correct target release of community.general

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 33093e9)
felixfontein pushed a commit that referenced this pull request Mar 30, 2023
…orted with state=latest, and fix include_injected parameter (#6266)

pipx: document parameters supported with state=latest, and fix include_injected parameter (#6212)

* pipx: Document parameters supported with state=latest

* pipx: Support "include_injected" with states "upgrade" and "latest"

- Contrary to documentation, "include_injected" doesn't appear to have
  worked with state=upgrade since it was introduced.
- Add support for include_injected with "latest", since "latest" is
  specified as being install+upgrade.

* Add changelog fragment

* Update plugins/modules/pipx.py

Co-authored-by: Felix Fontein <[email protected]>

* Update changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

* pipx: Update to correct target release of community.general

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 33093e9)

Co-authored-by: Paul Aurich <[email protected]>
@darkrain42 darkrain42 deleted the pipx-state-fixes branch March 31, 2023 03:38
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Apr 26, 2023
v7.5.0

Minor Changes
-------------

ansible.posix
~~~~~~~~~~~~~

- Add jsonl callback plugin to ansible.posix collection
- firewalld - add `protocol` parameter

cisco.aci
~~~~~~~~~

- Add aci_access_span_dst_group module for fabric access policies span destination group support
- Add aci_access_span_filter_group and aci_access_span_filter_group_entry modules for access span filter group support
- Add aci_config_export_policy module
- Add aci_igmp_interface_policy module
- Add aci_interface_config module for new interface configuration available in ACI v5.2(5)+
- Add aci_interface_policy_spanning_tree  module

cisco.dnac
~~~~~~~~~~

- accesspoint_configuration_details_by_task_id_info - new module
- authentication_policy_servers_info - new module
- credential_to_site_by_siteid_create_v2 - new module
- device_interface_info - attributes `lastInputTime` and `lastOutputTime` were added.
- device_reboot_apreboot_info - new module
- dnac_packages_info - new module
- eox_status_device_info - new module
- eox_status_summary_info - new module
- event_email_config - new module
- event_email_config_info - new module
- event_snmp_config_info - new module
- event_syslog_config - new module
- event_syslog_config_info - new module
- execute_suggested_actions_commands - new module
- global_credential_v2 - new module
- global_credential_v2_info - new module
- integration_settings_instances_itsm - new module
- integration_settings_instances_itsm_info - new module
- lan_automation_log_by_serial_number_info - new module
- network_device_user_defined_field - new module
- network_device_user_defined_field_info - new module
- network_v2 - new module
- network_v2_info - new module
- pnp_device_claim_to_site - attributes `removeInactive` and `hostname` were removed.
- role_permissions_info - new module
- roles_info - new module
- sda_fabric_border_device - attributes `routeDistributionProtocol` and `borderPriority` were added.
- sda_fabric_control_plane_device attribute `routeDistributionProtocol` was added.
- sda_fabric_edge_device - attribute `siteNameHierarchy` was added.
- sda_fabric_site - attribute `fabricType` was added.
- sda_port_assignment_for_user_device - attribute `interfaceNames` was added.
- sda_virtual_network - attribute `vManageVpnId` was added.
- sda_virtual_network_ip_pool - attribute `isBridgeModeVm` was added.
- sda_virtual_network_v2 - attribute `isBridgeModeVm` was added.
- service_provider_v2 - new module
- service_provider_v2_info - new module
- sp_profile_delete_v2 - new module
- user - new module
- user_info - new module
- users_external_servers_info - new module
- wireless_accespoint_configuration - new module
- wireless_accesspoint_configuration_summary_info - new module

cisco.ios
~~~~~~~~~

- ios_bgp_address_family - add option redistribute.ospf.include_connected when redistributing OSPF in IPv6 AFI
- ios_bgp_address_family - add option redistribute.ospf.match.externals.type_1 to allow
- ios_bgp_address_family - add option redistribute.ospf.match.externals.type_2 to allow
- specification of OSPF E1 routes
- specification of OSPF E2 routes

cisco.mso
~~~~~~~~~

- Add ip_data_plane_learning and preferred_group arguments to mso_schema_template_vrf module
- Add module mso_schema_site_anp_epg_bulk_staticport
- Add route_reachability attribute to mso_schema_site_external_epg module

cisco.nxos
~~~~~~~~~~

- `nxos_route_maps` - add support for 'set ip next-hop <>' command in route-maps
- `nxos_vxlan_vtep` - add support for 'advertise virtual-rmac' command under nve interface

community.crypto
~~~~~~~~~~~~~~~~

- get_certificate - add ``asn1_base64`` option to control whether the ASN.1 included in the ``extensions`` return value is binary data or Base64 encoded (ansible-collections/community.crypto#592).

community.general
~~~~~~~~~~~~~~~~~

- cpanm - minor change, use feature from ``ModuleHelper`` (ansible-collections/community.general#6385).
- dconf - be forgiving about boolean values: convert them to GVariant booleans automatically (ansible-collections/community.general#6206).
- dconf - minor refactoring improving parameters and dependencies validation (ansible-collections/community.general#6336).
- deps module utils - add function ``failed()`` providing the ability to check the dependency check result without triggering an exception (ansible-collections/community.general#6383).
- dig lookup plugin - Support multiple domains to be queried as indicated in docs (ansible-collections/community.general#6334).
- gitlab_project - add new option ``topics`` for adding topics to GitLab projects (ansible-collections/community.general#6278).
- homebrew_cask - allows passing ``--greedy`` option to ``upgrade_all`` (ansible-collections/community.general#6267).
- idrac_redfish_command - add ``job_id`` to ``CreateBiosConfigJob`` response (ansible-collections/community.general#5603).
- ipa_hostgroup - add ``append`` parameter for adding a new hosts to existing hostgroups without changing existing hostgroup members (ansible-collections/community.general#6203).
- keycloak_authentication - add flow type option to sub flows to allow the creation of 'form-flow' sub flows like in Keycloak's built-in registration flow (ansible-collections/community.general#6318).
- mksysb - improved the output of the module in case of errors (ansible-collections/community.general#6263).
- nmap inventory plugin - added environment variables for configure ``address`` and ``exclude`` (ansible-collections/community.general#6351).
- nmcli - add ``macvlan`` connection type (ansible-collections/community.general#6312).
- pipx - add ``system_site_packages`` parameter to give application access to system-wide packages (ansible-collections/community.general#6308).
- pipx - ensure ``include_injected`` parameter works with ``state=upgrade`` and ``state=latest`` (ansible-collections/community.general#6212).
- puppet - add new options ``skip_tags`` to exclude certain tagged resources during a puppet agent or apply (ansible-collections/community.general#6293).
- terraform - remove state file check condition and error block, because in the native implementation of terraform will not cause errors due to the non-existent file (ansible-collections/community.general#6296).
- udm_dns_record - minor refactor to the code (ansible-collections/community.general#6382).

community.zabbix
~~~~~~~~~~~~~~~~

- httpapi plugin - updated to work with Zabbix 6.4.
- zabbix_action, zabbix_authentication, zabbix_discovery_rule, zabbix_mediatype, zabbix_user, zabbix_user_directory, zabbix_usergroup - updated to work with Zabbix 6.4.
- zabbix_agent role - Add support for SUSE Linux Enterprise Server for SAP Applications ("SLES_SAP").
- zabbix_host - add missing variants for SNMPv3 authprotocol and privprotocol introduced by Zabbix 6
- zabbix_proxy role - Add variable zabbix_proxy_dbpassword_hash_method to control whether you want postgresql user password to be hashed with md5 or want to use db default. When zabbix_proxy_dbpassword_hash_method is set to anything other than md5 then do not hash the password with md5 so you could use postgresql scram-sha-256 hashing method.
- zabbix_server role - Add variable zabbix_server_dbpassword_hash_method to control whether you want postgresql user password to be hashed with md5 or want to use db default. When zabbix_server_dbpassword_hash_method is set to anything other than md5 then do not hash the password with md5 so you could use postgresql scram-sha-256 hashing method.
- zabbix_usergroup module - userdirectory, hostgroup_rights and templategroup_rights parameters added (Zabbix >= 6.2)
- zabbix_web role - possibility to add custom includes in apache vhost config

dellemc.powerflex
~~~~~~~~~~~~~~~~~

- Info module is enhanced to support the listing of replication pairs.

dellemc.unity
~~~~~~~~~~~~~

- Add synchronous replication support for filesystem.
- Support addition of host from the Host List to NFS Export in nfs module.
- Support enable/disable advanced dedup in volume module.

hetzner.hcloud
~~~~~~~~~~~~~~

- hcloud_image_info - Add cpu architecture field to return value.
- hcloud_image_info - Allow filtering images by cpu architecture.
- hcloud_server - Select matching image for the cpu architecture of the server type on create & rebuild.
- hcloud_server_type_info - Add cpu architecture field to return value.
- inventory plugin - Add cpu architecture to server variables.

netapp.ontap
~~~~~~~~~~~~

- na_ontap_cifs - new options ``browsable`` and ``show_previous_versions`` added in REST.
- na_ontap_cifs - removed default value for ``unix_symlink`` as its not supported with ZAPI.
- na_ontap_cifs - updated documentation and examples for REST.
- na_ontap_file_security_permissions - updated module examples.
- na_ontap_ipspace - improved module fail error message in REST.
- na_ontap_rest_info - improved documentation for ``parameters`` option.
- na_ontap_security_config - updated documentation for ``supported_cipher_suites``.
- na_ontap_user - option ``vserver`` is not required with REST, ignore this option to create cluster scoped user.

netbox.netbox
~~~~~~~~~~~~~

- netbox_aggregate - Add tenant as parameter to module
- netbox_asn - Add module
- netbox_fhrp_group - Add module
- netbox_journal_entry - Add module

purestorage.flashblade
~~~~~~~~~~~~~~~~~~~~~~

- purefb_info - Added `encryption` and `support_keys` information.
- purefb_info - Added bucket quota and safemode information per bucket
- purefb_info - Added security update version for Purity//FB 4.0.2, or higher
- purefb_info - Updated object store account information
- purefb_inventory - Added `part_number` to hardware item information.
- purefb_policy - Added support for multiple rules in snapshot policies
- purefb_proxy - Added new boolean parameter `secure`. Default of true (for backwards compatability) sets the protocol to be `https://`. False sets `http://`
- purefb_s3acc - Added support for default bucket quotas and hard limits
- purefb_s3acc - Added support for object account quota and hard limit

purestorage.fusion
~~~~~~~~~~~~~~~~~~

- added Python package dependency checks in prerequisites.py
- fusion_hap - added missing 'windows' personality type

theforeman.foreman
~~~~~~~~~~~~~~~~~~

- content_export_library, content_export_repository, content_export_version - add ``format`` option to control the export format
- content_view_filter - add support for creating modulemd filters
- content_view_publish role - also accept a list of dicts as the ``content_views`` role for publishing (theforeman/foreman-ansible-modules#1436)
- setting - document how to obtain valid setting names (https://bugzilla.redhat.com/show_bug.cgi?id=2174367)

Deprecated Features
-------------------

cisco.ios
~~~~~~~~~

- ios_bgp_address_family - deprecate redistribute.ospf.match.external with redistribute.ospf.match.externals which enables attributes for OSPF type E1 and E2 routes
- ios_bgp_address_family - deprecate redistribute.ospf.match.nssa_external with redistribute.ospf.match.nssa_externals which enables attributes for OSPF type N1 and N2 routes
- ios_bgp_address_family - deprecate redistribute.ospf.match.type_1 with redistribute.ospf.match.nssa_externals.type_1
- ios_bgp_address_family - deprecate redistribute.ospf.match.type_2 with redistribute.ospf.match.nssa_externals.type_2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug integration tests/integration language module_utils module_utils module module packaging plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants