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

Chore: 1216-update-go-python-and-dependencies #1217

Merged
merged 5 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 9 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,15 @@ jobs:
build:
name: test
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.allow_failure }}
continue-on-error: false
timeout-minutes: 30
strategy:
fail-fast: true
matrix:
go: [1.17, 1.18, 1.19]
run_long_tests: [no]
allow_failure: [false]
include:
# Disable this for now as it's not clear how to select the latest master branch
# version of go using actions/setup-go@v2.
# - go: master
# run_long_tests: no
# allow_failure: true
- go: 1.18
run_long_tests: yes
allow_failure: false

env:
NO_FTP_ACCESS: yes
BOTO_CONFIG: /dev/null
GO111MODULE: "on"
GOPROXY: "https://proxy.golang.org"
GOVER: '1.21'

steps:
- name: Checkout repository
Expand All @@ -53,7 +39,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
go-version: ${{ env.GOVER }}

- name: Get aptly version
run: |
Expand All @@ -63,12 +49,13 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.54.2
args: --timeout=5m

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.11'

- name: Install O/S packages
run: |
Expand All @@ -89,21 +76,19 @@ jobs:

- name: Make
env:
RUN_LONG_TESTS: ${{ matrix.run_long_tests }}
RUN_LONG_TESTS: 'yes'
AZURE_STORAGE_ENDPOINT: "127.0.0.1:10000"
AZURE_STORAGE_ACCOUNT: "devstoreaccount1"
AZURE_STORAGE_ACCESS_KEY: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
run: |
COVERAGE_DIR=${{ runner.temp }} make

