diff --git a/.github/workflows/archery.yml b/.github/workflows/archery.yml index b7321a7f65d..0bc88faea55 100644 --- a/.github/workflows/archery.yml +++ b/.github/workflows/archery.yml @@ -49,7 +49,9 @@ jobs: fetch-depth: 0 - name: Git Fixup shell: bash - run: git branch master origin/master || true + run: | + DEFAULT_BRANCH=${{ github.event.repository.default_branch }} + git branch $DEFAULT_BRANCH origin/$DEFAULT_BRANCH || true - name: Setup Python uses: actions/setup-python@v1 with: diff --git a/.github/workflows/comment_bot.yml b/.github/workflows/comment_bot.yml index 3d89c532267..989becb979e 100644 --- a/.github/workflows/comment_bot.yml +++ b/.github/workflows/comment_bot.yml @@ -57,16 +57,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/pr-fetch@master + - uses: r-lib/actions/pr-fetch@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: See what is different run: | set -ex + DEFAULT_BRANCH=${{ github.event.repository.default_branch }} git remote add upstream https://github.com/apache/arrow git fetch upstream changed() { - git diff --name-only HEAD..upstream/master | grep -e "$1" >/dev/null 2>&1 + git diff --name-only HEAD..upstream/$DEFAULT_BRANCH | grep -e "$1" >/dev/null 2>&1 } if changed '^r/.*\.R$'; then echo "R_DOCS=true" >> $GITHUB_ENV @@ -115,7 +116,7 @@ jobs: --clang_format_binary=clang-format-${CLANG_TOOLS} \ --exclude_glob=cpp/build-support/lint_exclusions.txt \ --source_dir=r/src --quiet --fix - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 if: env.R_DOCS == 'true' || env.R_CODE == 'true' || endsWith(github.event.comment.body, 'everything') - name: Update R docs if: env.R_DOCS == 'true' || endsWith(github.event.comment.body, 'everything') @@ -131,7 +132,7 @@ jobs: if: env.R_CODE == 'true' || endsWith(github.event.comment.body, 'everything') shell: Rscript {0} run: | - changed_files <- system("git diff --name-only HEAD..upstream/master 2>&1", intern = TRUE) + changed_files <- system("git diff --name-only HEAD..upstream/${{ github.event.repository.default_branch }} 2>&1", intern = TRUE) # only grab the .R files under r/ changed_files <- grep('^r/.*\\.R$', changed_files, value = TRUE) # remove latin1 which is unstylable due to encoding and codegen.R which is unique @@ -145,7 +146,7 @@ jobs: git config user.name "$(git log -1 --pretty=format:%an)" git config user.email "$(git log -1 --pretty=format:%ae)" git commit -a -m 'Autoformat/render all the things [automated commit]' || echo "No changes to commit" - - uses: r-lib/actions/pr-push@master + - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -155,18 +156,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/pr-fetch@master + - uses: r-lib/actions/pr-fetch@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Rebase on ${{ github.repository }} master + - name: Rebase on ${{ github.repository }} default branch run: | set -ex git config user.name "$(git log -1 --pretty=format:%an)" git config user.email "$(git log -1 --pretty=format:%ae)" git remote add upstream https://github.com/${{ github.repository }} - git fetch --unshallow upstream master - git rebase upstream/master - - uses: r-lib/actions/pr-push@master + git fetch --unshallow upstream ${{ github.event.repository.default_branch }} + git rebase upstream/${{ github.event.repository.default_branch }} + - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} args: "--force" diff --git a/.github/workflows/dev_pr.yml b/.github/workflows/dev_pr.yml index 86a5c98f8a6..8a9487b4edc 100644 --- a/.github/workflows/dev_pr.yml +++ b/.github/workflows/dev_pr.yml @@ -22,6 +22,7 @@ on: # push: # branches: # - master + # - main pull_request_target: types: - opened diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index c60e3fa4142..37bdea8f6ab 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -200,12 +200,12 @@ jobs: restore-keys: r-${{ matrix.config.rtools }}-ccache-mingw- # We use the makepkg-mingw setup that is included in rtools40 even when # we use the rtools35 compilers, so we always install R 4.0/Rtools40 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 with: r-version: "4.1" rtools-version: 40 Ncpus: 2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 if: ${{ matrix.config.rtools == 35 }} with: rtools-version: 35 @@ -303,13 +303,13 @@ jobs: path: ccache key: r-${{ matrix.rtools }}-ccache-mingw-${{ hashFiles('cpp/**') }} restore-keys: r-${{ matrix.rtools }}-ccache-mingw- - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 if: ${{ matrix.rtools == 40 }} with: r-version: "4.1" rtools-version: 40 Ncpus: 2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 if: ${{ matrix.rtools == 35 }} with: rtools-version: 35 @@ -327,7 +327,7 @@ jobs: - name: Install cpp11 (on R 3.6) # Since we force installation of binary packages below, dependency versions # are frozen for old versions of R. We need newer cpp11 than is available as - # "binary" (though it doesn't matter because the cpp11 R package is just a + # "binary" (though it doesn't matter because the cpp11 R package is just a # vehicle for the header-only C++ code. if: ${{ matrix.rtools == 35 }} shell: Rscript {0} diff --git a/ci/detect-changes.py b/ci/detect-changes.py index 14e71ed48ce..7669639ecd3 100644 --- a/ci/detect-changes.py +++ b/ci/detect-changes.py @@ -135,7 +135,7 @@ def list_github_actions_affected_files(): """ # GitHub Actions checkout `refs/remotes/pull/$PR/merge` where `HEAD` points # to the merge commit while `HEAD^` points to the commit before. Hence, - # `..HEAD^` points to all commit between master and the PR. + # `..HEAD^` points to all commit between the default branch and the PR. return list_affected_files("HEAD^..") @@ -228,9 +228,9 @@ def run_from_travis(): perr("Environment variables (excerpt):") dump_env_vars('TRAVIS_', '(BRANCH|COMMIT|PULL)') if (os.environ['TRAVIS_REPO_SLUG'] == 'apache/arrow' and - os.environ['TRAVIS_BRANCH'] == 'master' and + os.environ['TRAVIS_BRANCH'] in ['master', 'main'] and os.environ['TRAVIS_EVENT_TYPE'] != 'pull_request'): - # Never skip anything on master builds in the official repository + # Never skip anything on default-branch builds in the official repo affected = dict.fromkeys(ALL_TOPICS, True) else: desc = get_travis_commit_description() diff --git a/ci/scripts/install_kartothek.sh b/ci/scripts/install_kartothek.sh index 4d88943b6a9..b715f5cf849 100755 --- a/ci/scripts/install_kartothek.sh +++ b/ci/scripts/install_kartothek.sh @@ -28,9 +28,7 @@ karthothek=$1 target=$2 git clone --recurse-submodules https://github.com/JDASoftwareGroup/kartothek "${target}" -if [ "${kartothek}" = "master" ]; then - git -C "${target}" checkout master; -elif [ "${kartothek}" = "latest" ]; then +if [ "${kartothek}" = "latest" ]; then git -C "${target}" checkout $(git describe --tags); else git -C "${target}" checkout ${kartothek}; diff --git a/ci/scripts/install_turbodbc.sh b/ci/scripts/install_turbodbc.sh index 3e644a3e27a..e9ac26c2cc8 100755 --- a/ci/scripts/install_turbodbc.sh +++ b/ci/scripts/install_turbodbc.sh @@ -28,9 +28,7 @@ turbodbc=$1 target=$2 git clone --recurse-submodules https://github.com/blue-yonder/turbodbc "${target}" -if [ "${turbodbc}" = "master" ]; then - git -C "${target}" checkout master; -elif [ "${turbodbc}" = "latest" ]; then +if [ "${turbodbc}" = "latest" ]; then git -C "${target}" checkout $(git describe --tags); else git -C "${target}" checkout ${turbodbc}; diff --git a/ci/scripts/python_benchmark.sh b/ci/scripts/python_benchmark.sh index 3a35298dc04..8c4ebfc89cb 100755 --- a/ci/scripts/python_benchmark.sh +++ b/ci/scripts/python_benchmark.sh @@ -32,7 +32,8 @@ export PYARROW_WITH_GANDIVA=0 pushd $ARROW_PYTHON_DIR # Workaround for https://github.com/airspeed-velocity/asv/issues/631 -git fetch --depth=100 origin master:master +DEFAULT_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@) +git fetch --depth=100 origin $DEFAULT_BRANCH:$DEFAULT_BRANCH # Generate machine information (mandatory) asv machine --yes # Run benchmarks on the changeset being tested