[AURON #2444] Add build branch and build reversion info - #2445
Conversation
| JAVA_VERSION=$(java -version 2>&1 | head -n 1 | awk '{print $3}' | tr -d '"') | ||
| PROJECT_VERSION=$(./build/mvn help:evaluate -N -Dexpression=project.version -Pspark-${SPARK_VER} -q -DforceStdout 2>/dev/null) | ||
| RUST_VERSION=$(rustc --version | awk '{print $2}') | ||
| BUILD_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) |
There was a problem hiding this comment.
Thanks for the contribution! In the release workflows, actions/checkout checks out ${{ github.event.pull_request.head.sha }}, which leaves the repository in detached HEAD state. In that case, git rev-parse --abbrev-ref HEAD records HEAD rather than the actual source branch, so the branch metadata will not be useful for CI-built artifacts. Could we support an explicit build-branch environment variable, populated from github.head_ref/github.ref_name, and fall back to Git only for local builds? Please also make sure the value is forwarded into Docker builds.
| JAVA_VERSION=$(java -version 2>&1 | head -n 1 | awk '{print $3}' | tr -d '"') | ||
| PROJECT_VERSION=$(./build/mvn help:evaluate -N -Dexpression=project.version -Pspark-${SPARK_VER} -q -DforceStdout 2>/dev/null) | ||
| RUST_VERSION=$(rustc --version | awk '{print $2}') | ||
| BUILD_BRANCH="${AURON_BUILD_BRANCH:-$(git rev-parse --abbrev-ref HEAD 2>/dev/null)}" |
There was a problem hiding this comment.
Thanks for adding the override and forwarding it into Docker. However, none of the workflows currently sets AURON_BUILD_BRANCH, so release jobs that check out ${{ github.event.pull_request.head.sha }} still fall back to git rev-parse and record build.branch=HEAD. Please populate the override in the relevant workflows, for example with ${{ github.head_ref || github.ref_name }}. The revision override could similarly use ${{ github.event.pull_request.head.sha || github.sha }} to make the recorded source explicit.
|
|
||
| - name: Build auron-${{ matrix.sparkver }}_${{ matrix.scalaver }} | ||
| env: | ||
| AURON_BUILD_BRANCH: ${{ github.head_ref || github.ref_name }} |
There was a problem hiding this comment.
These variables are not consumed because this job invokes build/mvn directly, while the build-info file is generated only by auron-build.sh. As a result, the ARM artifacts will still miss the branch and revision metadata. Could this job use auron-build.sh, or explicitly generate the build-info file before invoking Maven?
There was a problem hiding this comment.
Got it. I’ve already updated the job to use auron-build.sh to build ARM artifacts. @slfan1989
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
|
@zhaohehuhu Thanks for the contribution! Merged into the master. |
Which issue does this PR close?
Closes #2444
Rationale for this change
Auron build information currently includes component versions and build timestamp, but it does not identify the Git branch or commit used to produce the artifact. This makes it harder to trace a running application or built package back to the exact source revision.
What changes are included in this PR?
This PR adds Git branch and revision information to the Auron build info file.
Are there any user-facing changes?
No.
How was this patch tested?
Rebuild
Was this patch authored or co-authored using generative AI tooling?