fix: redis version on ci

This commit is contained in:
Reinaldy Rafli 2023-08-12 12:36:08 +07:00
parent e949b11ab9
commit 9aedbc6648
Signed by: aldy505
GPG Key ID: A3F8A7E23DA2AD94
20 changed files with 726 additions and 697 deletions

View File

@ -3,12 +3,12 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = false
max_line_length = 120
tab_width = 4
ij_continuation_indent_size = 8
tab_width = 2
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true

View File

@ -29,7 +29,7 @@ jobs:
volumes:
- minio-data:/data
redis:
image: redis:7.0.2-bookworm
image: redis:7.0.12-bookworm
ports:
- 6379:6379
defaults:

View File

@ -18,7 +18,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Installling dependencies
- name: Install dependencies
run: npm install
- name: Lint
@ -66,7 +66,7 @@ jobs:
volumes:
- minio-data:/data
redis:
image: redis:7.0.2-bookworm
image: redis:7.0.12-bookworm
ports:
- 6379:6379
defaults:

View File

@ -1,14 +1,19 @@
# Contributing Guide
First of all. Thank you for considering to contribute on Jokes Bapak2 API project. I hope this project will get better and we will become more bapak2 than ever.
First of all. Thank you for considering to contribute on Jokes Bapak2 API project. I hope this project will get better
and we will become more bapak2 than ever.
This project is a monorepo, meaning the backend, frontend, and Github CI are all in one place (one repository). Before you do anything, if you're going to do some breaking change or you'll write (or remove) large numbers of LOC (line of codes), please open an issue first and let us know about it. So that our work won't bother you and you'll have a breeze on developing this.
This project is a monorepo, meaning the backend, frontend, and Github CI are all in one place (one repository). Before
you do anything, if you're going to do some breaking change or you'll write (or remove) large numbers of LOC (line of
codes), please open an issue first and let us know about it. So that our work won't bother you and you'll have a breeze
on developing this.
## Project Prerequisites && Setup
### Front End (`./client`)
You'll have to install:
* Node.js LTS (preferably with [fnm](https://github.com/Schniz/fnm) or [nvm](https://github.com/nvm-sh/nvm))
* Yarn v1
@ -17,6 +22,7 @@ See the [README](./client/README.md) on client for detailed project setup.
### Back End (`./api`)
You'll have to install:
* Go v1.16.x
* (Optional) [Fiber CLI](https://github.com/gofiber/cli) for ease of development
@ -24,9 +30,11 @@ See the [README](./api/README.md) on client for detailed project setup.
### With Docker Compose
If you're just developing the front end and too lazy installing Go and such (or the other way around), you can use `docker-compose` file specified on the main page.
If you're just developing the front end and too lazy installing Go and such (or the other way around), you can
use `docker-compose` file specified on the main page.
You'll have to install:
* Docker (preferably with Docker Desktop if you're on Windows or Mac)
* Docker Compose
@ -55,20 +63,24 @@ $ docker-compose down
### Front End (`./client`)
Please run these:
* `yarn lint`
* `yarn format`
* `yarn build`
If those command didn't pass, please fix the problem first. Please recheck your changes, make sure NOT to leave any secret token/keys behind.
If those command didn't pass, please fix the problem first. Please recheck your changes, make sure NOT to leave any
secret token/keys behind.
### Back End (`./api`)
Please run these:
* `go fmt`
* `go build main.go`
* `go test -v -race -coverprofile=coverage.out -covermode=atomic ./...`
If those command didn't pass, please fix the problem first. Please recheck your changes, make sure NOT to leave any secret token/keys behind.
If those command didn't pass, please fix the problem first. Please recheck your changes, make sure NOT to leave any
secret token/keys behind.
## One more thing..

View File

@ -7,15 +7,19 @@
<br>
</h1>
👋 Hey there! Always a work in progress, if you'd like to contribute this while this repo is still growing, that would be so great!
👋 Hey there! Always a work in progress, if you'd like to contribute this while this repo is still growing, that would be
so great!
ou can access the front facing web on [jokesbapak2.reinaldyrafli.com](http://jokesbapak2.reinaldyrafli.com/).
## Brief explanation of what is this
Jokes Bapak2 is an image API that you can use for free! I've been seeing lots and lots of Indonesian dad jokes on Twitter, Facebook and Instagram on early 2020. In a month, I made a Discord bot that provides the jokes. But I thought, why not make it as an API?
Jokes Bapak2 is an image API that you can use for free! I've been seeing lots and lots of Indonesian dad jokes on
Twitter, Facebook and Instagram on early 2020. In a month, I made a Discord bot that provides the jokes. But I thought,
why not make it as an API?
This is some kind of [icanhazdadjokes](https://icanhazdadjoke.com/) but it's Indonesian and it's not text, it's images. Dad jokes in Indonesia is somewhat a bit different than in US/UK because, I guess, here, it's a lot dumber.
This is some kind of [icanhazdadjokes](https://icanhazdadjoke.com/) but it's Indonesian and it's not text, it's images.
Dad jokes in Indonesia is somewhat a bit different than in US/UK because, I guess, here, it's a lot dumber.
## Project Directories
@ -43,10 +47,12 @@ That's it.
## Development
Two ways of doing this:
1. Install all the tech stack on your local machine
2. Using docker-compose
See [CONTRIBUTING](./CONTRIBUTING.md) or README files on each project directory for further instruction on how to run the development environment.
See [CONTRIBUTING](./CONTRIBUTING.md) or README files on each project directory for further instruction on how to run
the development environment.
## Thanks to

View File

@ -17,12 +17,13 @@ $ go run main.go
$ go build main.go
```
There is a placeholder data ready for you to query it manually in `/platform/database/placeholder.sql`. Have a good time developing!
There is a placeholder data ready for you to query it manually in `/platform/database/placeholder.sql`. Have a good time
developing!
## Used packages
| Name | Version | Type |
| --- | --- | --- |
|------------------------------------------------------------------|--------------------------------------|-----------|
| [gofiber/fiber](https://github.com/gofiber/fiber) | `v2.21.0` | Framework |
| [jackc/pgx](https://github.com/jackc/pgx) | `v4.13.0` | Database |
| [go-redis/redis](https://github.com/go-redis/redis) | `v8.11.4` | Cache |

View File

@ -2,9 +2,10 @@ package joke_test
import (
"context"
"jokes-bapak2-api/core/joke"
"testing"
"time"
"jokes-bapak2-api/core/joke"
)
func TestGetRandomJoke(t *testing.T) {

View File

@ -2,9 +2,10 @@ package joke_test
import (
"context"
"jokes-bapak2-api/core/joke"
"testing"
"time"
"jokes-bapak2-api/core/joke"
)
func TestListJokeFromBucket(t *testing.T) {

View File

@ -2,9 +2,10 @@ package joke_test
import (
"context"
"jokes-bapak2-api/core/joke"
"testing"
"time"
"jokes-bapak2-api/core/joke"
)
func TestGetTodaysJoke(t *testing.T) {

View File

@ -2,9 +2,10 @@ package joke_test
import (
"context"
"jokes-bapak2-api/core/joke"
"testing"
"time"
"jokes-bapak2-api/core/joke"
)
func TestGetTotalJoke(t *testing.T) {

View File

@ -1,10 +1,11 @@
package joke
import (
core "jokes-bapak2-api/core/joke"
"net/http"
"strconv"
core "jokes-bapak2-api/core/joke"
"github.com/go-chi/chi/v5"
)

View File

@ -1,9 +1,10 @@
package joke
import (
core "jokes-bapak2-api/core/joke"
"net/http"
"strconv"
core "jokes-bapak2-api/core/joke"
)
// TotalJokes provides a HTTP handler for acquiring total jokes

View File

@ -1,14 +1,15 @@
package main
import (
"context"
"errors"
"log"
"net"
"net/http"
"os"
"os/signal"
"time"
"context"
"jokes-bapak2-api/core/joke"
"jokes-bapak2-api/routes"
@ -16,8 +17,6 @@ import (
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"time"
"github.com/allegro/bigcache/v3"
"github.com/getsentry/sentry-go"
"github.com/go-chi/chi/v5"

View File

@ -1,8 +1,9 @@
package utils_test
import (
"jokes-bapak2-api/utils"
"testing"
"jokes-bapak2-api/utils"
)
func TestIsIn_True(t *testing.T) {

View File

@ -1,9 +1,10 @@
package utils_test
import (
"jokes-bapak2-api/utils"
"testing"
"time"
"jokes-bapak2-api/utils"
)
func TestIsToday_Today(t *testing.T) {

View File

@ -1,9 +1,10 @@
package utils_test
import (
"jokes-bapak2-api/utils"
"strings"
"testing"
"jokes-bapak2-api/utils"
)
func TestParseToJSONBody(t *testing.T) {

View File

@ -1,8 +1,9 @@
package utils_test
import (
"jokes-bapak2-api/utils"
"testing"
"jokes-bapak2-api/utils"
)
func TestRandomString_Valid(t *testing.T) {

View File

@ -1,9 +1,10 @@
package utils_test
import (
"jokes-bapak2-api/utils"
"net/http"
"testing"
"jokes-bapak2-api/utils"
)
func TestRequest_Get(t *testing.T) {

View File

@ -15,5 +15,5 @@ $ yarn start
## Used package
| Name | Version | Type |
| --- | --- | --- |
|---------------------------------------------------------------|----------|-------------------|
| [mcollina/autocannon](https://github.com/mcollina/autocannon) | `v7.4.0` | Benchmarking Tool |