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

nywilken/bump submodules 2.2.1 #427

Closed
wants to merge 54 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8c9292b
Split request options from client into a new request struct (#230)
azr Feb 4, 2020
ec2266f
ChecksumFromFile: change checksummedURL to checksummedPath for clarity
azr Feb 4, 2020
8bdb487
make Get return GetResult (#231)
azr Feb 4, 2020
e5a1b1a
Allow to not download local files and simply reference them 'inplace'…
azr Feb 4, 2020
e2a2806
Change module path to github.com/hashicorp/go-getter/v2
azr Feb 6, 2020
7cc4779
use correct go-getter/v2 for cmd
azr Mar 3, 2020
0b1d527
Retrieve checksum from subfolder/filename (#239)
sylviamoss Mar 18, 2020
41fc410
Merge pull request #246 from hashicorp/master
azr Apr 28, 2020
ad57569
Create client GetChecksum (#245)
sylviamoss May 11, 2020
3107ec4
Create cmd/go-getter/v2, s3/v2 and gcs/v2 submodules (#244)
azr May 11, 2020
7b188ca
gcs&s3: use a git sha from v2 branch to require go-getter/v2
azr May 14, 2020
5b5e571
Make checksum func public (#252)
azr May 18, 2020
872c8ed
Getters refactoring (#255)
sylviamoss Jun 4, 2020
a6995fa
use v2/helper (#258)
sylviamoss Jun 4, 2020
d282f24
deps: Update github.com/ulikunitz/xz@v0.5.8 (#279)
nywilken Sep 30, 2020
4d89f82
Remove broken bitbucket link
mdeggies Sep 28, 2020
da52711
Use default AWS credential chain under normal circumstances (#218)
jbergknoff-rival Sep 1, 2020
d436e03
feat(detector): provide a detector for repository hosted on GitLab.co…
azr Sep 30, 2020
2798df5
detector/bitbucket: Remove support for hg URL schema (#280)
nywilken Sep 30, 2020
3310219
Update v2 branch with code from the master branch (#282)
azr Oct 8, 2020
0054847
enable GitHub code scanning workflow (#295) (#297)
finnigja Jan 4, 2021
d38eed1
fixes 320: Pass context to NewRequestWithContext so HTTP requests can…
zeisss Jun 3, 2021
ea452ad
Append tar and ova decompressor (#351)
LeConTesteur Jan 31, 2022
976c908
Ignore comments in checksum files (#350)
azr Feb 1, 2022
a3884fc
[v2] update s3 gcs and cmd to use most recent v2 module (#352)
azr Feb 10, 2022
4e45866
Remove ova type from list of decompressors (#354)
nywilken Mar 21, 2022
38e9738
Multiple fixes for go-getter v2 (#361)
nywilken May 19, 2022
5ec880f
Update X-Terraform-Get error messaging to match v1 (#364)
nywilken May 20, 2022
31c3313
Update default client Getters (#363)
nywilken May 23, 2022
106ef8d
[v2] update s3 gcs and cmd to use most recent v2 module (#365)
nywilken May 23, 2022
d10f069
docs: provide logging recommendations (#371) (#372)
nywilken Jun 30, 2022
4dc8b7d
Add Timeout to SmbClientGetter to go-getter/v2 (#369)
nywilken Jul 7, 2022
7f9f4aa
inital migration of v2 to gha
claire-labry Oct 6, 2022
7f7e928
Update get_hg_test.go
claire-labry Oct 25, 2022
170dcda
Update get_hg_test.go
claire-labry Oct 26, 2022
94f60d1
Merge pull request #388 from hashicorp/migrate-v2-to-gha
claire-labry Oct 26, 2022
5cc10e9
upgrade AWS SDK version
kmoe Oct 12, 2022
60afa72
Update go mod sum file for updated s3 module
nywilken Oct 26, 2022
cb3ab9c
Merge pull request #385 from hashicorp/update-aws-lib-version
nywilken Oct 26, 2022
f4436ce
add s3 directory
claire-labry Oct 27, 2022
1849dda
remove init from s3 file
claire-labry Oct 27, 2022
498fa6f
fix my grammar
claire-labry Oct 27, 2022
049d4d0
Merge pull request #392 from hashicorp/fix-go-tests
claire-labry Oct 27, 2022
211d65f
Add Malformed S3 URL test (#380)
nywilken Nov 29, 2022
492324c
[v2] update s3, gcs and cmd to use most recent v2 module version (#400)
nywilken Nov 30, 2022
017a2ee
Port Decompression bomb security changes from v1 (#414)
nywilken Feb 10, 2023
d666f9a
Bump all modules to Go 1.18
nywilken Sep 29, 2022
d91ea8b
[V2] Bump submodules to use most recent v2 module version
nywilken Feb 13, 2023
4092854
v2/cmd/go-getter: Bump go-getter submodule versions
nywilken Feb 13, 2023
5d2281b
Merge pull request #413 from hashicorp/limited-decompressors-helper
shoenig Feb 10, 2023
d5cdddb
Update Go-Getter test workflow to run on pull requests to v2 branch
nywilken Feb 13, 2023
79d9081
Port bomb.zip test updates from v1 (#425)
nywilken Mar 13, 2023
9414ac5
[v2] update s3, gcs and cmd to use most recent v2 module version
nywilken Mar 16, 2023
1a895fd
Retrigger ci
nywilken Mar 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add s3 directory
update test s3 bucket name

let see if s3 tests work now

try matrix for multiple directories

try to fix GCS tests

move go tests after GCS auth

Revert "move go tests after GCS auth"

This reverts commit 7adfd47.

move go tests after GCS auth

comment out other workflows

go mod tidy

go mod tidy

comment out go cmd for now

Revert "go mod tidy"

This reverts commit 416722c.

remove helper directory

revert go mod

add go cmd

go mod tidy for GCS

go mod tidy for cmd
  • Loading branch information
claire-labry committed Oct 27, 2022
commit f4436ce60b0ddcc727a77d3c4c5a3e47f5f32e09
24 changes: 17 additions & 7 deletions .github/workflows/go-getter.yml
Original file line number Diff line number Diff line change
@@ -15,6 +15,10 @@ jobs:
- 1.17
- 1.18
- 1.19
directory:
- s3
- gcs
- .
permissions:
id-token: write
contents: read
@@ -80,6 +84,7 @@ jobs:
diff tmpdir/go.mod go.mod

- name: Run Go tests
working-directory: ${{ matrix.directory }}
run: |
PACKAGE_NAMES=$(go list ./...)
echo "Running $(echo $PACKAGE_NAMES | wc -w) packages"
@@ -101,6 +106,10 @@ jobs:
- 1.17
- 1.18
- 1.19
directory:
- s3
- gcs
- .
permissions:
id-token: write
contents: read
@@ -112,7 +121,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v3

@@ -127,11 +136,11 @@ jobs:
${{ runner.os }}-go-
- name: Download go modules
run: go mod download

- name: Install gotestsum
shell: bash
run: go install gotest.tools/gotestsum@v1.8.2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
@@ -146,7 +155,7 @@ jobs:
workload_identity_provider: 'projects/328212837253/locations/global/workloadIdentityPools/hc-go-getter-test/providers/github-hc-go-getter-test'
service_account: hc-go-getter-test@hc-e56c0f7c21c448d2be9e7696073.iam.gserviceaccount.com
audience: https://github.com/hashicorp

- name: Run Go cmd
run: |
cd cmd/go-getter
@@ -155,6 +164,7 @@ jobs:

- name: Run Go tests
shell: bash
working-directory: ${{ matrix.directory }}
run: |
PACKAGE_NAMES=$(go list ./...)
echo "Running $(echo $PACKAGE_NAMES | wc -w) packages"
@@ -167,7 +177,7 @@ jobs:
with:
name: windows test results
path: ${{ env.TEST_RESULTS_PATH }}

go-smb-tests:
runs-on: ubuntu-latest
strategy:
@@ -184,7 +194,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v3

@@ -200,4 +210,4 @@ jobs:
docker-compose up -d

- name: Run SMB getter tests
run: docker exec -i gogetter bash -c "env ACC_SMB_TEST=1 go test -v ./... -run=TestSmb_"
run: docker exec -i gogetter bash -c "env ACC_SMB_TEST=1 go test -v ./... -run=TestSmb_"
4 changes: 1 addition & 3 deletions cmd/go-getter/go.mod
Original file line number Diff line number Diff line change
@@ -9,11 +9,9 @@ replace (
)

require (
github.com/cheggaaa/pb v1.0.28
github.com/fatih/color v1.9.0 // indirect
github.com/cheggaaa/pb v1.0.29
github.com/hashicorp/go-getter/gcs/v2 v2.1.0
github.com/hashicorp/go-getter/s3/v2 v2.1.0
github.com/hashicorp/go-getter/v2 v2.1.0
github.com/mattn/go-runewidth v0.0.8 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
)
756 changes: 716 additions & 40 deletions cmd/go-getter/go.sum

Large diffs are not rendered by default.

43 changes: 11 additions & 32 deletions gcs/get_gcs_test.go
Original file line number Diff line number Diff line change
@@ -13,35 +13,21 @@ import (
urlhelper "github.com/hashicorp/go-getter/v2/helper/url"
)

// initGCPCredentials writes a temporary GCS credentials file if necessary and
// returns the path and a function to clean it up. allAuthenticatedUsers can
// access go-getter-test with read only access.
func initGCPCredentials(t *testing.T) func() {
if gc := os.Getenv("GOOGLE_CREDENTIALS"); gc != "" &&
os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" {
file, cleanup := testing_helper.TempFileWithContent(t, gc)
os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", file)
return func() {
os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", "")
cleanup()
}
}
return func() {}
}
// Note for external contributors: In order to run the GCS test suite, you will only be able to be run
// in GitHub Actions when you open a PR.

func TestGetter_impl(t *testing.T) {
var _ getter.Getter = new(Getter)
}

func TestGetter(t *testing.T) {
defer initGCPCredentials(t)()

g := new(Getter)
dst := testing_helper.TempDir(t)
ctx := context.Background()

req := &getter.Request{
Src: "www.googleapis.com/storage/v1/go-getter-test/go-getter/folder",
Src: "www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/folder",
Dst: dst,
}

@@ -63,14 +49,13 @@ func TestGetter(t *testing.T) {
}

func TestGetter_subdir(t *testing.T) {
defer initGCPCredentials(t)()

g := new(Getter)
dst := testing_helper.TempDir(t)
ctx := context.Background()

req := &getter.Request{
Src: "www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder",
Src: "www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/folder/subfolder",
Dst: dst,
}

@@ -92,15 +77,14 @@ func TestGetter_subdir(t *testing.T) {
}

func TestGetter_GetFile(t *testing.T) {
defer initGCPCredentials(t)()

g := new(Getter)
dst := testing_helper.TempTestFile(t)
defer os.RemoveAll(filepath.Dir(dst))
ctx := context.Background()

req := &getter.Request{
Src: "www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/main.tf",
Src: "www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/folder/main.tf",
Dst: dst,
GetMode: getter.ModeFile,
}
@@ -129,7 +113,7 @@ func TestGetter_GetFile_notfound(t *testing.T) {
ctx := context.Background()

req := &getter.Request{
Src: "https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/404.tf",
Src: "https://www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/folder/404.tf",
Dst: dst,
}

@@ -145,14 +129,13 @@ func TestGetter_GetFile_notfound(t *testing.T) {
}

func TestGetter_Mode_dir(t *testing.T) {
defer initGCPCredentials(t)()

g := new(Getter)
ctx := context.Background()

// Check client mode on a key prefix with only a single key.
mode, err := g.Mode(ctx,
urlhelper.MustParse("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder"))
urlhelper.MustParse("https://www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/folder/subfolder"))
if err != nil {
t.Fatalf("err: %s", err)
}
@@ -162,14 +145,13 @@ func TestGetter_Mode_dir(t *testing.T) {
}

func TestGetter_Mode_file(t *testing.T) {
defer initGCPCredentials(t)()

g := new(Getter)
ctx := context.Background()

// Check client mode on a key prefix which contains sub-keys.
mode, err := g.Mode(ctx,
urlhelper.MustParse("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder/sub.tf"))
urlhelper.MustParse("https://www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/folder/subfolder/sub.tf"))
if err != nil {
t.Fatalf("err: %s", err)
}
@@ -179,15 +161,13 @@ func TestGetter_Mode_file(t *testing.T) {
}

func TestGetter_Mode_notfound(t *testing.T) {
defer initGCPCredentials(t)()

g := new(Getter)
ctx := context.Background()

// Check the client mode when a non-existent key is looked up. This does not
// return an error, but rather should just return the file mode.
mode, err := g.Mode(ctx,
urlhelper.MustParse("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/foobar"))
urlhelper.MustParse("https://www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/foobar"))
if err != nil {
t.Fatalf("err: %s", err)
}
@@ -197,7 +177,6 @@ func TestGetter_Mode_notfound(t *testing.T) {
}

func TestGetter_Url(t *testing.T) {
defer initGCPCredentials(t)()

var gcstests = []struct {
name string
@@ -207,8 +186,8 @@ func TestGetter_Url(t *testing.T) {
}{
{
name: "test1",
url: "https://www.googleapis.com/storage/v1/go-getter-test/go-getter/foo/null.zip",
bucket: "go-getter-test",
url: "https://www.googleapis.com/storage/v1/hc-go-getter-test/go-getter/foo/null.zip",
bucket: "hc-go-getter-test",
path: "go-getter/foo/null.zip",
},
}
16 changes: 14 additions & 2 deletions gcs/go.mod
Original file line number Diff line number Diff line change
@@ -5,7 +5,19 @@ go 1.14
replace github.com/hashicorp/go-getter/v2 => ../

require (
cloud.google.com/go/storage v1.6.0
cloud.google.com/go/compute v1.12.1 // indirect
cloud.google.com/go/compute/metadata v0.1.1 // indirect
cloud.google.com/go/storage v1.27.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter/v2 v2.1.0
google.golang.org/api v0.21.0
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
golang.org/x/oauth2 v0.1.0 // indirect
google.golang.org/api v0.101.0
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect
)
Loading