Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior changes based on version of git available (uses Github REST API on Ubuntu 18.04) #238

Open
rngadam opened this issue May 8, 2020 · 12 comments

Comments

@rngadam
Copy link

rngadam commented May 8, 2020

The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git 2.18 or higher to the PATH

This is quite confusing, I was trying to execute git operation on the repo and because it's from the REST API I can't... This is running on my own self-hosted runner.

Is this a new requirement? I thought this worked previously. I would prefer the workflow to fail instead - if not given a specific option to use the Github REST API.

Run actions/checkout@v21s
Resolved version clientdriver-client-android-releases-98f84cbf41dc1c59f53aab0785fe2c6428e352e8
Run actions/checkout@v2
  with:
    ref: refs/heads/ea-238
    repository: clientdriver/client-android-releases
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    fetch-depth: 1
    lfs: false
    submodules: false
Syncing repository: clientdriver/client-android-releases
Getting Git version info
  Working directory is '/home/clientbotuser/build/github-actions-runner/clientdriver/client-android-releases/_work/client-android-releases/client-android-releases'
  /usr/bin/git version
  git version 2.17.1
Deleting the contents of '/home/clientbotuser/build/github-actions-runner/clientdriver/client-android-releases/_work/client-android-releases/client-android-releases'
The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git 2.18 or higher to the PATH
Downloading the archive
Writing archive to disk
Extracting the archive
/bin/tar xz -C /home/clientbotuser/build/github-actions-runner/clientdriver/client-android-releases/_work/client-android-releases/client-android-releases/93eb6aa8-321e-4ac4-bed8-b9ad394505db -f /home/clientbotuser/build/github-actions-runner/clientdriver/client-android-releases/_work/client-android-releases/client-android-releases/93eb6aa8-321e-4ac4-bed8-b9ad394505db.tar.gz
Resolved version clientdriver-client-android-releases-98f84cbf41dc1c59f53aab0785fe2c6428e352e8

workaround on Ubuntu 18.04

latest official is 2.17 on Ubuntu 18.04

sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y

this gives me git 2.26.

@rngadam rngadam changed the title "The repository will be downloaded using the GitHub REST API" Behavior changes based on version of git available (uses Github REST API on Ubuntu 18.04) May 8, 2020
lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 8, 2020
lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 9, 2020
Created both an introductory and a developer's notes vignette, updated README
and docs with examples, added a second biocViews term, fixed some small
bugs/typos.

Related links (as many as I could remember):

* https://rstd.io/tidytools19
* https://twitter.com/CVWickham
* https://twitter.com/hadleywickham
* https://www.rstudio.com/products/rstudio/download
* https://comunidadbioinfo.github.io/post/building-tidy-tools-cdsb-runconf-2019/#.XrbLMxNKiu4
* http://bioconductor.org/
* https://lcolladotor.github.io/pkgs/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-March/016365.html
* https://www.bioconductor.org/help/docker/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016532.html
* https://github.com/features/actions
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016650.html
* r-lib/actions#84
* r-lib/usethis#1108
* r-lib/styler#636
* Bioconductor/BiocCheck#57
* Bioconductor/bioconductor.org#54
* http://bioconductor.org/developers/how-to/coding-style/
* https://style.tidyverse.org/
* https://twitter.com/lorenzwalthert
* https://twitter.com/mt_morgan
* https://docs.travis-ci.com/user/languages/r/
* r-lib/pkgdown#1206
* r-lib/pkgdown#1230
* https://twitter.com/jimhester_
* https://www.jimhester.com/talk/2020-rsc-github-actions/
* https://github.com/Bioconductor/BBS
* https://github.com/Bioconductor/packagebuilder
* https://www.appveyor.com/
* r-hub/rhub#52
* r-hub/rhub#38
* https://www.tidyverse.org/blog/2020/04/usethis-1-6-0/
* https://github.com/r-lib/actions/tree/master/examples
* https://yihui.org/en/2018/03/second-pull-request/
* https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
* https://help.github.com/en/actions
* https://ropenscilabs.github.io/actions_sandbox/
* https://twitter.com/seandavis12
* https://github.com/seandavi/BiocActions/blob/master/.github/workflows/main.yml
* https://twitter.com/CSoneson
* https://github.com/csoneson/dreval/blob/master/.github/workflows/R-CMD-check.yaml
* https://bioc-community.herokuapp.com/
* https://github.com/leekgroup/derfinderPlot/blob/master/.github/workflows/check-bioc.yml
* https://github.com/LieberInstitute/recount3/blob/master/.github/workflows/check-bioc.yml
* https://github.com/hpages
* r-lib/actions#68
* r-lib/actions#85
* https://twitter.com/opencpu
* https://community.rstudio.com/u/const-ae
* https://community.rstudio.com/t/compiler-support-fo-c-14-features-on-windows/57284/4
* r-lib/xml2#296
* r-lib/xml2#302
* https://github.com/r-lib/usethis/blob/master/.github/workflows/R-CMD-check.yaml
* https://github.com/r-lib/usethis/commits/master/.github/workflows/R-CMD-check.yaml
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016703.html
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/thread.html
* r-lib/remotes#296
* r-lib/actions#86
* r-lib/covr#427
* https://github.com/r-lib/actions/blob/master/examples/pr-commands.yaml
* https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04
* r-lib/actions#50
* actions/checkout#238
* https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/Dockerfile_rstudio_4.0.0-ubuntu18.04
* https://twitter.com/niteshturaga
* https://twitter.com/cboettig
* rocker-org/rocker-versioned#208
* https://github.community/t5/GitHub-Actions/bd-p/actions
* https://www.r-consortium.org/blog/2020/03/18/cdsb-diversity-and-outreach-hotspot-in-mexico
* https://github.com/maxheld83
* r-lib/actions#87
* https://github.com/yutannihilation
@ericsciple
Copy link
Contributor

