aloof-appointment-30987
01/12/2023, 4:21 PMdevelop
branch on the git remote?
Does it work with ./pants --changed-since=develop tailor
Does it work with ./pants --changed-since=main test tailor
(or whatever you name your main brach)?abundant-analyst-12845
01/12/2023, 4:26 PM./pants --changed-since=origin/develop tailor
there are no errorsabundant-analyst-12845
01/12/2023, 4:29 PMenough-analyst-54434
01/12/2023, 4:30 PMabundant-analyst-12845
01/12/2023, 4:31 PMpants-unit-test.yaml
name: Pants Unit Test
on:
pull_request:
branches:
- "*"
push:
branches:
- develop
# Or when manually dispatched
workflow_dispatch:
jobs:
build:
name: Perform CI Checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9.* ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Bootstrap pants and manges 2-3 GHA caches
uses: pantsbuild/actions/init-pants@v2
# This action bootstraps pants and manages 2-3 GHA caches.
# See: <http://github.com/pantsbuild/actions/tree/main/init-pants/|github.com/pantsbuild/actions/tree/main/init-pants/>
with:
pants-python-version: ${{ matrix.python-version }}
# cache0 makes it easy to bust the cache if needed
# just increase the integer to start with a fresh cache
gha-cache-key: cache0-py${{ matrix.python-version }}
# The Python backend uses named_caches for Pip/PEX state,
# so it is appropriate to invalidate on lockfile changes.
named-caches-hash: ${{ hashFiles('3rdparty/python/common.lock') }}
# If you're not using a fine-grained remote caching service (see <https://www.pantsbuild.org/docs/remote-caching>),
# then you may also want to preserve the local Pants cache (lmdb_store). However this must invalidate for
# changes to any file that can affect the build, so may not be practical in larger repos.
# A remote cache service integrates with Pants's fine-grained invalidation and avoids these problems.
# cache-lmdb-store: 'true' # defaults to 'false'
# Note that named_caches and lmdb_store falls back to partial restore keys which
# may give a useful partial result that will save time over completely clean state,
# but will cause the cache entry to grow without bound over time.
# See <https://pants.readme.io/docs/using-pants-in-ci> for tips on how to periodically clean it up.
# Alternatively you change gha-cache-key to ignore old caches.
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Check BUILD files
run: |
./pants --changed-since=origin/develop tailor
./pants --changed-since=origin/develop update-build-files
- name: Lint
run: |
./pants lint ::
- name: Test Everything
run: |
./pants test ::
abundant-analyst-12845
01/12/2023, 4:33 PMabundant-analyst-12845
01/12/2023, 4:34 PMenough-analyst-54434
01/12/2023, 4:40 PMfetch-depth: 1
? That's clearly the problem.enough-analyst-54434
01/12/2023, 4:45 PMfetch-depth: 0
to start with: https://github.com/actions/checkout#usage
That will get you all history, which is slowest, but also ensures all commit ranges will be present. Since you are asking for a commit range with --changed-since, a fetch depth of 1 is always the incorrect answer. It must be 2 or greater. Picking a number though is also fraught with peril, you may pick 10 which is usually enough, but sometimes not. Those sometimes failures will likely be confusing; so picking 0 is safe.abundant-analyst-12845
01/12/2023, 4:47 PMenough-analyst-54434
01/12/2023, 4:47 PMabundant-analyst-12845
01/12/2023, 4:47 PMenough-analyst-54434
01/12/2023, 4:47 PMso is it just hte range of how many refs it check that is the issueI think so, yes.
abundant-analyst-12845
01/12/2023, 4:47 PMenough-analyst-54434
01/12/2023, 4:48 PMabundant-analyst-12845
01/12/2023, 4:48 PMenough-analyst-54434
01/12/2023, 4:48 PMenough-analyst-54434
01/12/2023, 5:02 PMabundant-analyst-12845
01/12/2023, 5:35 PM