Skip to content

Fix pip changed status when installing from vcs - #81816

Open
sbettid wants to merge 8 commits into
ansible:develfrom
sbettid:fix-pip-changed-status-when-installing-from-vcs
Open

sbettid wants to merge 8 commits into
ansible:develfrom
sbettid:fix-pip-changed-status-when-installing-from-vcs

Conversation

@sbettid

@sbettid sbettid commented Sep 30, 2023

Copy link
Copy Markdown
Contributor
SUMMARY

Fixes #81751.

The problem resided in the fact that pip list does not show the commit information related with modules installed from VCS, and this could lead to a wrong changed status reported, in case the module is installed again from a different branch or commit that does not change the version.

The main idea, as was mentioned also in the issue comments, is to incorporate in the check also the information reported by pip freeze, since this reports information also on the commit used when installing from VCS.

The related integration tests have been added to the existing ones.

ISSUE TYPE
  • Bugfix Pull Request
ADDITIONAL INFORMATION

Starting from the following state, obtained using pip freeze:

-e git+https://github.com/dvarrazzo/pyiso8601@8bfaaa3e5c63a9eda4449e606786802f4e95ba60#egg=iso8601

and installing the module using a different commit (but same version), as follows

- name: install the same module from url pointing to a specific commit
      pip:
        name: "git+https://github.com/dvarrazzo/pyiso8601@8bfaaa3e5c63a9eda4449e606786802f4e95ba60#egg=iso8601"
        state: latest
        editable: true

the result would currently be:

PLAY [localhost] **********************************************************************

TASK [install the same module from url pointing to a specific commit] *****************
ok: [localhost]

PLAY RECAP ****************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

while, executing again pip freeze, we would notice the change:

-e git+https://github.com/dvarrazzo/pyiso8601@a48aa33f9fe5aa77d40fa2a38584750570d38ad6#egg=iso8601

After the fix, the execution will correctly report the changed status:

PLAY [localhost] *************************************************************************************************************************************************************

TASK [install the same module from url pointing to a specific commit] ********************************************************************************************************
changed: [localhost]

PLAY RECAP *******************************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. module This issue/PR relates to a module. has_issue needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Sep 30, 2023
@sbettid
sbettid marked this pull request as draft September 30, 2023 10:41
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Sep 30, 2023
@sbettid
sbettid marked this pull request as ready for review September 30, 2023 18:12
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Oct 10, 2023
@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 Oct 10, 2023
@Akasurde Akasurde self-assigned this May 29, 2024
@ansibot ansibot added the needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. label Jan 11, 2025
@webknjaz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@webknjaz

Copy link
Copy Markdown
Member

@mattclay @sivel this is an example PR that #84375 / #84402 would've helped with.

@ansibot ansibot added 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. 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 Jan 21, 2025
@webknjaz webknjaz added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html ci_verified Changes made in this PR are causing tests to fail. labels Jan 21, 2025
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jan 21, 2025
@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Jan 28, 2025
@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 Feb 4, 2025
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. ci_verified Changes made in this PR are causing tests to fail. has_issue module This issue/PR relates to a module. 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. stale_pr This PR has not been pushed to for more than one year.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pip module never set to changed when installing from github

5 participants