Are you using a job-container? I just checked git --version on ubuntu-18.04 and it has git version 2.26.2

@rngadam
Copy link
Author

rngadam commented May 25, 2020

@ericsciple I'm using a Github self-hosted runner on a EC2 server.

So this is referring to the version available by default on Ubuntu 18.04 of git:

https://packages.ubuntu.com/bionic/vcs/git

@ericsciple
Copy link
Contributor

Ah ok, makes sense. The behavior is expected. When Git 2.18 or higher is not in the path, the action falls back to download the tarball. 2.18 is required because the action downloads a single SHA by default which requires git wire protocol v2 (available in git 2.18 or higher)

@rngadam
Copy link
Author

rngadam commented May 26, 2020

@ericsciple yes, so what I'm saying is I don't think it should do that because the output is different (tarball vs git) and it's extremely confusing. Should fail-fast and require 2.18 (except if explicitly given a flag to fallback to this behavior).

@ericsciple
Copy link
Contributor

Could potentially change behavior if we ever do a checkout v3.

Would disrupt existing users to change v2 behavior now.

@ericsciple
Copy link
Contributor

On the bright side, should get better with time :)

Git 2.18 was released mid 2018.

@electrum
Copy link

We ran into this confusing issue as well with a self-hosted runner, since our build requires the .git directory to exist and it doesn't when using the archive.

@Simran-B
Copy link

FWIW yum install git on CentOS 7 installs Git 1.8 something. My workaround is to install a later version using https://ius.io/ in my Docker container (Git 2.24 Core in this case):

yum install -y \
    https://repo.ius.io/ius-release-el7.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum swap -y git git224-core

Things like git rev-parse --short HEAD should work then, which in my case linuxdeployqt uses to determine the short SHA to add it to to the AppImage name.

Would be nice if there was a way to get the full as well as the short commit hash from the action as output even if the REST API is used, see #281

@haampie
Copy link

haampie commented Aug 25, 2020

Requiring a git version not installable via apt-get install git in the oldest Ubuntu LTS release is frankly just absurd. It is a hard requirement if you need submodules too...

@Simran-B
Copy link

Simran-B commented Sep 16, 2020

If you use GitHub Actions, then you can also use the GITHUB_SHA environment variable.
In bash scripts it can be shortened like so: ${GITHUB_SHA::8}
Using cmd on Windows it should be: %GITHUB_SHA:~0,8%

@ahvigil
Copy link

ahvigil commented Nov 3, 2020

i agree with previous comments that this is somewhat confusing behavior- the checkout action doesn't actually do a checkout?

@wp-jm
Copy link

wp-jm commented Sep 6, 2022

Ran into this as well, spent a few days debugging in other places because the checkout action was effectively a "dog not barking." The tarball checkout is semantically wrong; at the very least a tarball containing the same artifacts as if a true git clone was performed should be provided. This behavior will, for example, silently corrupt/break builds in python packages that depend on setuptools_scm as the call to get_version will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants