Skip to content

Commit fb1761e

Browse files
authored
Upgrade go-licenses from v1.6.0 to v2.0.0-alpha.1 (#945)
* Upgrade go-licenses from v1.6.0 to v2.0.0-alpha.1 Includes upgrade of github.com/otiai10/copy that is blocking the upgrade of golangci-lint. * Run make update-licenses
1 parent bac277a commit fb1761e

File tree

49 files changed

+3972
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3972
-406
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (C) 2013 Blake Mizerany
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2016 Caleb Spare
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/github.com/golang/protobuf/LICENSE renamed to LICENSES/github.com/google/uuid/LICENSE

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Copyright 2010 The Go Authors. All rights reserved.
1+
Copyright (c) 2009,2014 Google Inc. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without
44
modification, are permitted provided that the following conditions are
55
met:
66

7-
* Redistributions of source code must retain the above copyright
7+
* Redistributions of source code must retain the above copyright
88
notice, this list of conditions and the following disclaimer.
9-
* Redistributions in binary form must reproduce the above
9+
* Redistributions in binary form must reproduce the above
1010
copyright notice, this list of conditions and the following disclaimer
1111
in the documentation and/or other materials provided with the
1212
distribution.
13-
* Neither the name of Google Inc. nor the names of its
13+
* Neither the name of Google Inc. nor the names of its
1414
contributors may be used to endorse or promote products derived from
1515
this software without specific prior written permission.
1616

@@ -25,4 +25,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2525
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2626
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-

LICENSES/github.com/hashicorp/go-version/.circleci/config.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
labels: ["dependencies"]
8+
9+
- package-ecosystem: github-actions
10+
directory: /
11+
schedule:
12+
interval: monthly
13+
labels:
14+
- dependencies
15+
# only update HashiCorp actions, external actions managed by TSCCR
16+
allow:
17+
- dependency-name: hashicorp/*
18+
groups:
19+
github-actions-breaking:
20+
update-types:
21+
- major
22+
github-actions-backward-compatible:
23+
update-types:
24+
- minor
25+
- patch
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: go-tests
2+
3+
on: [push]
4+
5+
env:
6+
TEST_RESULTS: /tmp/test-results
7+
8+
jobs:
9+
10+
go-tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
go-version: [ 1.15.3, 1.19 ]
15+
16+
steps:
17+
- name: Setup go
18+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
19+
with:
20+
go-version: ${{ matrix.go-version }}
21+
22+
- name: Checkout code
23+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
24+
25+
- name: Create test directory
26+
run: |
27+
mkdir -p ${{ env.TEST_RESULTS }}
28+
29+
- name: Download go modules
30+
run: go mod download
31+
32+
- name: Cache / restore go modules
33+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
34+
with:
35+
path: |
36+
~/go/pkg/mod
37+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38+
restore-keys: |
39+
${{ runner.os }}-go-
40+
41+
# Check go fmt output because it does not report non-zero when there are fmt changes
42+
- name: Run gofmt
43+
run: |
44+
go fmt ./...
45+
files=$(go fmt ./...)
46+
if [ -n "$files" ]; then
47+
echo "The following file(s) do not conform to go fmt:"
48+
echo "$files"
49+
exit 1
50+
fi
51+
52+
# Install gotestsum with go get for 1.15.3; otherwise default to go install
53+
- name: Install gotestsum
54+
run: |
55+
GTS="gotest.tools/[email protected]"
56+
# We use the same error message prefix in either failure case, so just define it once here.
57+
ERROR="Failed to install $GTS"
58+
# First try to 'go install', if that fails try 'go get'...
59+
go install "$GTS" || go get "$GTS" || { echo "$ERROR: both 'go install' and 'go get' failed"; exit 1; }
60+
# Check that the gotestsum command was actually installed in the path...
61+
command -v gotestsum > /dev/null 2>&1 || { echo "$ERROR: gotestsum command not installed"; exit 1; }
62+
echo "OK: Command 'gotestsum' installed ($GTS)"
63+
64+
- name: Run go tests
65+
run: |
66+
PACKAGE_NAMES=$(go list ./...)
67+
gotestsum --format=short-verbose --junitfile $TEST_RESULTS/gotestsum-report.xml -- $PACKAGE_NAMES
68+
69+
# Save coverage report parts
70+
- name: Upload and save artifacts
71+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
72+
with:
73+
name: Test Results
74+
path: ${{ env.TEST_RESULTS }}

LICENSES/github.com/hashicorp/go-version/CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
1-
# 1.4.0 (January 5, 2021)
1+
# 1.7.0 (May 24, 2024)
2+
3+
ENHANCEMENTS:
4+
5+
- Remove `reflect` dependency ([#91](https://github.com/hashicorp/go-version/pull/91))
6+
- Implement the `database/sql.Scanner` and `database/sql/driver.Value` interfaces for `Version` ([#133](https://github.com/hashicorp/go-version/pull/133))
7+
8+
INTERNAL:
9+
10+
- [COMPLIANCE] Add Copyright and License Headers ([#115](https://github.com/hashicorp/go-version/pull/115))
11+
- [COMPLIANCE] Update MPL-2.0 LICENSE ([#105](https://github.com/hashicorp/go-version/pull/105))
12+
- Bump actions/cache from 3.0.11 to 3.2.5 ([#116](https://github.com/hashicorp/go-version/pull/116))
13+
- Bump actions/checkout from 3.2.0 to 3.3.0 ([#111](https://github.com/hashicorp/go-version/pull/111))
14+
- Bump actions/upload-artifact from 3.1.1 to 3.1.2 ([#112](https://github.com/hashicorp/go-version/pull/112))
15+
- GHA Migration ([#103](https://github.com/hashicorp/go-version/pull/103))
16+
- github: Pin external GitHub Actions to hashes ([#107](https://github.com/hashicorp/go-version/pull/107))
17+
- SEC-090: Automated trusted workflow pinning (2023-04-05) ([#124](https://github.com/hashicorp/go-version/pull/124))
18+
- update readme ([#104](https://github.com/hashicorp/go-version/pull/104))
19+
20+
# 1.6.0 (June 28, 2022)
21+
22+
FEATURES:
23+
24+
- Add `Prerelease` function to `Constraint` to return true if the version includes a prerelease field ([#100](https://github.com/hashicorp/go-version/pull/100))
25+
26+
# 1.5.0 (May 18, 2022)
27+
28+
FEATURES:
29+
30+
- Use `encoding` `TextMarshaler` & `TextUnmarshaler` instead of JSON equivalents ([#95](https://github.com/hashicorp/go-version/pull/95))
31+
- Add JSON handlers to allow parsing from/to JSON ([#93](https://github.com/hashicorp/go-version/pull/93))
32+
33+
# 1.4.0 (January 5, 2022)
234

335
FEATURES:
436

LICENSES/github.com/hashicorp/go-version/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Versioning Library for Go
2-
[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/master)
2+
![Build Status](https://github.com/hashicorp/go-version/actions/workflows/go-tests.yml/badge.svg)
33
[![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version)
44

55
go-version is a library for parsing versions and version constraints,

LICENSES/github.com/hashicorp/go-version/constraint.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
14
package version
25

36
import (
47
"fmt"
5-
"reflect"
68
"regexp"
79
"sort"
810
"strings"
@@ -163,6 +165,12 @@ func (c *Constraint) Check(v *Version) bool {
163165
return c.f(v, c.check)
164166
}
165167

168+
// Prerelease returns true if the version underlying this constraint
169+
// contains a prerelease field.
170+
func (c *Constraint) Prerelease() bool {
171+
return len(c.check.Prerelease()) > 0
172+
}
173+
166174
func (c *Constraint) String() string {
167175
return c.original
168176
}
@@ -193,7 +201,7 @@ func prereleaseCheck(v, c *Version) bool {
193201
case cPre && vPre:
194202
// A constraint with a pre-release can only match a pre-release version
195203
// with the same base segments.
196-
return reflect.DeepEqual(c.Segments64(), v.Segments64())
204+
return v.equalSegments(c)
197205

198206
case !cPre && vPre:
199207
// A constraint without a pre-release can only match a version without a

0 commit comments

Comments
 (0)