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

plugin signature based on options #69947

Draft
wants to merge 12 commits into
base: devel
Choose a base branch
from
Draft

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Jun 8, 2020

Allow same plugin class with same options to be 'the same'

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jun 8, 2020
@samdoran samdoran added the ci_verified Changes made in this PR are causing tests to fail. label Jun 8, 2020
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Jun 8, 2020
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Jun 9, 2020
@samdoran samdoran changed the title hash plugins based on options [WIP] hash plugins based on options Jun 9, 2020
@ansibot ansibot added the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Jun 9, 2020
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 19, 2020
@ansibot ansibot added pre_azp This PR was last tested before migration to Azure Pipelines. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 5, 2020
@ansibot ansibot removed the pre_azp This PR was last tested before migration to Azure Pipelines. label Apr 29, 2021
@bcoca bcoca changed the title [WIP] hash plugins based on options plugin signature based on options Apr 29, 2021
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. core_review In order to be merged, this PR must follow the core review workflow. labels Apr 29, 2021
@ansible ansible deleted a comment from ansibot Apr 29, 2021
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. core_review In order to be merged, this PR must follow the core review workflow. labels Apr 29, 2021
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 27, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label May 5, 2022
@mattclay
Copy link
Member

mattclay commented May 6, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label May 6, 2022
@ansibot ansibot added 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. core_review In order to be merged, this PR must follow the core review workflow. and removed core_review In order to be merged, this PR must follow the core review workflow. 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 May 11, 2022
@ansibot
Copy link
Contributor

ansibot commented May 11, 2022

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/plugins/connection/__init__.py:106:5: E303: too many blank lines (2)

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/plugins/__init__.py:66:59: undefined-variable: Undefined variable 'variables'

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 11, 2022
lib/ansible/plugins/__init__.py Show resolved Hide resolved

def _gen_signature(self):
# create immutable
s_options = pickle.dumps(self.get_options(hostvars=variables))
Copy link
Contributor

Choose a reason for hiding this comment

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

If I copy an inventory config file and use both, should the plugin have the same hash, or be unique per source? The latter happens now with pickle.dumps.

Copy link
Member Author

Choose a reason for hiding this comment

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

would need the same as connections it's own _gen_signature to include 'source path'

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that would make sense. It seems like it includes source path now (implicitly) since the hashes are different, but I'm not sure exactly what's happening.

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label May 16, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label May 24, 2022
@bcoca bcoca marked this pull request as draft August 24, 2022 20:15
@ansibot ansibot added the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Aug 24, 2022
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Sep 1, 2022
@ansibot ansibot removed the has_issue label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 This issue/PR affects Ansible v2.10 ci_verified Changes made in this PR are causing tests to fail. feature This issue/PR relates to a feature request. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team. WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants