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

Release/v1.13.0 #823

Merged
merged 30 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0f20b19
Add support for profilling endpoints (#774)
Umang01-hash Jul 1, 2024
abc7dad
Bump cloud.google.com/go/pubsub from 1.39.0 to 1.40.0 (#775)
dependabot[bot] Jul 2, 2024
b106f52
Bump google.golang.org/api from 0.186.0 to 0.187.0 (#776)
dependabot[bot] Jul 2, 2024
ae94641
Fix MQTT implementation issue (#771)
iamgoroot Jul 3, 2024
3aaaa9e
add request timeout for health check calls (#777)
vipul-rawat Jul 3, 2024
3e4d265
fix dependent integration test in example (#784)
Umang01-hash Jul 4, 2024
a1de0db
Enhance Mongo Driver (#779)
aryanmehrotra Jul 4, 2024
eb3b745
Add support for retry of failing downstream calls (#778)
Umang01-hash Jul 4, 2024
63ebe9e
Fix mqtt tests using mock Client and mock Token (#791)
vipul-rawat Jul 5, 2024
80673fe
improve ci (#788)
ccoVeille Jul 5, 2024
cd6a321
ci: enable recent gci linter options and fix reported errors (#798)
ccoVeille Jul 7, 2024
5639796
ci: improve dependabot (#792)
ccoVeille Jul 8, 2024
809154c
Bump paambaati/codeclimate-action from 5.0.0 to 8.0.0 (#804)
dependabot[bot] Jul 8, 2024
5df629a
Bump go.opentelemetry.io/otel from 1.27.0 to 1.28.0 (#813)
dependabot[bot] Jul 8, 2024
4365043
Bump docker/login-action from 1 to 3 (#802)
dependabot[bot] Jul 8, 2024
f3e11d7
Bump go.opentelemetry.io/otel/sdk from 1.27.0 to 1.28.0 (#805)
dependabot[bot] Jul 8, 2024
7299611
Bump actions/setup-go from 4 to 5 (#806)
dependabot[bot] Jul 8, 2024
1ff42f2
Bump go.opentelemetry.io/otel/exporters/zipkin from 1.27.0 to 1.28.0 …
dependabot[bot] Jul 8, 2024
21c1236
Bump github.com/XSAM/otelsql from 0.31.0 to 0.32.0 (#810)
dependabot[bot] Jul 8, 2024
28300e5
Bump google.golang.org/grpc from 1.64.0 to 1.65.0 (#808)
dependabot[bot] Jul 8, 2024
c49eb53
Bump go.opentelemetry.io/otel/exporters/prometheus from 0.49.0 to 0.5…
dependabot[bot] Jul 8, 2024
9874447
Bump docker/setup-buildx-action from 2 to 3 (#812)
dependabot[bot] Jul 8, 2024
3bec224
Bump golang.org/x/term from 0.21.0 to 0.22.0 (#817)
dependabot[bot] Jul 8, 2024
f368698
Bump docker/build-push-action from 4 to 6 (#811)
dependabot[bot] Jul 8, 2024
8f6f356
Bump google-github-actions/auth from 1 to 2 (#807)
dependabot[bot] Jul 8, 2024
6b7cd60
Add external DB healthcheck to healthHandler (#780)
aryanmehrotra Jul 8, 2024
6563850
ci: enable ls-lint via GHA and fix reported errors (#799)
ccoVeille Jul 8, 2024
4e7a6e4
Bump actions/download-artifact from 3 to 4 (#809)
dependabot[bot] Jul 8, 2024
5c9799a
Merge branch 'main' into release/v1.13.0
aryanmehrotra Jul 8, 2024
ea59f69
Update version.go
aryanmehrotra Jul 8, 2024
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
18 changes: 16 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
---
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
- package-ecosystem: "gomod"
open-pull-requests-limit: 10 # avoid spam, if no one reacts
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
open-pull-requests-limit: 10 # avoid spam, if no one reacts
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
groups:
actions:
update-types:
- "minor"
- "patch"
28 changes: 20 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Workflow-Pipeline

on:
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
fetch-depth: 0

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
id: Go
Expand All @@ -82,7 +83,7 @@ jobs:

- name: Upload Test Coverage
if: ${{ matrix.go-version == '1.22'}}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Example-Test-Report
path: profile.cov
Expand All @@ -101,7 +102,7 @@ jobs:
fetch-depth: 0

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
id: Go
Expand All @@ -119,7 +120,7 @@ jobs:

- name: Upload Test Coverage
if: ${{ matrix.go-version == '1.22'}}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: PKG-Coverage-Report
path: profile.cov
Expand All @@ -133,7 +134,7 @@ jobs:
uses: actions/checkout@v4

- name: Download Coverage Report
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

Expand Down Expand Up @@ -167,7 +168,7 @@ jobs:
uses: actions/checkout@v4

- name: Download Coverage Report
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

Expand All @@ -178,7 +179,7 @@ jobs:
tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov

- name: Upload
uses: paambaati/codeclimate-action@v5.0.0
uses: paambaati/codeclimate-action@v8.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
Expand All @@ -188,7 +189,7 @@ jobs:
code_quality:
name: Code Quality🎖️
runs-on: ubuntu-latest
container: "golangci/golangci-lint:v1.57.2"
container: "golangci/golangci-lint:v1.59.1"
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
Expand All @@ -197,3 +198,14 @@ jobs:
- name: GolangCI-Lint
run: |
golangci-lint run --timeout 9m0s

linting_party:
name: Linting Party🥳
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check for file names errors
uses: ls-lint/action@v2.2.3
with:
config: .ls-lint.yml
16 changes: 8 additions & 8 deletions .github/workflows/website_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to the GitHub Container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.WEBSITE_REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -38,7 +38,7 @@ jobs:
docker pull ${{ env.WEBSITE_REGISTRY }}/gofr-dev/website:latest

- name: Build Image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: false
context: ./
Expand All @@ -56,17 +56,17 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to GAR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: ${{ secrets.deploy_key }}

- name: Log in to the GitHub Container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.WEBSITE_REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -77,7 +77,7 @@ jobs:
docker pull ${{ env.WEBSITE_REGISTRY }}/gofr-dev/website:latest

- name: Build and Push Image Stage
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
context: ./
Expand All @@ -102,7 +102,7 @@ jobs:
uses: actions/checkout@v4

- name: Authorize to GCP service account
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.deploy_key }}

Expand Down
47 changes: 42 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
linters-settings:
dupl:
threshold: 100
Expand All @@ -8,7 +9,9 @@ linters-settings:
statements: 50
gci:
sections:
- prefix(gofr.dev)
- standard
- default
- localmodule
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -31,7 +34,7 @@ linters-settings:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
gomnd:
mnd:
checks:
- argument
- case
Expand All @@ -55,6 +58,36 @@ linters-settings:
allow-unused: false # report any unused nolint directives
require-explanation: true # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
revive:
rules:
# default revive rules, they have to be present otherwise they are disabled
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: empty-block
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: increment-decrement
- name: indent-error-flow
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming
# additional revive rules
- name: bare-return
- name: bool-literal-in-expr
- name: comment-spacings
- name: early-return
- name: defer

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
Expand All @@ -65,7 +98,9 @@ linters:
- bodyclose
- dogsled
- dupl
- err113
- errcheck
- errorlint
- exhaustive
- exportloopref
- funlen
Expand All @@ -76,17 +111,17 @@ linters:
- gocritic
- gocyclo
- godot
- goerr113
- gofmt
- goimports
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- mirror
- misspell
- mnd
- nakedret
- nestif
- noctx
Expand All @@ -96,9 +131,11 @@ linters:
- rowserrcheck
- staticcheck
- stylecheck
- thelper
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
- wsl

Expand All @@ -108,7 +145,7 @@ linters:


service:
golangci-lint-version: 1.57.x
golangci-lint-version: 1.59.x

issues:
# exclude-use-default: false
Expand Down
4 changes: 4 additions & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
ls:
.go: snake_case
.pb.go: snake_case
5 changes: 5 additions & 0 deletions docs/references/configs/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,9 @@ This document lists all the configuration options supported by the GoFr framewor
- MQTT_QOS
- Quality of Service Level

---

- MQTT_KEEP_ALIVE
- Sends regular messages to check the link is active. May not work as expected if handling func is blocking execution

{% /table %}
5 changes: 3 additions & 2 deletions examples/grpc-server/grpc/hello.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/grpc-server/grpc/hello_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/http-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestIntegration_SimpleAPIServer(t *testing.T) {
}

for i, tc := range tests {
req, _ := http.NewRequest("GET", host+tc.path, nil)
req, _ := http.NewRequest(http.MethodGet, host+tc.path, nil)
req.Header.Set("content-type", "application/json")

c := http.Client{}
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestIntegration_SimpleAPIServer_Errors(t *testing.T) {
}

for i, tc := range tests {
req, _ := http.NewRequest("GET", host+tc.path, nil)
req, _ := http.NewRequest(http.MethodGet, host+tc.path, nil)
req.Header.Set("content-type", "application/json")

c := http.Client{}
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestIntegration_SimpleAPIServer_Health(t *testing.T) {
}

for i, tc := range tests {
req, _ := http.NewRequest("GET", host+tc.path, nil)
req, _ := http.NewRequest(http.MethodGet, host+tc.path, nil)
req.Header.Set("content-type", "application/json")

c := http.Client{}
Expand Down
6 changes: 3 additions & 3 deletions examples/using-custom-metrics/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ func TestIntegration(t *testing.T) {

c := http.Client{}

req, _ := http.NewRequest("POST", host+"/transaction", nil)
req, _ := http.NewRequest(http.MethodPost, host+"/transaction", nil)
req.Header.Set("content-type", "application/json")

_, err := c.Do(req)
if err != nil {
t.Fatalf("request to /transaction failed %v", err)
}

req, _ = http.NewRequest("POST", host+"/return", nil)
req, _ = http.NewRequest(http.MethodPost, host+"/return", nil)

_, err = c.Do(req)
if err != nil {
t.Fatalf("request to /transaction failed %v", err)
}

req, _ = http.NewRequest("GET", "http://localhost:2120/metrics", nil)
req, _ = http.NewRequest(http.MethodGet, "http://localhost:2120/metrics", nil)

resp, err := c.Do(req)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion examples/using-file-bind/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package main

import (
"bytes"
"github.com/stretchr/testify/assert"
"io"
"mime/multipart"
"net/http"
"os"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestMain_BindError(t *testing.T) {
Expand Down
Loading
Loading