Skip to content

Allow GitHub App SSH username for SCM URLs - #485

Merged
cigamit merged 1 commit into
ctrliq:mainfrom
keepittechie:fix-292-github-app-ssh
Jun 24, 2026
Merged

Allow GitHub App SSH username for SCM URLs#485
cigamit merged 1 commit into
ctrliq:mainfrom
keepittechie:fix-292-github-app-ssh

Conversation

@keepittechie

Copy link
Copy Markdown
Contributor
SUMMARY

Backports the relevant ansible/awx#15807 SCM URL validation behavior so GitHub App SSH URLs using x-access-token pass special Git host validation.

Fixes #292.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
ADDITIONAL INFORMATION

Tests:

  • py.test awx/main/tests/unit/utils/test_common.py -k update_scm_url
  • 38 passed, 50 deselected

Hoping I did the pull request correct. Let me know if you need any more information.

Comment thread awx/main/tests/unit/utils/test_common.py Outdated

Copilot AI left a comment

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.

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 allow x-access-token as 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.

Comment thread awx/main/utils/common.py Outdated
Comment thread awx/main/tests/unit/utils/test_common.py
Comment thread awx/main/tests/unit/utils/test_common.py
Signed-off-by: keepittechie <joshlacy@gmail.com>
@keepittechie
keepittechie force-pushed the fix-292-github-app-ssh branch from b7e6ac7 to 9b1b2cc Compare June 19, 2026 04:51
@keepittechie

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I updated the branch to split GitHub and Bitbucket host detection, guard parts.hostname before suffix checks, keep the x-access-token exception limited to GitHub hosts, and restore the original Bitbucket git-only validation messages.

I also removed the extra positive test case that was not in the upstream AWX PR.

Re-tested with:

py.test awx/main/tests/unit/utils/test_common.py -k update_scm_url

Result: 37 passed, 50 deselected.

@cigamit
cigamit merged commit b71a640 into ctrliq:main Jun 24, 2026
@keepittechie
keepittechie deleted the fix-292-github-app-ssh branch June 30, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Backport https://github.com/ansible/awx/pull/15807

3 participants