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.12.0 #773

Merged
merged 24 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
081c9ff
Update workflow for deploying website (#746)
aryanmehrotra Jun 24, 2024
e1da52e
Refactor deploy and dockerize only on tag release (#747)
aryanmehrotra Jun 24, 2024
9b47b94
Refactor Migrations Implementation (#744)
aryanmehrotra Jun 24, 2024
f2c125a
fix: typo
OhJuhun Jun 25, 2024
1a7794f
fix typos in docs
srijan-27 Jun 25, 2024
f0c5ab8
Refactor and Add mocks for external datasources (#749)
aryanmehrotra Jun 26, 2024
e740b8d
add check for updating metrics for error case in service calls (#761)
vipul-rawat Jun 26, 2024
8ddd9fa
Merge branch 'development' into fixTypo
srijan-27 Jun 26, 2024
5f13703
Merge branch 'development' into fix-typos
srijan-27 Jun 26, 2024
2e24b5a
Merge pull request #755 from OhJuhun/fixTypo
vikash Jun 26, 2024
af1351b
Merge branch 'development' into fix-typos
vikash Jun 26, 2024
401c967
Merge pull request #757 from gofr-dev/fix-typos
vikash Jun 26, 2024
09e218d
Update workflow to consolidate commands (#762)
aryanmehrotra Jun 26, 2024
627d354
Update go version to v1.22 (#741)
srijan-27 Jun 26, 2024
f10b5c5
Support for Clickhouse migrations (#750)
aryanmehrotra Jun 26, 2024
cd5b92e
Added Static File Handler (#674)
KedarisettiSreeVamsi Jun 26, 2024
0c039c2
typos suggestion (#764)
ccoVeille Jun 27, 2024
95c51a6
Fix/codeql (#763)
aryanmehrotra Jun 27, 2024
261b5dc
fix go mod for using-cron and using-websocket example (#767)
srijan-27 Jun 27, 2024
c5154ce
add labels explanation and usage
srijan-27 Jun 27, 2024
ab59244
Merge pull request #768 from gofr-dev/EN/docs-custom-metrics
vikash Jun 27, 2024
1b56119
update remote level response (#770)
Umang01-hash Jun 28, 2024
1a21515
Merge remote-tracking branch 'origin/main' into release/v1.12.0
srijan-27 Jun 28, 2024
cdf62fd
udpate framework version
srijan-27 Jun 28, 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
37 changes: 0 additions & 37 deletions .github/workflows/changes.sh

This file was deleted.

57 changes: 8 additions & 49 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,12 @@ on:
- 'docs/**'

jobs:
MIGRATION-Unit-Testing:
name: Migration Unit Testing (v${{ matrix.go-version }})🛠
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21', '1.20']

steps:
- name: Checkout code into go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
id: Go

- name: Get dependencies
run: |
go mod download

- name: Test
run: |
export APP_ENV=test
go test gofr.dev/pkg/gofr/migration... -v -short -coverprofile profile.cov -coverpkg=gofr.dev/pkg/gofr/migration...

go tool cover -func profile.cov

- name: Upload Test Coverage
if: ${{ matrix.go-version == '1.21'}}
uses: actions/upload-artifact@v3
with:
name: MIGRATION-Coverage-Report
path: profile.cov

Example-Unit-Testing:
name: Example Unit Testing (v${{ matrix.go-version }})🛠
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21', '1.20']
go-version: ['1.22', '1.21']

services:
kafka:
Expand Down Expand Up @@ -118,7 +81,7 @@ jobs:
go tool cover -func profile.cov

- name: Upload Test Coverage
if: ${{ matrix.go-version == '1.21'}}
if: ${{ matrix.go-version == '1.22'}}
uses: actions/upload-artifact@v3
with:
name: Example-Test-Report
Expand All @@ -129,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21', '1.20']
go-version: ['1.22', '1.21']

steps:
- name: Checkout code into go module directory
Expand All @@ -150,15 +113,12 @@ jobs:
- name: Test
run: |
export APP_ENV=test
go test gofr.dev/pkg/... -tags migration -v -short -coverprofile packageWithMigration.cov -coverpkg=gofr.dev/pkg/...
grep -v 'gofr.dev/pkg/gofr/migration' packageWithMigration.cov > packageWithoutMigration.cov
grep -v 'gofr.dev/pkg/gofr/migration/mock_datasources.go' packageWithoutMigration.cov > packageWithoutMockMigrationDatasource.cov
grep -v 'gofr.dev/pkg/gofr/container/mock_datasources.go' packageWithoutMockMigrationDatasource.cov > packageWithoutMockDatasource.cov
grep -v 'google/mock_interfaces\.go' packageWithoutMockDatasource.cov > profile.cov
go test gofr.dev/pkg/... -v -short -coverprofile package.cov -coverpkg=gofr.dev/pkg/...
grep -v '/mock_' package.cov > profile.cov
go tool cover -func profile.cov

- name: Upload Test Coverage
if: ${{ matrix.go-version == '1.21'}}
if: ${{ matrix.go-version == '1.22'}}
uses: actions/upload-artifact@v3
with:
name: PKG-Coverage-Report
Expand All @@ -167,7 +127,7 @@ jobs:
parse_coverage:
name: Code Coverage
runs-on: ubuntu-latest
needs: [ Example-Unit-Testing,PKG-Unit-Testing,MIGRATION-Unit-Testing ]
needs: [ Example-Unit-Testing,PKG-Unit-Testing]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
Expand All @@ -183,7 +143,6 @@ jobs:
run: |
awk '!/^mode: / && FNR==1{print "mode: set"} {print}' ./Example-Test-Report/profile.cov > merged_profile.cov
tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
tail -n +2 ./MIGRATION-Coverage-Report/profile.cov >> merged_profile.cov

- name: Parse code-coverage value
working-directory: artifacts
Expand All @@ -201,7 +160,7 @@ jobs:
upload_coverage:
name: Upload Coverage📊
runs-on: ubuntu-latest
needs: [Example-Unit-Testing,PKG-Unit-Testing,MIGRATION-Unit-Testing]
needs: [Example-Unit-Testing,PKG-Unit-Testing]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
steps:
- name: Check out code into the Go module directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: Build and Deploy
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]"
- "v*.*.*"
branches:
- main
- development

env:
APP_NAME: gofr-website
Expand All @@ -15,9 +18,6 @@ env:
jobs:
build:
runs-on: ubuntu-latest
if: (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main' || github.event_name == 'pull_request' )
outputs:
image: ${{ steps.output-image.outputs.image }}
name: 🔧Build
steps:
- name: Checkout Code
Expand All @@ -37,20 +37,16 @@ jobs:
run: |
docker pull ${{ env.WEBSITE_REGISTRY }}/gofr-dev/website:latest

- name: Build and Push Image Stage
- name: Build Image
uses: docker/build-push-action@v4
with:
push: false
context: ./
file: ./docs/Dockerfile
tags: us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ github.sha }}

- id: output-image
run: echo "image=`echo us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ github.sha }}`" >> "$GITHUB_OUTPUT"

dockerize:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v')}}
runs-on: ubuntu-latest
outputs:
image: ${{ steps.output-image.outputs.image }}
name: 🐳 Dockerize
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Please note that the recommended local port for the services are different than
* Use only what is given to you as part of function parameter or receiver. No globals. Inject all dependencies including
DB, Logger etc.
* No magic. So, no init. In a large project, it becomes difficult to track which package is doing what at the
initialisation step.
initialization step.
* Exported functions must have an associated goDoc.
* Sensitive data(username, password, keys) should not be pushed. Always use environment variables.
* Take interfaces and return concrete types.
Expand All @@ -107,7 +107,7 @@ Please note that the recommended local port for the services are different than
* When you consider a new documentation page is needed, start by adding a new file and writing your new documentation. Then - add a reference to it in [navigation.js](https://gofr.dev/docs/navigation.js).
* If needed, update or add proper code examples for your changes.
* In case images are needed, add it to [docs/public](https://gofr.dev/docs/public) folder.
* Make sure you don't break existing links and refernces.
* Make sure you don't break existing links and references.
* Maintain Markdown standards, you can read more [here](https://www.markdownguide.org/basic-syntax/), this includes:
- Headings (`#`, `##`, etc.) should be placed in order.
- Use trailing white space or the <br> HTML tag at the end of the line.
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21
FROM golang:1.22

RUN mkdir -p /go/src/gofr.dev
WORKDIR /go/src/gofr.dev
Expand All @@ -10,4 +10,4 @@ FROM alpine:latest
RUN apk add --no-cache tzdata ca-certificates
COPY --from=0 /go/src/gofr.dev/main /main
EXPOSE 8000
CMD ["/main"]
CMD ["/main"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ If you want to say thank you and/or support the active development of GoFr:

1. Add a [GitHub Star](https://github.com/gofr-dev/gofr/stargazers) to the project.
2. Write a review or tutorial on [Medium](https://medium.com/), [Dev.to](https://dev.to/) or personal blog.
3. Visit [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow. After your PR is merged to the repo, fill the [google form](https://forms.gle/R1Yz7ZzY3U5WWTgy5), and we will send you a GoFr T-Shirt and Stickers as a token of appreciation.
3. Visit [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow. After your PR is merged to the repo, fill the [Google Form](https://forms.gle/R1Yz7ZzY3U5WWTgy5), and we will send you a GoFr T-Shirt and Stickers as a token of appreciation.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Following versions are being supported for security updates.

## Reporting a Vulnerability

To report a vulnerability, please file an issue on this repo and add "security" label. Security related issues will be prioritised over others. We strive to triage the issue within a single working day.
To report a vulnerability, please file an issue on this repo and add "security" label. Security related issues will be prioritized over others. We strive to triage the issue within a single working day.
4 changes: 4 additions & 0 deletions docs/advanced-guide/gofr-errors/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ automatically handle HTTP status code selection. These include:
- `ErrorInvalidParam`: Represents an error due to an invalid parameter.
- `ErrorMissingParam`: Represents an error due to a missing parameter.
- `ErrorEntityNotFound`: Represents an error due to a not found entity.
- `ErrorEntityAlreadyExist`: Represents an error due to creation of duplicate entity.
- `ErrorInvalidRoute`: Represents an error for invalid route.
- `ErrorRequestTimeout`: Represents an error for request which timed out.
- `ErrorPanicRecovery`: Represents an error for request which panicked.

#### Usage:
To use the predefined http errors,users can simply call them using GoFr's http package:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-guide/grpc/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ func main() {
app.Run()
}
```
>Note: By default, grpc server will run on port 9000, to customize the port users can set GRPC_PORT config in the .env
>Note: By default, gRPC server will run on port 9000, to customize the port users can set `GRPC_PORT` config in the .env
4 changes: 2 additions & 2 deletions docs/advanced-guide/handling-data-migrations/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func createTableEmployee() migration.Migrate {
}
```

`migration.Datasource` have the datasources whose migrations are supported i.e. Redis and SQL (MySQL and PostgreSQL).
`migration.Datasource` have the datasources whose migrations are supported i.e., Redis and SQL (MySQL and PostgreSQL).
All migrations always run in a transaction.

For MySQL it is highly recommended to use `IF EXISTS` and `IF NOT EXIST` in DDL commands as MySQL implicitly commits these commands.
Expand Down Expand Up @@ -147,7 +147,7 @@ Value : {"method":"UP","startTime":"2024-02-26T15:03:46.844558+05:30","duration"

Where,

**Version** : Migration version is the number provided in the map, i.e. sequence number.
**Version** : Migration version is the number provided in the map, i.e., sequence number.

**Start Time** : Time when Migration Started in UTC.

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-guide/handling-file/page.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Handling File

Gofr simplifies the complexity of working with different filestores by offering a uniform API. This allows developers to interact with different storage systems using the same set of methods, without needing to understand the underlying implementation details of each filestore.
GoFr simplifies the complexity of working with different file stores by offering a uniform API. This allows developers to interact with different storage systems using the same set of methods, without needing to understand the underlying implementation details of each file store.

## USAGE

Expand Down Expand Up @@ -82,4 +82,4 @@ err := c.File.RemoveAll("my_dir/my_text")
```


> Errors have been skipped in the example to focus on the core logic, it is recommended to handle all the errors.
> Errors have been skipped in the example to focus on the core logic, it is recommended to handle all the errors.
6 changes: 3 additions & 3 deletions docs/advanced-guide/overriding-default/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GoFr allows overriding default behavior of its features.

## Raw response format

GoFr by default wraps a handler's return value and assigns it to the "data" field in a response.
GoFr by default wraps a handler's return value and assigns it to the `data` field in a response.

### Example

Expand Down Expand Up @@ -74,7 +74,7 @@ Response example:

## Favicon.ico

By default GoFr load its own `favicon.ico` present in root directory for an application. To override `favicon.ico` user
By default, GoFr load its own `favicon.ico` present in root directory for an application. To override `favicon.ico` user
can place its custom icon in the **static** directory of its application.

> NOTE: The custom favicon should also be named as `favicon.ico` in the static directory of application.
> NOTE: The custom favicon should also be named as `favicon.ico` in the static directory of application.
Loading
Loading