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

fetch no longer works with just --branch #87

Closed
brikis98 opened this issue Feb 1, 2021 · 1 comment · Fixed by #88
Closed

fetch no longer works with just --branch #87

brikis98 opened this issue Feb 1, 2021 · 1 comment · Fixed by #88
Labels
bug Something isn't working

Comments

@brikis98
Copy link
Member

brikis98 commented Feb 1, 2021

It looks like adding --ref in #79 may have broken the --branch parameter.

With fetch version v0.3.9:

gruntwork-install \
  --module-name "gcp-helpers" \
  --repo "https://github.com/gruntwork-io/terraform-google-ci" \
  --branch "gcp-helpers"

Works as follows:

2021-02-01 14:10:38 [INFO] [gruntwork-install] Installing from gcp-helpers...
2021-02-01 14:10:38 [INFO] [gruntwork-install] Downloading module gcp-helpers from https://github.com/gruntwork-io/terraform-google-ci
Downloading latest commit from branch "gcp-helpers" of https://github.com/gruntwork-io/terraform-google-ci ...
Extracting files from <repo>/modules/gcp-helpers to /tmp/gruntwork-script-modules/gcp-helpers ...
Download and file extraction complete.
2021-02-01 14:10:39 [INFO] [gruntwork-install] Setting GRUNTWORK_INSTALL_TAG to 
2021-02-01 14:10:39 [INFO] [gruntwork-install] Setting GRUNTWORK_INSTALL_BRANCH to gcp-helpers
2021-02-01 14:10:39 [INFO] [gruntwork-install] Executing /tmp/gruntwork-script-modules/gcp-helpers/install.sh 

But with fetch version v0.3.13:

2021-02-01 13:31:02 [INFO] [gruntwork-install] Installing from gcp-helpers...
2021-02-01 13:31:02 [INFO] [gruntwork-install] Downloading module gcp-helpers from https://github.com/gruntwork-io/terraform-google-ci
Downloading git reference "v0.1.0" of https://github.com/gruntwork-io/terraform-google-ci ...
Extracting files from <repo>/modules/gcp-helpers to /tmp/gruntwork-script-modules/gcp-helpers ... 0 files extracted
Download and file extraction complete.
2021-02-01 13:31:02 [ERROR] [gruntwork-install] No files were downloaded. Are you sure "gcp-helpers" is a valid Script Module in https://github.com/gruntwork-io/terraform-google-ci (tag = , branch = gcp-helpers)?

I'm guessing the way GitRef is set here to latestTag is causing the code to go down the wrong code path.

@brikis98 brikis98 added bug Something isn't working help wanted labels Feb 1, 2021
@robmorgan
Copy link
Contributor

I can see you've come across the errors. Using an older version, everything is okay:

❯ ~/Downloads/fetch_darwin_amd64_0_3_11 --repo="https://github.com/gruntwork-io/terraform-google-ci" --branch="gcp-helpers" --source-path="/modules/gcp-helpers" "/tmp/download-dir/gcp-helpers"
Downloading latest commit from branch "gcp-helpers" of https://github.com/gruntwork-io/terraform-google-ci ...
Extracting files from <repo>/modules/gcp-helpers to /tmp/download-dir/gcp-helpers ... 3 files extracted
Download and file extraction complete.

However when I try with v0.3.13:

❯ ~/Downloads/fetch_darwin_amd64_0_3_13 --repo="https://github.com/gruntwork-io/terraform-google-ci" --branch="gcp-helpers" --source-path="/modules/gcp-helpers" "/tmp/download-dir/gcp-helpers"
Downloading git reference "v0.1.0" of https://github.com/gruntwork-io/terraform-google-ci ...
Extracting files from <repo>/modules/gcp-helpers to /tmp/download-dir/gcp-helpers ... 0 files extracted
Download and file extraction complete.

It attempts to pull files from the latest tag. I haven't tracked down the offending code yet. cc @brikis98, @pete0emerson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants