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

Add new credential entry point discovery #15685

Merged
merged 21 commits into from
Jan 15, 2025

Conversation

thedoubl3j
Copy link
Member

SUMMARY

In ansible/awx-plugins#68, managed and supported creds are introduced.

This PR updates our logic to load the correct bucket of creds depending on what is installed.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
AWX VERSION
awx: 24.4.1.dev281+g798071dd8d.d20241204

ADDITIONAL INFORMATION

This PR will not work until its corresponding PR is merged into awx-plugins but should be backwards compatible with the existing landscape of awx-plugins.

@AlanCoding
Copy link
Member

Linked PR was merged. This looks all intended, but non-obvious conflicts with #15638 for rebase

@thedoubl3j thedoubl3j force-pushed the test-entrypoints branch 3 times, most recently from e0353a2 to 007a760 Compare December 17, 2024 18:39
@AlanCoding
Copy link
Member

These collection test failures appear non-trivial to me.

TASK [credential : Create a valid Network credential] **************************
task path: /home/runner/.ansible/collections/ansible_collections/awx/awx/tests/output/.tmp/integration/credential-dooaau07-ÅÑŚÌβŁÈ/tests/integration/targets/credential/tasks/main.yml:397
Using module file /home/runner/.ansible/collections/ansible_collections/awx/awx/plugins/modules/credential.py
Pipelining is enabled.
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: runner
<testhost> EXEC /bin/sh -c '/opt/hostedtoolcache/Python/3.12.8/x64/bin/python3 && sleep 0'
fatal: [testhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "controller_config_file": null,
            "controller_host": null,
            "controller_password": null,
            "controller_username": null,
            "copy_from": null,
            "credential_type": "Network",
            "description": null,
            "inputs": {
                "authorize": true,
                "authorize_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
            },
            "name": "AWX-Collection-tests-credential-net-cred1-TyEHpzfVmrxPLtvj",
            "new_name": null,
            "organization": "Default",
            "request_timeout": null,
            "state": "present",
            "team": null,
            "user": null,
            "validate_certs": null
        }
    },
    "msg": "Request to /api/v2/credential_types/?name=Network returned 0 items, expected 1",
    "query": {
        "name": "Network"
    },
    "response": {
        "json": {
            "count": 0,
            "next": null,
            "previous": null,
            "results": []
        },
        "status_code": 200
    },
    "total_results": 0
}

PLAY RECAP *********************************************************************
testhost                   : ok=56   changed=19   unreachable=0    failed=1    skipped=0    rescued=0    ignored=3   

Speculative, but I suspect that the way the tests are written may not be compatible with the changes to the plugins. Even with a rebase, I'm not sure this will be ready to merge yet. But I'll restart some tests to see if the new image fixes some failures.

@github-actions github-actions bot added the component:awx_collection issues related to the collection for controlling AWX label Jan 7, 2025
@chrismeyersfsu
Copy link
Member

The network cred tests in the awx collection integration tests are NOT picking up the new awx-plugins devel net changes due to caching (see below). To get past this, make a change to the one of the requirements files below, like add a newline.

#14 [builder  7/10] ADD requirements/requirements.txt     requirements/requirements_tower_uninstall.txt     requirements/requirements_git.txt     /tmp/requirements/
#14 CACHED

@thedoubl3j
Copy link
Member Author

I will open a separate PR to address the sanity fixes, we can ignore it.

@AlanCoding
Copy link
Member

It's not just the sanity, the collection integration tests are expecting a credential type removed by this PR

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jan 8, 2025
@@ -24,6 +24,28 @@
insights_cred_name1: "AWX-Collection-tests-credential-insights-cred1-{{ test_id }}"
tower_cred_name1: "AWX-Collection-tests-credential-tower-cred1-{{ test_id }}"

- name: Get current Credential Types available
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@thedoubl3j thedoubl3j force-pushed the test-entrypoints branch 3 times, most recently from 817f19b to 41c75fb Compare January 14, 2025 20:25
@thedoubl3j thedoubl3j merged commit f05173c into ansible:devel Jan 15, 2025
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:api component:awx_collection issues related to the collection for controlling AWX dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants