Skip to content

Commit

Permalink
Support checking out msft repo. (sonic-net#16668)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
To enable PR testing in the msft repo, we need to ensure support for checking out its code. This PR introduces the way to enable code checkout for the msft repo.

How did you do it?
If repo_name contains msft, we will check out msft test repo.

How did you verify/test it?
Test by pipeline.
  • Loading branch information
yutongzhang-microsoft authored Jan 24, 2025
1 parent 5463bc1 commit 49a83f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .azure-pipelines/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
BUILDIMAGE_REPO_FLAG = "buildimage"
MGMT_REPO_FLAG = "sonic-mgmt"
INTERNAL_REPO_LIST = ["Networking-acs-buildimage", "sonic-mgmt-int"]
MSFT_REPO_FLAG = "msft"
GITHUB_SONIC_MGMT_REPO = "https://github.com/sonic-net/sonic-mgmt"
GITHUB_SONIC_MGMT_REPO_MSFT = "https://github.com/Azure/sonic-mgmt.msft"
INTERNAL_SONIC_MGMT_REPO = "https://dev.azure.com/mssonic/internal/_git/sonic-mgmt-int"
PR_TEST_SCRIPTS_FILE = "pr_test_scripts.yaml"
SPECIFIC_PARAM_KEYWORD = "specific_param"
Expand Down Expand Up @@ -276,7 +278,11 @@ def create(self, topology, test_plan_name="my_test_plan", deploy_mg_extra_params

# If triggered by the internal repos, use internal sonic-mgmt repo as the code base
sonic_mgmt_repo_url = GITHUB_SONIC_MGMT_REPO
if kwargs.get("source_repo") in INTERNAL_REPO_LIST:

if MSFT_REPO_FLAG in repo_name:
sonic_mgmt_repo_url = GITHUB_SONIC_MGMT_REPO_MSFT

elif kwargs.get("source_repo") in INTERNAL_REPO_LIST:
sonic_mgmt_repo_url = INTERNAL_SONIC_MGMT_REPO

# If triggered by mgmt repo, use pull request id as the code base
Expand Down

0 comments on commit 49a83f4

Please sign in to comment.