Skip to content

feat: support external source URL for build testing#1179

Merged
sachintu47 merged 2 commits into
mainfrom
workflow_updat
May 8, 2026
Merged

feat: support external source URL for build testing#1179
sachintu47 merged 2 commits into
mainfrom
workflow_updat

Conversation

@sachintu47
Copy link
Copy Markdown
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Content Update

Category

  • zopen build framework
  • zopen package manager
  • Documentation
  • CI/CD
  • Tools

Description

Support external source URL for build testing

Related Issues

  • Related Issue #
  • Closes #

[optional] Are there any post-deployment tasks or follow-up actions required?

@sachintu47
Copy link
Copy Markdown
Member Author

augment review

1 similar comment
@sachintu47
Copy link
Copy Markdown
Member Author

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 7, 2026

🤖 Augment PR Summary

Summary: Adds support for building/testing against an alternate “source” repository URL during CI-driven Jenkins builds.

Changes:

  • Adds reusable-workflow inputs source_url and use_pr_source_url and forwards the chosen value to Jenkins as PORT_SOURCE_URL
  • Updates the Jenkins-triggering workflow to enable using the PR head repo clone URL as the source URL
  • Extends bin/zopen-build to accept ZOPEN_SOURCE_URL, overriding ZOPEN_DEV_URL/ZOPEN_STABLE_URL
  • Plumbs PORT_SOURCE_URL through the Jenkins build script into ZOPEN_SOURCE_URL

Technical Notes: Intended to allow Jenkins test builds to consume code from forks/alternate repos while keeping the port repository/branch selection unchanged.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread .github/workflows/jenkins-test.yml Outdated
secrets: inherit
with:
repo: 'https://github.com/zopencommunity/metaport.git'
git_source_url: ${{ github.event.pull_request.head.repo.clone_url }}
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 7, 2026

Choose a reason for hiding this comment

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

.github/workflows/jenkins-test.yml:28 — This references github.event.pull_request..., but this workflow also runs on issue_comment events where github.event.pull_request isn’t populated, so git_source_url may end up empty and the external-source feature won’t be exercised for /run tests triggers.

Severity: medium

Other Locations
  • .github/workflows/build_and_test.yml:66

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread .github/workflows/build_and_test.yml Outdated
JENKINS_JOB_URL="${{ vars.JENKINS_HOST_URL }}/job/Port-Build/buildWithParameters?token=jenkinstest&cause=${ENCODED_CAUSE}"

RESPONSE=$(curl -k -X POST -s -i -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" "${JENKINS_JOB_URL}" -F PORT_GITHUB_REPO="${repo}" -F PORT_DESCRIPTION="Github CI Test of ${repo}" -F PORT_BRANCH="${branch}" ${BUILD_BRANCH_OPT})
RESPONSE=$(curl -k -X POST -s -i -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" "${JENKINS_JOB_URL}" -F PORT_GITHUB_REPO="${repo}" -F PORT_DESCRIPTION="Github CI Test of ${repo}" -F PORT_BRANCH="${branch}" ${GIT_SOURCE_URL_OPT} ${BUILD_BRANCH_OPT})
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 7, 2026

Choose a reason for hiding this comment

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

.github/workflows/build_and_test.yml:81 — Expanding ${GIT_SOURCE_URL_OPT} unquoted means a git_source_url containing whitespace or curl form metacharacters could be split into multiple args or interpreted unexpectedly (e.g., values beginning with @ / < can trigger file upload semantics with curl -F). Since this ultimately comes from workflow inputs/PR data, it’s worth ensuring the value can’t alter the curl invocation.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@sachintu47 sachintu47 marked this pull request as ready for review May 8, 2026 02:19
Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

secrets: inherit
with:
repo: 'https://github.com/zopencommunity/metaport.git'
use_pr_source_url: true
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 8, 2026

Choose a reason for hiding this comment

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

In .github/workflows/jenkins-test.yml:28, use_pr_source_url: true is passed for all triggers, including workflow_dispatch where there is no PR payload. That can cause the called workflow to try to read PR API data that doesn’t exist (or fail the request step), so the manual dispatch path may break.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

if [ -z "${branch}" ]; then
branch="${{ fromJson(steps.request.outputs.data).head.ref }}"
fi
if ${{ inputs.use_pr_source_url }}; then
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 8, 2026

Choose a reason for hiding this comment

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

In .github/workflows/build_and_test.yml:70, the use_pr_source_url path assumes steps.request.outputs.data contains valid PR JSON and immediately runs fromJson(...). For non-PR callers (e.g., workflow_dispatch or other workflow_call users), the request route may be empty and fromJson/field access can fail.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread bin/zopen-build
stable build URL (either git or tarball).

Optional:
ZOPEN_SOURCE_URL If set, use this as ZOPEN_URL before checking
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 8, 2026

Choose a reason for hiding this comment

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

In bin/zopen-build:53, help text adds ZOPEN_SOURCE_URL as an override, but the “Required” section above still states ZOPEN_DEV_URL/ZOPEN_STABLE_URL are required for DEV/STABLE builds. With the new behavior, those URLs aren’t required when ZOPEN_SOURCE_URL is set, so the help output is now misleading.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Member

@IgorTodorovskiIBM IgorTodorovskiIBM left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@sachintu47 sachintu47 merged commit 77af439 into main May 8, 2026
1 of 2 checks passed
@sachintu47 sachintu47 deleted the workflow_updat branch May 8, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants