From aae83e66b4f916e9ebf06fd4866a44c27b2f0506 Mon Sep 17 00:00:00 2001
From: ammallya <ameyakeshava.mallya@amd.com>
Date: Wed, 4 Jun 2025 14:19:17 -0700
Subject: [PATCH 1/5] Reorganizing Variable names

---
 .azuredevops/rocm-ci-caller.yml | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/.azuredevops/rocm-ci-caller.yml b/.azuredevops/rocm-ci-caller.yml
index a485aff6c..6597a2365 100644
--- a/.azuredevops/rocm-ci-caller.yml
+++ b/.azuredevops/rocm-ci-caller.yml
@@ -4,14 +4,22 @@ pr:
     include:
       - release-staging/rocm-rel-7.0
   
-variables:  
-  REPOSITORY_NAME: '$(Build.Repository.Name)'  
-  HEAD_SHA: '$(system.pullRequest.sourceCommitId)'
-  PR_NUM: '$(system.pullRequest.pullRequestNumber)' 
-  PR_URL: '$(system.pullRequest.sourceRepositoryUri)/pull/$(PR_NUM)'
-  BASE_REF: '$(system.pullRequest.TargetBranch)'
-  EVENT_TYPE: 'pull_request'
-  GH_PAT: '$(svc_acc_org_secret)'  
+variables:
+  - group: internal
+  - name: REPOSITORY_NAME
+    value: '$(Build.Repository.Name)'  
+  - name: HEAD_SHA
+    value: '$(system.pullRequest.sourceCommitId)'
+  - name: PR_NUM
+    value: '$(system.pullRequest.pullRequestNumber)' 
+  - name: PR_URL
+    value: '$(system.pullRequest.sourceRepositoryUri)/pull/$(PR_NUM)'
+  - name: BASE_REF
+    value: '$(system.pullRequest.TargetBranch)'
+  - name: EVENT_TYPE
+    value: 'pull_request'
+  - name: GH_PAT
+    value: '$(svc_acc_org_secret)'  
 jobs:  
 - job: Trigger_Pipeline 
   displayName: 'Trigger Pipeline'

From 536637d2c9870231beb5b7e9695748321295ea9c Mon Sep 17 00:00:00 2001
From: ammallya <ameyakeshava.mallya@amd.com>
Date: Wed, 4 Jun 2025 14:39:05 -0700
Subject: [PATCH 2/5] Clean up

---
 .azuredevops/rocm-ci-caller.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.azuredevops/rocm-ci-caller.yml b/.azuredevops/rocm-ci-caller.yml
index 6597a2365..7cefa6d07 100644
--- a/.azuredevops/rocm-ci-caller.yml
+++ b/.azuredevops/rocm-ci-caller.yml
@@ -51,6 +51,8 @@ jobs:
               -ghpat '$(GH_PAT)' \
               -br   '$(BASE_REF)' \
               -et   '$(EVENT_TYPE)'" > /dev/null 2>&1
+            cd ..
+            rm -rf $(repo_name)
     displayName: Invoke jenkins_api.py in Docker  
     env:  
       svc_acc_org_secret: $(svc_acc_org_secret)

From 25bdeea782b791527e43bc2157bff99825072d5b Mon Sep 17 00:00:00 2001
From: ammallya <ameyakeshava.mallya@amd.com>
Date: Wed, 4 Jun 2025 14:40:50 -0700
Subject: [PATCH 3/5] Fix Indentation

---
 .azuredevops/rocm-ci-caller.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.azuredevops/rocm-ci-caller.yml b/.azuredevops/rocm-ci-caller.yml
index 7cefa6d07..d7e4834a3 100644
--- a/.azuredevops/rocm-ci-caller.yml
+++ b/.azuredevops/rocm-ci-caller.yml
@@ -51,8 +51,8 @@ jobs:
               -ghpat '$(GH_PAT)' \
               -br   '$(BASE_REF)' \
               -et   '$(EVENT_TYPE)'" > /dev/null 2>&1
-            cd ..
-            rm -rf $(repo_name)
+          cd ..
+          rm -rf $(repo_name)
     displayName: Invoke jenkins_api.py in Docker  
     env:  
       svc_acc_org_secret: $(svc_acc_org_secret)

From 868b18b94f7d57390d95cf5fa4f82f5313fbf068 Mon Sep 17 00:00:00 2001
From: ammallya <ameyakeshava.mallya@amd.com>
Date: Thu, 5 Jun 2025 12:47:28 -0700
Subject: [PATCH 4/5] Adding Cleanup

---
 .azuredevops/rocm-ci-caller.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.azuredevops/rocm-ci-caller.yml b/.azuredevops/rocm-ci-caller.yml
index d7e4834a3..1b6915877 100644
--- a/.azuredevops/rocm-ci-caller.yml
+++ b/.azuredevops/rocm-ci-caller.yml
@@ -30,6 +30,7 @@ jobs:
           git clone $(gh_repo)
     displayName: Checkout Code
   - script: |
+          rm -rf $(repo_name)
           set -e  
           echo "Calling jenkins_api.py for PR #$(PR_NUM)"
           cd $(repo_name)
@@ -51,8 +52,7 @@ jobs:
               -ghpat '$(GH_PAT)' \
               -br   '$(BASE_REF)' \
               -et   '$(EVENT_TYPE)'" > /dev/null 2>&1
-          cd ..
-          rm -rf $(repo_name)
+
     displayName: Invoke jenkins_api.py in Docker  
     env:  
       svc_acc_org_secret: $(svc_acc_org_secret)

From b060321cb1354bb8cbccf2c0d38b12d749d873c7 Mon Sep 17 00:00:00 2001
From: ammallya <ameyakeshava.mallya@amd.com>
Date: Thu, 5 Jun 2025 12:51:45 -0700
Subject: [PATCH 5/5] fixing small logic error

---
 .azuredevops/rocm-ci-caller.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.azuredevops/rocm-ci-caller.yml b/.azuredevops/rocm-ci-caller.yml
index 1b6915877..d6ce1d616 100644
--- a/.azuredevops/rocm-ci-caller.yml
+++ b/.azuredevops/rocm-ci-caller.yml
@@ -27,10 +27,10 @@ jobs:
   steps:
   - checkout: none
   - script: |
+          rm -rf $(repo_name)
           git clone $(gh_repo)
     displayName: Checkout Code
   - script: |
-          rm -rf $(repo_name)
           set -e  
           echo "Calling jenkins_api.py for PR #$(PR_NUM)"
           cd $(repo_name)