- name: Merge code coverage
if: matrix.run_long_tests == 'yes'
run: |
go install github.com/wadey/gocovmerge@latest
~/go/bin/gocovmerge unit.out ${{ runner.temp }}/*.out > coverage.txt

- name: Upload code coverage
if: matrix.run_long_tests == 'yes'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -122,7 +107,7 @@ jobs:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4

- name: Make Release
env:
Expand Down
4 changes: 2 additions & 2 deletions azure/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}

// MkDir creates directory recursively under public path
func (storage *PublishedStorage) MkDir(path string) error {
func (storage *PublishedStorage) MkDir(_ string) error {

Check warning on line 86 in azure/public.go

View check run for this annotation

Codecov / codecov/patch

azure/public.go#L86

Added line #L86 was not covered by tests
// no op for Azure
return nil
}
Expand Down Expand Up @@ -145,7 +145,7 @@
}

// RemoveDirs removes directory structure under public path
func (storage *PublishedStorage) RemoveDirs(path string, progress aptly.Progress) error {
func (storage *PublishedStorage) RemoveDirs(path string, _ aptly.Progress) error {
filelist, err := storage.Filelist(path)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/config_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/smira/commander"
)

func aptlyConfigShow(cmd *commander.Command, args []string) error {
func aptlyConfigShow(_ *commander.Command, _ []string) error {

config := context.Config()
prettyJSON, err := json.MarshalIndent(config, "", " ")
Expand Down
4 changes: 2 additions & 2 deletions cmd/mirror_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func aptlyMirrorList(cmd *commander.Command, args []string) error {
return aptlyMirrorListTxt(cmd, args)
}

func aptlyMirrorListTxt(cmd *commander.Command, args []string) error {
func aptlyMirrorListTxt(cmd *commander.Command, _ []string) error {
var err error

raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
Expand Down Expand Up @@ -65,7 +65,7 @@ func aptlyMirrorListTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlyMirrorListJSON(cmd *commander.Command, args []string) error {
func aptlyMirrorListJSON(_ *commander.Command, _ []string) error {
var err error

repos := make([]*deb.RemoteRepo, context.NewCollectionFactory().RemoteRepoCollection().Len())
Expand Down
4 changes: 2 additions & 2 deletions cmd/mirror_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func aptlyMirrorShow(cmd *commander.Command, args []string) error {
return aptlyMirrorShowTxt(cmd, args)
}

func aptlyMirrorShowTxt(cmd *commander.Command, args []string) error {
func aptlyMirrorShowTxt(_ *commander.Command, args []string) error {
var err error

name := args[0]
Expand Down Expand Up @@ -93,7 +93,7 @@ func aptlyMirrorShowTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlyMirrorShowJSON(cmd *commander.Command, args []string) error {
func aptlyMirrorShowJSON(_ *commander.Command, args []string) error {
var err error

name := args[0]
Expand Down
4 changes: 2 additions & 2 deletions cmd/publish_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func aptlyPublishList(cmd *commander.Command, args []string) error {
return aptlyPublishListTxt(cmd, args)
}

func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
func aptlyPublishListTxt(cmd *commander.Command, _ []string) error {
var err error

raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
Expand Down Expand Up @@ -77,7 +77,7 @@ func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlyPublishListJSON(cmd *commander.Command, args []string) error {
func aptlyPublishListJSON(_ *commander.Command, _ []string) error {
var err error

repos := make([]*deb.PublishedRepo, 0, context.NewCollectionFactory().PublishedRepoCollection().Len())
Expand Down
4 changes: 2 additions & 2 deletions cmd/publish_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func aptlyPublishShow(cmd *commander.Command, args []string) error {
return aptlyPublishShowTxt(cmd, args)
}

func aptlyPublishShowTxt(cmd *commander.Command, args []string) error {
func aptlyPublishShowTxt(_ *commander.Command, args []string) error {
var err error

distribution := args[0]
Expand Down Expand Up @@ -76,7 +76,7 @@ func aptlyPublishShowTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlyPublishShowJSON(cmd *commander.Command, args []string) error {
func aptlyPublishShowJSON(_ *commander.Command, args []string) error {
var err error

distribution := args[0]
Expand Down
4 changes: 2 additions & 2 deletions cmd/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func aptlyRepoList(cmd *commander.Command, args []string) error {
return aptlyRepoListTxt(cmd, args)
}

func aptlyRepoListTxt(cmd *commander.Command, args []string) error {
func aptlyRepoListTxt(cmd *commander.Command, _ []string) error {
var err error

raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
Expand Down Expand Up @@ -71,7 +71,7 @@ func aptlyRepoListTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlyRepoListJSON(cmd *commander.Command, args []string) error {
func aptlyRepoListJSON(_ *commander.Command, _ []string) error {
var err error

repos := make([]*deb.LocalRepo, context.NewCollectionFactory().LocalRepoCollection().Len())
Expand Down
4 changes: 2 additions & 2 deletions cmd/repo_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func aptlyRepoShow(cmd *commander.Command, args []string) error {
return aptlyRepoShowTxt(cmd, args)
}

func aptlyRepoShowTxt(cmd *commander.Command, args []string) error {
func aptlyRepoShowTxt(_ *commander.Command, args []string) error {
var err error

name := args[0]
Expand Down Expand Up @@ -58,7 +58,7 @@ func aptlyRepoShowTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlyRepoShowJSON(cmd *commander.Command, args []string) error {
func aptlyRepoShowJSON(_ *commander.Command, args []string) error {
var err error

name := args[0]
Expand Down
4 changes: 2 additions & 2 deletions cmd/snapshot_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
return aptlySnapshotListTxt(cmd, args)
}

func aptlySnapshotListTxt(cmd *commander.Command, args []string) error {
func aptlySnapshotListTxt(cmd *commander.Command, _ []string) error {
var err error

raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
Expand Down Expand Up @@ -59,7 +59,7 @@ func aptlySnapshotListTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlySnapshotListJSON(cmd *commander.Command, args []string) error {
func aptlySnapshotListJSON(cmd *commander.Command, _ []string) error {
var err error

sortMethodString := cmd.Flag.Lookup("sort").Value.Get().(string)
Expand Down
4 changes: 2 additions & 2 deletions cmd/snapshot_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func aptlySnapshotShow(cmd *commander.Command, args []string) error {
return aptlySnapshotShowTxt(cmd, args)
}

func aptlySnapshotShowTxt(cmd *commander.Command, args []string) error {
func aptlySnapshotShowTxt(_ *commander.Command, args []string) error {
var err error
name := args[0]
collectionFactory := context.NewCollectionFactory()
Expand Down Expand Up @@ -85,7 +85,7 @@ func aptlySnapshotShowTxt(cmd *commander.Command, args []string) error {
return err
}

func aptlySnapshotShowJSON(cmd *commander.Command, args []string) error {
func aptlySnapshotShowJSON(_ *commander.Command, args []string) error {
var err error

name := args[0]
Expand Down
7 changes: 3 additions & 4 deletions cmd/task_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@
text, _ = reader.ReadString('\n')
if text == "\n" {
break
} else {
text = strings.TrimSpace(text) + ","
parsedArgs, _ := shellwords.Parse(text)
cmdArgs = append(cmdArgs, parsedArgs...)
}
text = strings.TrimSpace(text) + ","
parsedArgs, _ := shellwords.Parse(text)
cmdArgs = append(cmdArgs, parsedArgs...)

Check warning on line 68 in cmd/task_run.go

View check run for this annotation

Codecov / codecov/patch

cmd/task_run.go#L66-L68

Added lines #L66 - L68 were not covered by tests
}

if len(cmdArgs) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion console/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (p *Progress) Flush() {
}

// InitBar starts progressbar for count bytes or count items
func (p *Progress) InitBar(count int64, isBytes bool, barType aptly.BarType) {
func (p *Progress) InitBar(count int64, isBytes bool, _ aptly.BarType) {
if p.bar != nil {
panic("bar already initialized")
}
Expand Down
6 changes: 3 additions & 3 deletions context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func (context *AptlyContext) pgpProvider() string {
return provider
}

func (context *AptlyContext) getGPGFinder(provider string) pgp.GPGFinder {
func (context *AptlyContext) getGPGFinder() pgp.GPGFinder {
switch context.pgpProvider() {
case "gpg1":
return pgp.GPG1Finder()
Expand All @@ -480,7 +480,7 @@ func (context *AptlyContext) GetSigner() pgp.Signer {
return &pgp.GoSigner{}
}

return pgp.NewGpgSigner(context.getGPGFinder(provider))
return pgp.NewGpgSigner(context.getGPGFinder())
}

// GetVerifier returns Verifier with respect to provider
Expand All @@ -493,7 +493,7 @@ func (context *AptlyContext) GetVerifier() pgp.Verifier {
return &pgp.GoVerifier{}
}

return pgp.NewGpgVerifier(context.getGPGFinder(provider))
return pgp.NewGpgVerifier(context.getGPGFinder())
}

// UpdateFlags sets internal copy of flags in the context
Expand Down
4 changes: 2 additions & 2 deletions deb/changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@
}

// MatchesDependency implements PackageLike interface
func (c *Changes) MatchesDependency(d Dependency) bool {
func (c *Changes) MatchesDependency(_ Dependency) bool {

Check warning on line 223 in deb/changes.go

View check run for this annotation

Codecov / codecov/patch

deb/changes.go#L223

Added line #L223 was not covered by tests
return false
}

// MatchesArchitecture implements PackageLike interface
func (c *Changes) MatchesArchitecture(arch string) bool {
func (c *Changes) MatchesArchitecture(_ string) bool {

Check warning on line 228 in deb/changes.go

View check run for this annotation

Codecov / codecov/patch

deb/changes.go#L228

Added line #L228 was not covered by tests
return false
}

Expand Down
2 changes: 1 addition & 1 deletion deb/package_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
}

// Search is not implemented
func (collection *PackageCollection) Search(dep Dependency, allMatches bool) (searchResults []*Package) {
func (collection *PackageCollection) Search(_ Dependency, _ bool) (searchResults []*Package) {

Check warning on line 320 in deb/package_collection.go

View check run for this annotation

Codecov / codecov/patch

deb/package_collection.go#L320

Added line #L320 was not covered by tests
panic("Not implemented")
}

Expand Down
10 changes: 5 additions & 5 deletions deb/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
}

// Fast is false
func (q *NotQuery) Fast(list PackageCatalog) bool {
func (q *NotQuery) Fast(_ PackageCatalog) bool {
return false
}

Expand Down Expand Up @@ -197,7 +197,7 @@
}

// Fast depends on the query
func (q *FieldQuery) Fast(list PackageCatalog) bool {
func (q *FieldQuery) Fast(_ PackageCatalog) bool {
return false
}

Expand Down Expand Up @@ -265,7 +265,7 @@
}

// Fast is always true for package query
func (q *PkgQuery) Fast(list PackageCatalog) bool {
func (q *PkgQuery) Fast(_ PackageCatalog) bool {
return true
}

Expand All @@ -280,12 +280,12 @@
}

// Matches on specific properties
func (q *MatchAllQuery) Matches(pkg PackageLike) bool {
func (q *MatchAllQuery) Matches(_ PackageLike) bool {
return true
}

// Fast is always true for match all query
func (q *MatchAllQuery) Fast(list PackageCatalog) bool {
func (q *MatchAllQuery) Fast(_ PackageCatalog) bool {

Check warning on line 288 in deb/query.go

View check run for this annotation

Codecov / codecov/patch

deb/query.go#L288

Added line #L288 was not covered by tests
return true
}

Expand Down
2 changes: 1 addition & 1 deletion deb/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ ok:
}

// DownloadPackageIndexes downloads & parses package index files
func (repo *RemoteRepo) DownloadPackageIndexes(progress aptly.Progress, d aptly.Downloader, verifier pgp.Verifier, collectionFactory *CollectionFactory,
func (repo *RemoteRepo) DownloadPackageIndexes(progress aptly.Progress, d aptly.Downloader, verifier pgp.Verifier, _ *CollectionFactory,
ignoreMismatch bool) error {
if repo.packageList != nil {
panic("packageList != nil")
Expand Down
Loading
Loading