Skip to content

Commit 4af6165

Browse files
feat: run UCC in an isolated virtual environment (#436)
### Description [Document with more info](https://docs.google.com/document/d/1FqGxAY8onYWaTus0g5LbCQD9a8FGMn8-yIGMTLoea8k/edit?tab=t.0) This PR allows to separate UCC from TA dependencies, in order to avoid dependency conflicts. UCC version may be specified in requirements_ucc.txt file. Then, the action will install UCC in an isolated environment. ### Checklist - [ ] `README.md` has been updated or is not required - [ ] push trigger tests - [ ] manual release test - [ ] automated releases test - [x] pull request trigger tests - [ ] schedule trigger tests - [ ] workflow errors/warnings reviewed and addressed ### Testing done 1. Build of a TA (no `requirements_ucc.txt` added): https://github.com/splunk/splunk-add-on-for-salesforce/actions/runs/17427842825/job/49479100399?pr=788 2. Build of a TA (`requirements_ucc.txt` added): https://github.com/splunk/splunk-add-on-for-salesforce/actions/runs/17426742577/job/49475535585?pr=788
1 parent f66b564 commit 4af6165

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,24 @@ jobs:
571571
poetry export --without-hashes --with dev -o requirements_dev.txt
572572
cat requirements_dev.txt
573573
fi
574+
- name: Setup UCC
575+
run: |
576+
if [ -f "requirements_ucc.txt" ]; then
577+
python${{ env.PYTHON_VERSION }} -m venv .ucc_venv
578+
echo "Found requirements_ucc.txt. Installing UCC dependencies in an isolated environment"
579+
./.ucc_venv/bin/python -m pip install -r requirements_ucc.txt
580+
export UCC_GEN="$PWD/.ucc_venv/bin/ucc-gen"
581+
582+
if [ ! -f "$UCC_GEN" ]; then
583+
echo "ucc-gen not found after installing requirements from requirements_ucc.txt"
584+
exit 1
585+
fi
586+
587+
echo "UCC_GEN=$UCC_GEN" >> "$GITHUB_ENV"
588+
else
589+
echo "No UCC requirements file found, skipping UCC setup"
590+
echo "Consider adding a requirements_ucc.txt file and place UCC requirement there, to avoid dependency conflicts"
591+
fi
574592
- name: Get pip cache dir
575593
id: pip-cache
576594
run: |
@@ -650,7 +668,7 @@ jobs:
650668
- name: Build Package
651669
id: uccgen
652670
run: |
653-
ucc-gen --ta-version ${{ steps.BuildVersion.outputs.VERSION }}
671+
"${UCC_GEN:-ucc-gen}" build --ta-version ${{ steps.BuildVersion.outputs.VERSION }}
654672
if [ -f package.json ]
655673
then
656674
yarn

0 commit comments

Comments
 (0)