Skip to content

Commit 6b9d8e5

Browse files
authoredJun 13, 2019
Downloader helper user agent (#227)
* add global variables and Info struct in order to inject build time values via ldflags * replace cli.AppName with global variable global.GetAppName() getter * replaced cli.Version var with global getter * add .idea to .gitignore * re organize imports * add license to global.go * add hardcoded fallback version string * organize imports step2 * organize imports step3 * replace cli.AppName with global variable global.GetAppName() getter * add User-Agent header to downloader helper configuration * add testing for user agent-string generation * re organize imports * refactor global package into version package and rename and replace having cli login,logout,validate removed * refactor versioning variables in version package and implement Info struct wihth String method * refactor Info cosntructor to use directly package vars and renamed package from global to version * replace package name from global to version * solve package name clash for version and cli/version * replace application name getter with VersionInfo.Application field having removed cli login,logout,validate * search and replace version string getter with VersionInfo.VersionString field * implement empty http.Header struct propagation from cli to resources * align downloader helper to use propagated http.Header from upper layers and modify test accordingly * align daemon to use empty http.Header as struct field in ArduinoCoreServerImpl * clean inside cobra commands for empty http.Header struct and inject headers build from VersionInfo struct in cli InitInstance func * remove unused runDaemonCommand in daemon * add user agent specific for daemon mode via DownloaderHeaders property for ArduinoCoreServerImpl * add testing information in README.md * removed getters and related usage for version package * update dependencies * finalize helpers_test User-Agent header value * add integration test for version info injection via vars * tidy go mod and reorganize imports and tidy long lines * inject ldflags variables in build task in Taskfile.yml * replace commands in /travis.yml with tasks properly merging flags * fix install command for go-task to solve "undefined: interp.EnvFromList" error * add coverage files to .gitignore * tidy dependencies in go.mod * update task executable path in tasks due to install path generated by go-task install script * implement exported variable cli.HTTPClientHeader in order to have it available in all cli subpackages and not onli in cli * fix comment replacing "version config" with "global config" * leverage cli.VersionInfo to present a better terminal and json data for version info
1 parent f74a7cc commit 6b9d8e5

Some content is hidden

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

56 files changed

+419
-160
lines changed
 

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/cmd/formatter/debug.test
66
/arduino-cli.yaml
77
/wiki
8+
.idea
9+
coverage_*.txt

‎.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
# Make sure golangci-lint is vendored.
1212
before_install:
1313
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.16.0
14+
- curl -sL https://taskfile.dev/install.sh | sh
1415

1516
install: true
1617

@@ -20,9 +21,10 @@ script:
2021
# Run linter
2122
- golangci-lint run
2223
# Build and test
23-
- go build
24-
- go test -timeout 20m -v -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./...
24+
- ./bin/task build
25+
- ./bin/task test
2526

2627
after_success:
27-
- bash <(curl -s https://codecov.io/bash)
28+
- bash <(curl -s https://codecov.io/bash) -cF unittests,integration
29+
2830

0 commit comments

Comments
 (0)
Please sign in to comment.