Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

feat: run UCC in an isolated environment#23

Open
kkedziak-splunk wants to merge 6 commits intomainfrom
feat/ucc_version_file
Open

feat: run UCC in an isolated environment#23
kkedziak-splunk wants to merge 6 commits intomainfrom
feat/ucc_version_file

Conversation

@kkedziak-splunk
Copy link

@kkedziak-splunk kkedziak-splunk commented Jul 25, 2025

Document with more info

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.

@kkedziak-splunk kkedziak-splunk requested a review from Copilot July 25, 2025 08:24
Copy link

Copilot AI left a comment

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 adds support for a UCC_VERSION file that allows users to specify a particular version of the splunk-add-on-ucc-framework to install and use, rather than relying on the default ucc-gen executable. When the UCC_VERSION file is present, the action installs pip-run and uses it to run the specified version of the UCC framework.

  • Adds conditional logic to check for UCC_VERSION file existence
  • Dynamically sets the UCC executable based on whether a version file is present
  • Replaces hardcoded ucc-gen command with a variable UCC_EXECUTABLE
Comments suppressed due to low confidence (1)

action.yml:63

  • The if statement is missing a closing bracket. It should be if [ -f "UCC_VERSION" ] followed by then on the same line or add a semicolon: if [ -f "UCC_VERSION" ]; then
        if [ -f "UCC_VERSION" ]

@kkedziak-splunk kkedziak-splunk changed the title feat: Add support for UCC_VERSION file feat: run UCC in an isolated environment Jul 25, 2025
@kkedziak-splunk kkedziak-splunk marked this pull request as ready for review July 28, 2025 08:40
@mbruzda-splunk
Copy link
Contributor

run: pip install -r requirements_dev.txt
- shell: bash
run: |
if [ -f "requirements_ucc.txt" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing closing brackets for the if statement

Suggested change
if [ -f "requirements_ucc.txt" ]
if [ -f "requirements_ucc.txt" ] ;

./.ucc_venv/bin/python -m pip install -r requirements_ucc.txt

# if file does not exist, show an error
if [ ! -f "./.ucc_venv/bin/ucc-gen" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ ! -f "./.ucc_venv/bin/ucc-gen" ]
if [ ! -f "./.ucc_venv/bin/ucc-gen" ] ;

echo running ucc-gen $ARG_VERSION
ucc-gen $ARG_VERSION

if [ -f "./.ucc_venv/bin/ucc-gen" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ -f "./.ucc_venv/bin/ucc-gen" ]
if [ -f "./.ucc_venv/bin/ucc-gen" ] ;

echo "ucc-gen not found, please check your requirements_ucc.txt file"
exit 1
fi
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about adding here an else condition with warning message to migrate ucc dependency to a separate file?

@mkolasinski-splunk
Copy link
Contributor

mkolasinski-splunk commented Aug 4, 2025

@kkedziak-splunk I like the idea. I'd suggest we define a policy that says all TA repositories should use the ucc dependency consistently. During a transition period, the action could support both requirements_ucc.txt and pyproject.toml. But long-term, I think we should avoid supporting both formats - just pick one as the final approach.

@kdoroszko-splunk
Copy link

@mbruzda-splunk, I think this solution would require some adjustments in template repository (i.e. ucc version would need to be parsed from requirements_ucc.txt. Also there might be some changes needed in local tests execution manuals).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants