You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "adutra (via GitHub)" <gi...@apache.org> on 2026/10/05 12:19:21 UTC
[PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
adutra opened a new pull request, #5703:
URL: https://github.com/apache/polaris/pull/5703
Adds a `changes` job using dorny/paths-filter to classify a PR's changed files, then gates each ci.yml job on the relevant category (backend, helm, regtests, python-client, docs) so e.g. a docs-only or Helm-only PR no longer runs the full Gradle/integration-test suite. Push events to main/release/feature branches still run everything, since diffing a push reliably is less straightforward than diffing a PR.
Generated-doc files (config-sections, helm reference.md) are explicitly re-included in the backend/helm filters so a hand-edit of a generated file still triggers the job that verifies it's in sync with its generating code.
<!--
π Describe what changes you're proposing, especially breaking or user-facing changes.
π See https://github.com/apache/polaris/blob/main/CONTRIBUTING.md for more.
-->
## Checklist
- [ ] π‘οΈ Don't disclose security issues! (contact security@apache.org)
- [ ] π Clearly explained why the changes are needed, or linked related issues: Fixes #
- [ ] π§ͺ Added/updated tests with good coverage, or manually tested (and explained how)
- [ ] π‘ Added comments for complex logic
- [ ] π§Ύ Updated `CHANGELOG.md` (if needed)
- [ ] π Updated documentation in `site/content/in-dev/unreleased` (if needed)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "orca-review-bot (via GitHub)" <gi...@apache.org>.
orca-review-bot commented on code in PR #5703:
URL: https://github.com/apache/polaris/pull/5703#discussion_r4342249088
##########
.github/workflows/ci.yml:
##########
@@ -442,7 +564,9 @@ jobs:
permissions:
contents: read
needs:
+ - changes
- docker-image-build
+ if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.regtests == 'true'
Review Comment:
Regtests also cover the Python client. The image copies `client/python` (regtests/Dockerfile:51), and `run.sh` runs `../client/python/tests` (regtests/run.sh:57). As written, a PR that only touches `client/python` skips that suite. Can we add `|| needs.changes.outputs.python_client == 'true'` here?
<sub>π€ AI-generated review comment β agents make mistakes, so please verify before acting on it.</sub>
##########
.github/workflows/ci.yml:
##########
@@ -46,13 +125,38 @@ jobs:
uses: ./.github/actions/setup-test-env
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- - name: Run Checks
+ - name: Run RAT license check
env: &gradle_env_vars
GRADLE_TOS_ACCEPTED: ${{ vars.GRADLE_TOS_ACCEPTED }}
DEVELOCITY_SERVER: ${{ vars.DEVELOCITY_SERVER }}
DEVELOCITY_PROJECT_ID: ${{ vars.DEVELOCITY_PROJECT_ID }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # zizmor: ignore[secrets-outside-env]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # zizmor: ignore[secrets-outside-env]
+ run: ./gradlew rat
Review Comment:
On backend PRs, rat runs twice: once here and once inside `build-checks`' `./gradlew check`. Can we skip this job when backend is true, or pass `-x rat` in build-checks?
<sub>π€ AI-generated review comment β agents make mistakes, so please verify before acting on it.</sub>
##########
.github/workflows/ci.yml:
##########
@@ -27,9 +27,88 @@ on:
required: false
jobs:
- build-checks:
- name: Gradle Build Checks
- runs-on: ubuntu-24.04
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
Review Comment:
Every other job pins `ubuntu-24.04`, but this one and `license-check` use `ubuntu-latest`. Can we pin these too?
<sub>π€ AI-generated review comment β agents make mistakes, so please verify before acting on it.</sub>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #5703:
URL: https://github.com/apache/polaris/pull/5703#issuecomment-6218066151
> @snazy are you OK with the changes?
Will check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #5703:
URL: https://github.com/apache/polaris/pull/5703#discussion_r4183933717
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,54 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Filter changed paths
+ id: filter
+ if: github.event_name == 'pull_request'
+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
+ with:
+ filters: |
+ backend:
+ - '**'
+ - '!helm/**'
+ - '!regtests/**'
+ - '!plugins/*/regtests/**'
+ - '!client/python/**'
+ - '!site/**'
+ - '!**/*.md'
+ # Generated from code by `make config-doc-verify`; re-included so a
+ # hand-edit of the generated file (without the code change) still
+ # fails build-checks instead of silently skipping it.
+ - 'site/content/in-dev/unreleased/configuration/config-sections/**'
Review Comment:
Please check whether this explanation and the filter configuration need updating together. The pinned action defaults to `predicate-quantifier: some`, so `**` matches every changed path regardless of the exclusions; docs-only and Helm-only PRs still select the backend suite. Use `some-with-excludes` and a separate generated-config filter combined into the backend output: exclusions are final in that mode, so the generated files cannot be re-included within the same filter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #5703:
URL: https://github.com/apache/polaris/pull/5703#discussion_r4342300092
##########
.github/workflows/ci.yml:
##########
@@ -27,9 +27,88 @@ on:
required: false
jobs:
- build-checks:
- name: Gradle Build Checks
- runs-on: ubuntu-24.04
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
Review Comment:
#5699 changed the ubuntu version from `latest` to `24.04`. Do we want to reverse it here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on PR #5703:
URL: https://github.com/apache/polaris/pull/5703#issuecomment-6124629730
@snazy are you OK with the changes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #5703:
URL: https://github.com/apache/polaris/pull/5703#discussion_r4334635941
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,82 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' || steps.filter.outputs.config_docs == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' || steps.filter.outputs.helm_docs == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ # Needed for git-based diffing below; the default GitHub-API-based mode of
+ # dorny/paths-filter computes changed files against the PR's merge-base, which
+ # misses changes already on the base branch that the PR's test merge commit
+ # actually incorporates. Checking out the PR head and diffing explicitly against
+ # the base branch's current tip (github.event.pull_request.base.sha) avoids that.
+ if: github.event_name == 'pull_request'
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Filter changed paths
+ id: filter
+ if: github.event_name == 'pull_request'
+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
+ with:
+ # Empty token forces git-based diffing (see Checkout step above) instead of
+ # the GitHub-API-based mode, which is otherwise used unconditionally for
+ # pull_request-triggered workflows and ignores the 'base' input below.
+ token: ''
+ # A commit SHA (rather than a branch name) makes paths-filter diff directly
+ # against this commit instead of computing a merge-base with it.
+ base: ${{ github.event.pull_request.base.sha }}
+ # 'some-with-excludes' makes the '!'-prefixed patterns below true exclusions.
+ # With the default 'some', a lone '**' already matches every file and the
+ # exclusions are evaluated as independent (and so mostly moot) match patterns,
+ # meaning every PR would select the backend suite regardless of what changed.
+ predicate-quantifier: 'some-with-excludes'
+ filters: |
+ backend:
+ - '**'
+ - '!helm/**'
+ - '!regtests/**'
+ - '!plugins/*/regtests/**'
+ - '!client/python/**'
+ - '!site/**'
+ - '!**/*.md'
Review Comment:
RAT checks runs via Gradle.
PRs containing changes that match only the excluded patterns would miss the RAT checks, potentially causing `main` CI and other PR CI to fail.
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,82 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' || steps.filter.outputs.config_docs == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' || steps.filter.outputs.helm_docs == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ # Needed for git-based diffing below; the default GitHub-API-based mode of
+ # dorny/paths-filter computes changed files against the PR's merge-base, which
+ # misses changes already on the base branch that the PR's test merge commit
+ # actually incorporates. Checking out the PR head and diffing explicitly against
+ # the base branch's current tip (github.event.pull_request.base.sha) avoids that.
+ if: github.event_name == 'pull_request'
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
Review Comment:
This changes clones the full history for every PR, and every gated job waits on it.
Fetching only the base SHA and the head would be enough (aka: remove the line).
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,82 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' || steps.filter.outputs.config_docs == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' || steps.filter.outputs.helm_docs == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ # Needed for git-based diffing below; the default GitHub-API-based mode of
+ # dorny/paths-filter computes changed files against the PR's merge-base, which
+ # misses changes already on the base branch that the PR's test merge commit
+ # actually incorporates. Checking out the PR head and diffing explicitly against
+ # the base branch's current tip (github.event.pull_request.base.sha) avoids that.
+ if: github.event_name == 'pull_request'
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
Review Comment:
The comment above says diffing the PR head against the base tip catches base-branch changes. A three-dot diff or a SHA diff uses the merge-base, so that reasoning is probably wrong.
`changes` also checks out `head.sha`, while the other jobs use the merge ref, so they may see different trees.
A PR touching only docs or helm could then skip backend jobs even though the merged tree has backend changes.
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,82 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' || steps.filter.outputs.config_docs == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' || steps.filter.outputs.helm_docs == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ # Needed for git-based diffing below; the default GitHub-API-based mode of
+ # dorny/paths-filter computes changed files against the PR's merge-base, which
+ # misses changes already on the base branch that the PR's test merge commit
+ # actually incorporates. Checking out the PR head and diffing explicitly against
+ # the base branch's current tip (github.event.pull_request.base.sha) avoids that.
+ if: github.event_name == 'pull_request'
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Filter changed paths
+ id: filter
+ if: github.event_name == 'pull_request'
+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
+ with:
+ # Empty token forces git-based diffing (see Checkout step above) instead of
+ # the GitHub-API-based mode, which is otherwise used unconditionally for
+ # pull_request-triggered workflows and ignores the 'base' input below.
+ token: ''
+ # A commit SHA (rather than a branch name) makes paths-filter diff directly
+ # against this commit instead of computing a merge-base with it.
+ base: ${{ github.event.pull_request.base.sha }}
+ # 'some-with-excludes' makes the '!'-prefixed patterns below true exclusions.
+ # With the default 'some', a lone '**' already matches every file and the
+ # exclusions are evaluated as independent (and so mostly moot) match patterns,
+ # meaning every PR would select the backend suite regardless of what changed.
+ predicate-quantifier: 'some-with-excludes'
+ filters: |
+ backend:
Review Comment:
If a file in one of those paths is a build or test input (for example `site/it` or a `*.md` test resource), the `backend` jobs are skipped. (Skipped counts as success.)
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,82 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' || steps.filter.outputs.config_docs == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' || steps.filter.outputs.helm_docs == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ # Needed for git-based diffing below; the default GitHub-API-based mode of
+ # dorny/paths-filter computes changed files against the PR's merge-base, which
+ # misses changes already on the base branch that the PR's test merge commit
+ # actually incorporates. Checking out the PR head and diffing explicitly against
+ # the base branch's current tip (github.event.pull_request.base.sha) avoids that.
+ if: github.event_name == 'pull_request'
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Filter changed paths
+ id: filter
+ if: github.event_name == 'pull_request'
+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
+ with:
+ # Empty token forces git-based diffing (see Checkout step above) instead of
+ # the GitHub-API-based mode, which is otherwise used unconditionally for
+ # pull_request-triggered workflows and ignores the 'base' input below.
+ token: ''
+ # A commit SHA (rather than a branch name) makes paths-filter diff directly
+ # against this commit instead of computing a merge-base with it.
+ base: ${{ github.event.pull_request.base.sha }}
+ # 'some-with-excludes' makes the '!'-prefixed patterns below true exclusions.
+ # With the default 'some', a lone '**' already matches every file and the
+ # exclusions are evaluated as independent (and so mostly moot) match patterns,
+ # meaning every PR would select the backend suite regardless of what changed.
+ predicate-quantifier: 'some-with-excludes'
+ filters: |
+ backend:
+ - '**'
+ - '!helm/**'
+ - '!regtests/**'
+ - '!plugins/*/regtests/**'
+ - '!client/python/**'
+ - '!site/**'
+ - '!**/*.md'
+ helm:
+ - 'helm/**'
+ regtests:
+ - 'regtests/**'
+ - 'plugins/*/regtests/**'
+ python_client:
+ - 'client/python/**'
+ docs:
Review Comment:
The `site` job now runs only for docs changes.
A backend change that feeds generated docs, such as config-section generation, won't build the site until after merge.
##########
.github/workflows/ci.yml:
##########
@@ -27,8 +27,82 @@ on:
required: false
jobs:
+ changes:
+ name: Detect Changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ backend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.backend == 'true' || steps.filter.outputs.config_docs == 'true' }}
+ helm: ${{ github.event_name != 'pull_request' || steps.filter.outputs.helm == 'true' || steps.filter.outputs.helm_docs == 'true' }}
+ regtests: ${{ github.event_name != 'pull_request' || steps.filter.outputs.regtests == 'true' }}
+ python_client: ${{ github.event_name != 'pull_request' || steps.filter.outputs.python_client == 'true' }}
+ docs: ${{ github.event_name != 'pull_request' || steps.filter.outputs.docs == 'true' }}
+ steps:
+ - name: Checkout
+ # Needed for git-based diffing below; the default GitHub-API-based mode of
+ # dorny/paths-filter computes changed files against the PR's merge-base, which
+ # misses changes already on the base branch that the PR's test merge commit
+ # actually incorporates. Checking out the PR head and diffing explicitly against
+ # the base branch's current tip (github.event.pull_request.base.sha) avoids that.
+ if: github.event_name == 'pull_request'
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Filter changed paths
+ id: filter
+ if: github.event_name == 'pull_request'
+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
+ with:
+ # Empty token forces git-based diffing (see Checkout step above) instead of
+ # the GitHub-API-based mode, which is otherwise used unconditionally for
+ # pull_request-triggered workflows and ignores the 'base' input below.
+ token: ''
+ # A commit SHA (rather than a branch name) makes paths-filter diff directly
+ # against this commit instead of computing a merge-base with it.
+ base: ${{ github.event.pull_request.base.sha }}
+ # 'some-with-excludes' makes the '!'-prefixed patterns below true exclusions.
+ # With the default 'some', a lone '**' already matches every file and the
+ # exclusions are evaluated as independent (and so mostly moot) match patterns,
+ # meaning every PR would select the backend suite regardless of what changed.
+ predicate-quantifier: 'some-with-excludes'
+ filters: |
+ backend:
+ - '**'
+ - '!helm/**'
+ - '!regtests/**'
+ - '!plugins/*/regtests/**'
+ - '!client/python/**'
+ - '!site/**'
+ - '!**/*.md'
+ helm:
+ - 'helm/**'
Review Comment:
`helm-doc-verify` runs inside `helm-tests`, which needs `docker-image-build`.
A hand edit to `helm-chart/reference.md` triggers the full helm matrix and image build.
The check also depends on that whole chain succeeding.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #5703:
URL: https://github.com/apache/polaris/pull/5703#issuecomment-6011727533
I like the idea!
The `dorny/paths-filter` uses GitHubβs PR files API to list the files changed by the PR against the [_"git merge-base to find the best common ancestor between current branch (HEAD) and base"_](https://github.com/dorny/paths-filter/blob/master/README.md#usage). That will miss changes made (only) on the target branch, because it only considers changes relative to to its base.
Pull-request CI checks out the merge commit of the PR branch against the current state of target branch, and provides that merge-commit SHA in `PR_BASE_SHA`.
What the action _should_ do is this (in incomplete pseudo-shell-script code):
```bash
event_name="${EVENT_NAME:-workflow_dispatch}"
pr_base_sha="${PR_BASE_SHA:-}"
push_before_sha="${PUSH_BEFORE_SHA:-}"
head_sha="${HEAD_SHA:-$(git rev-parse HEAD)}"
if [ "$event_name" = "pull_request" ]; then
# Use the merge commit created by GitHub for the PR against _current_ state of the target branch.
base_sha="$PR_BASE_SHA"
else
base_sha="$PUSH_BEFORE_SHA"
fi
# Use Git to retrieve the list of changed files against the correct base.
# (Should use a bash-array though - to handle spaces in file names.)
changed_files="$(git diff --name-only "$base_sha" "$head_sha")"
# extract "should run job XYZ" flags - for example using regex patterns.
...
```
Maybe less relevant, but noteworthy: The [list pull request files](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2026-03-10#list-pull-requests-files] documents a limit of 3000 returned files, so the action may miss files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Skip CI jobs unaffected by a PR's changed paths [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra merged PR #5703:
URL: https://github.com/apache/polaris/pull/5703
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org