Skip to content

Tags: ericzhang6222/pkg

Tags

v0.0.27

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request anz-bank#73 from anz-bank/Fix-mock-wait

TimeTravel.After won't change offset till after channel read

v0.0.26

🏃 health: Fix data race in health readiness access (anz-bank#72)

Make the readiness value a uint32 and read/write it with the `atomic`
package functions `LoadUint32` and `StoreUint32`, instead of unprotected
access to a boolean.

The health readiness value is read and written from different goroutines
mostly. This was explicitly done without locking as the readiness value
was a single bit and nothing that needed to be synchronised. That's
still bad. At least, it should be an atomic - no data should be
read/written concurrently without an atomic or a mutex or more.

Add a test case that fails the race detector if readiness is not
properly protected.

This merges the following commits:
* health: Fix data race in health readiness access

     health/default_test.go |  3 ++-
     health/health.go       | 15 ++++++++++++---
     health/health_test.go  | 23 +++++++++++++++++++++++
     3 files changed, 37 insertions(+), 4 deletions(-)

Pull-Request: anz-bank#72

v0.0.25

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Jack/pkg update (anz-bank#71)

* Add downstream test job to workflow (anz-bank#1)

* Contextual clock package (anz-bank#2)

* Context-driven envvar package (anz-bank#3)

* Jack/speed up GitHub mod (anz-bank#4)

Speeds up the module package when in Github mode by ~50%

Changes
- Fix bug in caching, which was causing cached files to not be found
- Run Github API calls concurrently, rather than synchronously
- Add benchmark tests

* Run in parallel

name                           old time/op  new time/op  delta
GetCacheRef-16                  696ms ± 0%   505ms ± 0%   ~     (p=1.000 n=1+1)
RetrieveGitHubModeUncached-16   1.65s ± 0%   1.05s ± 0%   ~     (p=1.000 n=1+1)

* Fix bug in cache dir

Previously the cache dir was getting added twice as the mod.dir already contains the cache directory.
Therefore, none of the cached files were found and were being re-downloaded every time

* Add benchmark test and `make bench`

* Receive cache ref with channels

* Move integration tests under integration build tag (anz-bank#5)

Moves integration tests into separate files so that they don't get run in CI. This speeds up the `make test` command significantly
Integration tests can be run with the `make integration` target


Co-authored-by: Oliver <Oliver.Lade@anz.com>
Co-authored-by: Marcelo Cantos <anzdaddy@users.noreply.github.com>

v0.0.24

🐙 github: Fix version bump action label (anz-bank#70)

Update version bump action label from "build" (the GitHub action's job)
to something more meaningful and easier to identify in branch protection
settings.

This merges the following commits:
* github: Fix version bump action label

     .github/workflows/version.yaml | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)

Pull-Request: anz-bank#70

v0.0.23

📜 Create OpenAPI spec for health endpoints (anz-bank#69)

Add swagger spec to describe default health package endpoints in
standardised format:

	/readyz
	/healthz
	/version

Live on SwaggerHub:
https://app.swaggerhub.com/apis/anz-bank/health-api/0.0.1
(because everybody needs a hub)

Fixes: anz-bank#52

This merges the following commits:
* health: Create OpenAPI spec for default health endpoints

     health/openapi.json | 89 +++++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 89 insertions(+)

Pull-Request: anz-bank#69

v0.0.22

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Remove generated go.mod file in tests (anz-bank#68)

* remove generated go.mod file in tests

* replace assert.NoError with require.NoError

v0.0.21

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Fix datarace (anz-bank#67)

* fix data race

* add filesystem and more tests

v0.0.20

👩‍⚕️ Add health.SetReadyProvider function (anz-bank#66)

Add health.SetReadyProvider function to operate on defaultState, to be served by DefaultServer.
Initially we intended to simply set the ReadyProvider if desired as

	health.DefaultServer.State.ReadyProvider = r

However, if the DefaultServer isn't already instantiated via

	health.RegisterWithHTTP|GRPC

this can lead to unwanted race conditions and nilpointer exceptions.
Instead health.SetReadyProvider operates on the private globally
initialised defaultState.

This merges the following commits:
* Add mod/.packagecache to .gitignore

     health/default.go      |  5 +++++
     health/default_test.go | 13 +++++++++++++
     health/health.go       |  6 ++++++
     3 files changed, 24 insertions(+)

Pull-Request: anz-bank#66

v0.0.19

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Add root to gomodules init param (anz-bank#65)

* add root to gomodules init param

* fix linter

v0.0.18

👩‍⚕️ Add ReadyProvider to health pkg (anz-bank#64)

Add ReadyProvider to health pkg such that Readiness can be determined
by users of the health package in a pull fashion, rather than pushing
it with `SetState(ready)`.

This merges the following commits:
* Add ReadyProvider to health pkg

     health/default.go           |  2 +-
     health/default_test.go      | 18 +++++++--------
     health/health.go            | 44 +++++++++++++++++++++++++++++++------
     health/health_test.go       |  6 ++---
     health/ochealth/register.go |  2 +-
     5 files changed, 51 insertions(+), 21 deletions(-)

Pull-Request: anz-bank#64