Python Ecosystem: Added build_script and build_info.json for nv-ingest-api#8076
Conversation
|
@OpenSource-Edge-for-IBM-Tool-1 |
|
|
||
| # Variables | ||
| PACKAGE_NAME=nv-ingest-api | ||
| PACKAGE_VERSION=${1:-25.6.2} |
There was a problem hiding this comment.
🔴 HIGH SEVERITY | 🔒 SECURITY
Issue: The PACKAGE_VERSION variable accepts user input without validation. This could allow injection of malicious commands or invalid version strings that could break the build or compromise security.
Details:
Suggestion:
Add input validation to ensure PACKAGE_VERSION matches expected version format (e.g., using regex pattern matching): if [[ ! "$PACKAGE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Invalid version format"; exit 1; fi🤖 Generated by Bob Shell Code Review | Line 23
| exit 1 | ||
| fi | ||
| cd "$PACKAGE_DIR" || exit | ||
| git checkout "$PACKAGE_VERSION" || exit |
There was a problem hiding this comment.
🔴 HIGH SEVERITY | 📝 FUNCTIONALITY
Issue: The 'git checkout' command uses '|| exit' but doesn't provide a meaningful error message. If the version tag doesn't exist, the script will fail silently without proper logging.
Details:
Suggestion: Add proper error handling: if ! git checkout "$PACKAGE_VERSION"; then echo "------------------$PACKAGE_NAME:checkout_fails---------------------------------------"; echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | $SOURCE | Fail | Checkout_Fails"; exit 1; fi
🤖 Generated by Bob Shell Code Review | Line 63
Distro Owner PR Review Checklist
PACKAGE_URLpoints to the correct source — it should be a GitHub repository link. If not, identify the correct GitHub source and update the build script accordingly (follow the steps provided in the PR Validation Process).Note:
PACKAGE_URLshould never be a.tararchive link.PACKAGE_VERSIONmatches the version required by your project.PR Validation Process
Use a ppc64le VM with at least 8 GB RAM (more is recommended, as insufficient RAM may cause random build failures).
Run the
<package-name>.shscript provided in this PR inside a fresh UBI 9.3 container (i.e.,sh <package-name>.sh).Ensure that the build script execution ends with a message like:
"Pass | Both_Install_and_Test_Success"
If the build script fails and you identify a fix required in the
<package-name>.shscript to achieve successful execution, follow these steps:Disclaimer: Auto-generated PRs will be marked as closed if no action is taken before the next weekly scan. Closing auto PRs is a manual task performed by the Python ecosystem team.