Skip to content

Update pinned latest dep versions #24604

Update pinned latest dep versions

Update pinned latest dep versions #24604

name: Build pull request
# Optional test variants (openj9, windows) are gated by `test openj9` /
# `test windows` labels on the PR, read from the event payload. We
# deliberately do NOT subscribe to `pull_request: [labeled]` — see
# https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/18446
# for the history of why every previous attempt to use that trigger failed.
#
# Practical consequence: adding a `test openj9` / `test windows` label
# doesn't retrigger the build. Push another commit or close/reopen the
# PR to pick it up. `comment-on-test-label.yml` posts a reminder when
# one of those labels is added.
#
# `test native` is detected automatically from the PR's changed paths
# (the `resolve-native` job below). The manual `test native` label is
# still honored as a force-enable.
on:
pull_request:
types:
- opened
- synchronize
- reopened
concurrency:
group: build-pull-request-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Run native tests automatically when the PR touches a library
# instrumentation module with native support (logback-appender, jdbc,
# spring), the native smoke test harness, or the top-level build config
# that affects them.
resolve-native:
runs-on: ubuntu-latest
outputs:
run-native-tests: ${{ steps.filter.outputs.native }}
steps:
- name: Detect native-relevant changes
id: filter
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
# `|| true` so an empty result from `grep -v` (everything filtered)
# doesn't fail the step under pipefail.
files=$(
gh api --paginate "/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" \
--jq '.[].filename' |
grep -Ev '^instrumentation/spring/.+/javaagent/' || true
)
include='^instrumentation/logback/logback-appender-1\.0/library/'
include+='|^instrumentation/jdbc/library/'
include+='|^instrumentation/spring/'
include+='|^smoke-tests-otel-starter/'
include+='|^dependencyManagement/build\.gradle\.kts$'
include+='|^settings\.gradle\.kts$'
if grep -Eq "$include" <<<"$files"; then
echo "native=true" >> "$GITHUB_OUTPUT"
else
echo "native=false" >> "$GITHUB_OUTPUT"
fi
# Build the Servlet smoke-test images only when the PR touches the
# servlet image sources or its workflow definition.
resolve-servlet-images:
runs-on: ubuntu-latest
outputs:
build-servlet-images: ${{ steps.filter.outputs.servlet }}
steps:
- name: Detect servlet-image-relevant changes
id: filter
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
files=$(
gh api --paginate "/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" \
--jq '.[].filename'
)
include='^smoke-tests/images/servlet/'
include+='|^\.github/workflows/reusable-build-servlet-images\.yml$'
if grep -Eq "$include" <<<"$files"; then
echo "servlet=true" >> "$GITHUB_OUTPUT"
else
echo "servlet=false" >> "$GITHUB_OUTPUT"
fi
build:
needs: [resolve-native, resolve-servlet-images]
uses: ./.github/workflows/reusable-pr-build.yml
with:
skip-native-tests: ${{ !(needs.resolve-native.outputs.run-native-tests == 'true' || contains(github.event.pull_request.labels.*.name, 'test native')) }}
skip-openj9-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test openj9') }}
skip-windows-smoke-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test windows') }}
skip-servlet-images: ${{ needs.resolve-servlet-images.outputs.build-servlet-images != 'true' }}