Commit Graph

1079 Commits

Author SHA1 Message Date
dependabot[bot]
c4dec51b01 Bump github.com/aws/aws-sdk-go from 1.33.0 to 1.34.0 (#1824)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/v1.34.0/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.33.0...v1.34.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-02-27 18:07:55 +08:00
dependabot[bot]
257bb752fb Bump github.com/prometheus/client_golang from 1.11.0 to 1.11.1 (#1825)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-02-26 14:38:51 +05:30
Ashish Ranjan
9a1a7707f3 fix release workflow (#1831)
* fix release workflow

* test release

* remove test changes

* add version tag to release workflow

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-02-25 17:53:59 +05:30
Nicholas Wiersma
d932d50232 chore: lint code with golangci-lint (#1828)
* feat: add golangci-lint linting

* chore: fix linter issues

* feat: add linting into the workflow

* docs: update lint docs

* fix: cr suggestions

* fix: remove old formatting and vetting scripts

* fix: add docker make target

* fix: action go caching

* fix: depreciated actions checkout version

* fix: cr suggestion

* fix: cr suggestions

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-02-24 20:39:17 -08:00
dependabot[bot]
66582eebfe Bump golang.org/x/text from 0.3.7 to 0.3.8 (#1829)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-24 20:02:24 -08:00
Ashish Ranjan
3f26845cff move to github actions from drone (#1823)
* add github actions workflow for tag releases

* migrate drone build &test step to github actions

* fix minio service

* fix indentation

* fix dependency syntax

* remove needs keyword

* fix service hostnames, add protectedredis

* update protected redis docker image

* fix too many args error

* exclude vendor dir from gofmt

* fix fmt errors

* fix fmt errors

* rm .drone.yml

* rename workflow name

* break test step

* remove vendor step

* use makefile rule

* use buildx
2023-02-22 22:47:37 -08:00
DrPsychick
dbe3b5d145 fix: only update chart README (#1820) 2023-02-07 18:41:09 -08:00
Rob Prentiss
23bfcd19bc Update lib/pq to fix cert permissions issues (#1804)
When attempting to connect to a PostgreSQL database using certificate
credentials, authentication may fail due to permissions issues on the
certificate files. When using Athens in Kubernetes, this issue may be
unavoidable when using secrets.

The github.com/lib/pq library has resolved this issue as of v1.10.6, so
this commit updates that library to the latest release version (v1.10.7)
to resolve the issue in Athens.

Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:49:43 +08:00
dependabot[bot]
4b93ee76a2 update-go-pkg(deps): bump golang.org/x/mod from 0.4.2 to 0.7.0 (#1800)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.4.2 to 0.7.0.
- [Release notes](https://github.com/golang/mod/releases)
- [Commits](https://github.com/golang/mod/compare/v0.4.2...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:38:48 +08:00
Zhongpeng Lin
6aaf9e5b17 Handle duplicate keys returned by S3 ListObject (#1793)
S3 API sometimes returns duplicate keys, causing the number of file for a specific module greater than 3. This PR makes Athens handle that situation gracefully and log a warning message instead of treating the module as not found.

logging string content

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:01:09 +08:00
Eng Zer Jun
b3bc773e29 test(pkg/config): use t.Setenv to set env vars (#1821)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:00:37 +08:00
dependabot[bot]
4a1ff03860 Bump github.com/aws/aws-sdk-go from 1.32.7 to 1.33.0 (#1810)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.32.7 to 1.33.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/v1.33.0/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.32.7...v1.33.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 12:44:21 +08:00
Mike Seplowitz
f35a5406a3 Pass Athens's logger to the Redis package (#1817)
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 12:22:49 +08:00
Nicholas Wiersma
ab64133949 feat: replace ioutil with io and os (#1816) 2023-01-27 20:42:47 +05:30
Rob Prentiss
6baf7c9033 Handle SIGTERM on unix-like OS (#1805) 2023-01-24 18:04:56 -08:00
Rob Prentiss
a1553999bb Make shutdown timeout configurable (#1806)
Currently, when shutting down the server (via SIGINT or SIGTERM), the
shutdown closes any open connections after only 10 seconds (via a
context.WithTimeout). This does not provie a lot of time for longer
operations, such as listing versions, or downloading a larger module zip
file.

When running in Kubernetes, and scaling instances or changing config,
this causes a lot of dropped connections and gateway errors. 10 seconds
is arguably much too short, and should be configurable.

This commit increases that default to 60 seconds, and adds a config
variable to allow users to specify their desired timeout.
2023-01-23 22:02:45 -08:00
Ashish Ranjan
b7dd8a85de upgrade go version to 1.19 (#1814)
* upgrade go version to 1.19

* update base image
2023-01-19 22:32:08 -08:00
Zhongpeng Lin
4c3443328e Adding new fields to RevInfo (#1812)
* Allow unknown fields in RevInfo

* Revert "Allow unknown fields in RevInfo"

This reverts commit 902d791554.

* Adding new fields to rev_info.go

* fixed tests
2023-01-16 12:11:10 -08:00
Jerry Ng
92150d0500 Update s3 checker to iterate through all objects pages (#1802) 2023-01-08 13:46:20 -08:00
Ashish Ranjan
cc496afbf1 read redis lock options from config to support custom TTL & timeout (#1791)
* read redis lock options from config to support custom TTL & timeout

* fix test

* fix typo

* downgrade to bsm/redislock@v0.7.2 to prevent usage of beta go-redis version

* revert test changes

* return error for invalid lock config

* update config parsing test

* udpate docs to include redis lock config

* fix test

* set default max retries to 10

* reduce default redis lock timeout to 15s

* update default TTL to 15mins

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-09-28 22:53:06 -07:00
Zhongpeng Lin
b8d7c4aa79 Register HTTP client views for stats (#1787) 2022-09-22 21:04:51 -07:00
Ashish Ranjan
7d67ee76ce fix default s3 credentials set as anonymous (#1789) 2022-09-15 18:30:54 -07:00
Ashish Ranjan
33777c5cc4 copy context before starting stash operations to prevent ctx cancellations (#1790)
* copy context before starting stash operations to prevent ctx cancellations

* add comment about context cancellation
2022-09-15 11:03:59 -04:00
Zhongpeng Lin
e97cb5f5df Passing http client to S3 client (#1786) 2022-08-26 09:03:56 -04:00
Rski
3234d1b100 remove checked in main binary (#1782)
This looks accidentally checked it. The commit can't erase it from
the repo itself, but there is no point in having it there
2022-08-09 15:44:04 -07:00
Zhongpeng Lin
adccf1534d regrouping go.mod (#1781) 2022-08-03 20:42:41 -07:00
JefM
085e294d23 build releases for x86_64 (#1779) 2022-06-17 10:11:24 -04:00
Rob Prentiss
3fab46905e Resolve memory leaks when using Minio storage (#1777)
When using Minio storage, memory usage constantly increases. After
profiling, it appears that memory usage is building in the minio client,
and not being released.

Finding a similar issue listed in the minio/warp project, I found that
they fixed the issue by closing the *minio.Object instances. In the
athens usage, the minio.Object instances are never closed after reading
the data from them.

This adds deferred 'Close' calls in the 'storageImpl.Info' and
'storageImpl.GoMod' functions so that the objects may be released and
garbage collected. The 'storageImpl.Zip' function does not use defer,
since it has the object embedded into the return value, so the 'Close'
is only called on error.
2022-06-06 19:04:33 -04:00
dependabot[bot]
b03db41dfb update-go-pkg(deps): bump github.com/minio/minio-go/v6 (#1770)
Bumps [github.com/minio/minio-go/v6](https://github.com/minio/minio-go) from 6.0.43 to 6.0.57.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v6.0.43...v6.0.57)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-06-03 21:30:04 -07:00
Qiu Yuzhou
723c06bd8c chore(chart): update ingress to support apiVersion networking.k8s.io/v1 (#1769)
* chore(chart): update ingress to support apiVersion networking.k8s.io/v1

* refactor(chart): use API capabilities instead version comparisions in ingress

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-04-18 20:28:13 -07:00
dependabot[bot]
f381187453 update-go-pkg(deps): bump github.com/go-sql-driver/mysql (#1767)
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-sql-driver/mysql/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-03-31 22:36:01 -07:00
Manu Gupta
69f7a1f902 Update to go1.18 (#1768) 2022-03-21 10:47:41 -07:00
dependabot[bot]
2240baf308 update-go-pkg(deps): bump github.com/spf13/afero from 1.1.2 to 1.8.2 (#1766)
Bumps [github.com/spf13/afero](https://github.com/spf13/afero) from 1.1.2 to 1.8.2.
- [Release notes](https://github.com/spf13/afero/releases)
- [Commits](https://github.com/spf13/afero/compare/v1.1.2...v1.8.2)

---
updated-dependencies:
- dependency-name: github.com/spf13/afero
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-18 16:40:52 -07:00
dependabot[bot]
13f8998073 update-go-pkg(deps): bump contrib.go.opencensus.io/exporter/jaeger (#1762)
Bumps [contrib.go.opencensus.io/exporter/jaeger](https://github.com/census-ecosystem/opencensus-go-exporter-jaeger) from 0.1.0 to 0.2.1.
- [Release notes](https://github.com/census-ecosystem/opencensus-go-exporter-jaeger/releases)
- [Commits](https://github.com/census-ecosystem/opencensus-go-exporter-jaeger/compare/v0.1.0...v0.2.1)

---
updated-dependencies:
- dependency-name: contrib.go.opencensus.io/exporter/jaeger
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-02-24 19:29:19 -08:00
dependabot[bot]
c680eacb3a update-go-pkg(deps): bump github.com/fatih/color from 1.7.0 to 1.13.0 (#1760)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.7.0 to 1.13.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.7.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 14:24:48 -08:00
Manu Gupta
be203340be Remove deprecated GOPROXY in favor of GoBinaryEnvVars (#1759) 2022-02-18 10:24:44 -08:00
Manu Gupta
3a40029ec8 Revert retries in redis-flake as builds are failing again. (#1758) 2022-02-16 12:31:47 -08:00
Manu Gupta
4e3377fb8a Switch to latest supported CircleCI Ubuntu image (#1757) 2022-02-16 10:07:06 -08:00
Manu Gupta
67bb68c45d Update etcd (#1756) 2022-02-15 09:10:51 -08:00
dependabot[bot]
4708dd84a0 update-go-pkg(deps): bump github.com/BurntSushi/toml from 0.3.1 to 1.0.0 (#1753)
Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 0.3.1 to 1.0.0.
- [Release notes](https://github.com/BurntSushi/toml/releases)
- [Commits](https://github.com/BurntSushi/toml/compare/v0.3.1...v1.0.0)

---
updated-dependencies:
- dependency-name: github.com/BurntSushi/toml
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 17:39:39 -05:00
Manu Gupta
1d302be225 Add dependabot for automatic dependency update (#1752) 2022-02-14 14:14:24 -08:00
Manu Gupta
533035c40c fix flake on redis-sentinel by depending on redis container / step. (#1748)
* fix: flake on redis-sentinel by depending on redis container / step.

Signed-off-by: Manu Gupta <manugupt1@gmail.com>

* Add retries in an attempt to reduce the number of flakes

Also; update go-redis.

Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
2022-02-14 14:01:29 -08:00
Steve Coffman
7fc5e15447 Update Cloud Run per #1571 (#1751)
see https://github.com/gomods/athens/issues/1571#issuecomment-599221107
2022-01-18 15:43:09 -05:00
Alex
6da5568081 a new way to pre-fill disk storage (#1747)
* a new way to pre-fill disk storage
* changed a headline to a bold'ed text
2021-12-22 13:46:16 -08:00
Rob Lee
567c939ac4 Finish Removing golint (#1746)
* Set GO111MODULE to auto in golint script– #1743

As mentioned in #1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.

* Remove redundant code – golint script

Go 1.17 ignores `GO111MODULE` and there are no directories in the
project root called `mock`.

* Replace `golint` with `go vet`

`golint` is deprecated (and frozen) replace with the current `go vet`.
This reported one issue on `main` branch:
```pkg/stash/with_etcd.go:33:28:
loop variable ep captured by func literal```

Fixed loop variable capture with extraction to parameterised anonymous
function passed loop variable and passed in to `errgroup.Go` call.

* Finish Removing `golint`

Removed remaining references to `golint` in dev doc, Makefile,
bash scripts, and powershell build scripts.
Removed `get_dev_tools.sh` and `get_dev_tools.ps1` as they only install
the removed `golint` package.
2021-12-11 11:09:03 -05:00
Manu Gupta
2f49984800 Update droneci to use go1.17 (#1745)
Athens now uses go1.17 which is latest. Update drone ci to do the
same for better indication of our CI results.
2021-12-09 22:23:16 -08:00
Rob Lee
918ddfb59a Replace golint with go vet#1743 (#1744)
* Set GO111MODULE to auto in golint script– #1743

As mentioned in #1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.

* Remove redundant code – golint script

Go 1.17 ignores `GO111MODULE` and there are no directories in the
project root called `mock`.

* Replace `golint` with `go vet`

`golint` is deprecated (and frozen) replace with the current `go vet`.
This reported one issue on `main` branch:
```pkg/stash/with_etcd.go:33:28:
loop variable ep captured by func literal```

Fixed loop variable capture with extraction to parameterised anonymous
function passed loop variable and passed in to `errgroup.Go` call.
2021-12-09 22:03:48 -08:00
Manu Gupta
898673c600 Deprecate bzr as it is unmaintained. (#1742)
Alpine moved bzr to unmaintained status. See
https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10000
2021-12-04 22:46:27 -05:00
Abhay Krishna
38a3039a21 Fix typos and comments in config.toml (#1739)
Co-authored-by: Marwan Sulaiman <marwan.sameer@gmail.com>
2021-12-03 01:38:09 -05:00
jason-liew
535c26b0e0 Upgrade GOLANG_VERSION to 1.17 (#1741)
* Upgrade GOLANG_VERSION to 1.17

Fixes ##1740

* feat: upgrade to go1.17

Co-authored-by: shangji.liu <shangji.liu@qingteng.cn>
Co-authored-by: Marwan Sulaiman <marwan.sameer@gmail.com>
2021-12-03 00:56:05 -05:00