Allow GitHub App SSH username for SCM URLs - #485
Conversation
There was a problem hiding this comment.
Pull request overview
This PR backports SCM URL validation logic in awx/main/utils/common.py to allow GitHub App-style SSH URLs using the x-access-token username to pass “special git host” validation, and updates unit tests accordingly.
Changes:
- Updates
update_scm_url()special-case handling for GitHub/Bitbucket SSH URLs to allowx-access-tokenas an SSH username. - Expands host classification logic to include
*.github.com/ Bitbucket-related host patterns. - Updates unit tests for SSH username validation expectations and adds a test case for
x-access-token-style URLs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| awx/main/utils/common.py | Adjusts SSH host/user validation rules for Git SCM URLs, aiming to allow GitHub App SSH username patterns. |
| awx/main/tests/unit/utils/test_common.py | Updates/extends unit tests covering update_scm_url() special SSH handling and expected validation errors. |
Signed-off-by: keepittechie <joshlacy@gmail.com>
b7e6ac7 to
9b1b2cc
Compare
|
Thanks for the review. I updated the branch to split GitHub and Bitbucket host detection, guard I also removed the extra positive test case that was not in the upstream AWX PR. Re-tested with:
Result: 37 passed, 50 deselected. |
SUMMARY
Backports the relevant ansible/awx#15807 SCM URL validation behavior so GitHub App SSH URLs using
x-access-tokenpass special Git host validation.Fixes #292.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Tests:
py.test awx/main/tests/unit/utils/test_common.py -k update_scm_urlHoping I did the pull request correct. Let me know if you need any more information.