Skip to content

Add new credential entry point discovery#15685

Merged
thedoubl3j merged 21 commits intoansible:develfrom
thedoubl3j:test-entrypoints
Jan 15, 2025
Merged

Add new credential entry point discovery#15685
thedoubl3j merged 21 commits intoansible:develfrom
thedoubl3j:test-entrypoints

Conversation

@thedoubl3j
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@AlanCoding
Copy link
Copy Markdown
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
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
Copy Markdown
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
@sonarqubecloud
Copy link
Copy Markdown

@thedoubl3j thedoubl3j merged commit f05173c into ansible:devel Jan 15, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 82.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 75.24%. Comparing base (e106e10) to head (b85c26b).
Report is 83 commits behind head on devel.

✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

5 participants