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

Feature/badaas as library #60

Closed
wants to merge 178 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
7ef1074
wip
slashformotion Dec 6, 2022
0df569c
wipsdqsdqsd
slashformotion Jan 11, 2023
71c5041
Merge branch 'main' into feature/eav
FrancoLiberali Apr 6, 2023
ae878fb
fix compilation errors
FrancoLiberali Apr 6, 2023
f542ba5
delete inecesary spaces
FrancoLiberali Apr 6, 2023
7b7c0ea
fix structtag warning
FrancoLiberali Apr 6, 2023
08dd636
fix some code style
FrancoLiberali Apr 6, 2023
b3bbb96
fix typo in attribute
FrancoLiberali Apr 6, 2023
6425327
fix more typos and stylecheck
FrancoLiberali Apr 6, 2023
0722c5e
fix typos
FrancoLiberali Apr 6, 2023
a3985ce
fix some lint
FrancoLiberali Apr 7, 2023
58e88a3
fix more lint
FrancoLiberali Apr 7, 2023
671366d
activate api in e2e tests
FrancoLiberali Apr 7, 2023
051a618
fix crud files
FrancoLiberali Apr 7, 2023
5b1e54e
remove unused depencies
FrancoLiberali Apr 7, 2023
4ddb9a2
add spaces to increce readability
FrancoLiberali Apr 7, 2023
8e20b52
use constants in place of strings
FrancoLiberali Apr 7, 2023
25c4bff
docker for testing with volume
FrancoLiberali Apr 11, 2023
05456dd
add makefile for commands and put e2e files in a folder
FrancoLiberali Apr 11, 2023
9b5d99c
add integration tests
FrancoLiberali Apr 11, 2023
145e6da
add dependency injection yo integration tests
FrancoLiberali Apr 12, 2023
88bc103
delete unsed file
FrancoLiberali Apr 12, 2023
a1455dd
make integration tests able to connect to db
FrancoLiberali Apr 12, 2023
20f22ce
refactor + fixes in models + fix in getEntityWithParams + int tests
FrancoLiberali Apr 13, 2023
8e072d9
add entity and value repository to avoid bug with gorm
FrancoLiberali Apr 17, 2023
3c6ff02
use entityrepository in eav service to avoid gorm bug in create entity
FrancoLiberali Apr 17, 2023
c168341
add tests for other types
FrancoLiberali Apr 17, 2023
68576e8
add test of params types
FrancoLiberali Apr 17, 2023
4ca1e28
fix copy of lock
FrancoLiberali Apr 17, 2023
ef4d1fe
add foreign keys
FrancoLiberali Apr 17, 2023
f12ebff
add possibility to filter by null
FrancoLiberali Apr 17, 2023
74bc729
add unique to attribute name
FrancoLiberali Apr 17, 2023
aa45f61
remove query possibilities
FrancoLiberali Apr 17, 2023
42acfd0
force creation of fk indexes
FrancoLiberali Apr 18, 2023
4d2dda8
make examples easier to use and add doc
FrancoLiberali Apr 18, 2023
28bb790
fix int tests
FrancoLiberali Apr 18, 2023
ba9d24d
add user to dockerfile
FrancoLiberali Apr 18, 2023
272958d
add timeout to e2e tests
FrancoLiberali Apr 18, 2023
904900c
add timeout to e2e tests
FrancoLiberali Apr 18, 2023
a79ba37
try to fix recursive copy sonarcloud
FrancoLiberali Apr 18, 2023
c2319dd
try to fix sonarcloud non root
FrancoLiberali Apr 18, 2023
ef4914d
try to fix sonarcloud non root
FrancoLiberali Apr 18, 2023
8761772
try to fix sonarcloud non root 2
FrancoLiberali Apr 18, 2023
a8631d3
try to fix sonarcloud non root 3
FrancoLiberali Apr 18, 2023
1c55a9e
try to fix sonarcloud non root 4
FrancoLiberali Apr 18, 2023
a4a27c8
check if integration tests can affect to coverage
FrancoLiberali Apr 18, 2023
110acd9
add int tests to coverage report
FrancoLiberali Apr 18, 2023
d11a271
fix dependencies in ci
FrancoLiberali Apr 18, 2023
9d6d00b
fix coverage files path
FrancoLiberali Apr 18, 2023
ef3adbd
add doc + fix typos
FrancoLiberali Apr 19, 2023
6713f27
fix typos
FrancoLiberali Apr 19, 2023
9da1ea4
remove unused code
FrancoLiberali Apr 19, 2023
cb96340
fix problems in e2e tests
FrancoLiberali Apr 19, 2023
6b35a9a
add first e2e test for eav model
FrancoLiberali Apr 19, 2023
9db014a
add e2e test to query object
FrancoLiberali Apr 19, 2023
18a6735
add e2e test to getAll
FrancoLiberali Apr 20, 2023
64df93f
add e2e test to query with params
FrancoLiberali Apr 20, 2023
9760559
refacto test e2e
FrancoLiberali Apr 20, 2023
20495ae
add e2e test for object deletion
FrancoLiberali Apr 20, 2023
c89ca26
add e2e test for modify objects
FrancoLiberali Apr 20, 2023
c4fa0d3
do not show cover always
FrancoLiberali Apr 20, 2023
f23c328
add value unit tests + refactor
FrancoLiberali Apr 20, 2023
9ce9840
fix typo
FrancoLiberali Apr 20, 2023
05b97dd
regenerate mocks
FrancoLiberali Apr 20, 2023
9bc043c
remove old mock
FrancoLiberali Apr 20, 2023
fb40c90
fix fix typo
FrancoLiberali Apr 20, 2023
b447d8e
add more int test to eav service
FrancoLiberali Apr 20, 2023
4d686ba
fix e2e tests
FrancoLiberali Apr 20, 2023
d7c2afb
add more tests for eav service
FrancoLiberali Apr 21, 2023
adb7cb3
fix use tx as it should
FrancoLiberali Apr 21, 2023
0a6164f
add unit tests for attribute
FrancoLiberali Apr 21, 2023
805c49a
add unit tests for eav controller
FrancoLiberali Apr 21, 2023
76f3bd6
fix some code smells and remove unused code
FrancoLiberali Apr 21, 2023
efb0e16
change name in int tests
FrancoLiberali Apr 21, 2023
3bd40ea
remove unnecesarry tag from e2e tests
FrancoLiberali Apr 21, 2023
8a6cf1d
fix typo in readme int tests
FrancoLiberali Apr 21, 2023
4a254ee
update change log
FrancoLiberali Apr 21, 2023
e325a05
remove unused code in init.sh
FrancoLiberali Apr 21, 2023
f918471
go back to only warning logs in db
FrancoLiberali Apr 21, 2023
4c65bd9
remove unused http files from examples
FrancoLiberali Apr 21, 2023
72844ce
do not modify session_test in unit tests
FrancoLiberali Apr 21, 2023
2cc8ee1
add comments on repositories
FrancoLiberali Apr 21, 2023
37c37ad
remove unused nix file
FrancoLiberali Apr 21, 2023
e817ced
remove unused json files
FrancoLiberali Apr 21, 2023
503773a
update file tree in contributing
FrancoLiberali Apr 24, 2023
89ff181
update file tree in contributing 2
FrancoLiberali Apr 24, 2023
95c168d
refactor value
FrancoLiberali Apr 24, 2023
2c0804a
refactor create entity
FrancoLiberali Apr 24, 2023
44bf517
get entities with params
FrancoLiberali Apr 24, 2023
4b8f2f6
refactor eav controller and eav service
FrancoLiberali Apr 25, 2023
4bf5d87
remove todo
FrancoLiberali Apr 25, 2023
2292654
define constant for duplicate route
FrancoLiberali Apr 25, 2023
c91e9a3
add more unit tests
FrancoLiberali Apr 25, 2023
6ce40d8
add transaction system and use it in services/eav
FrancoLiberali Apr 25, 2023
3ac5fb8
fix contributing.md
FrancoLiberali Apr 25, 2023
7455c89
add more changelog
FrancoLiberali Apr 25, 2023
a3c141f
go back to one line format in auth controller
FrancoLiberali Apr 25, 2023
b8a945c
fix method names in eav controller
FrancoLiberali Apr 25, 2023
b4604c7
verify that relation value exists on creation and update
FrancoLiberali Apr 25, 2023
8b24cbc
remove unused file
FrancoLiberali Apr 25, 2023
120f772
go back to previus way to import uuid
FrancoLiberali Apr 25, 2023
2a980af
do not repeat commands in makefile
FrancoLiberali Apr 26, 2023
972f356
remove unnecessary exec with trans no response
FrancoLiberali Apr 26, 2023
43ce519
get entities params from query to body in json
FrancoLiberali Apr 26, 2023
f3ddd73
GetEntities add filter by multiple properties
FrancoLiberali Apr 26, 2023
ae65246
GetEntities add joins + refactor int tests
FrancoLiberali Apr 27, 2023
5c0bf9b
move functions that manage queries to entityRepository
FrancoLiberali Apr 27, 2023
589db20
remove incorrect body close
FrancoLiberali Apr 27, 2023
5cff9e9
Merge branch 'feature/eav' into eav_2
FrancoLiberali Apr 27, 2023
df6903b
add go-sec and fix the problems
FrancoLiberali Apr 27, 2023
0002099
GetEntities add unit tests for query creation
FrancoLiberali Apr 27, 2023
8c5e507
fix typos in readme
FrancoLiberali Apr 28, 2023
be6be11
Merge branch 'feature/eav' into feature/badaas_as_library
FrancoLiberali May 3, 2023
77e2289
remove main from badaas and create badgen
FrancoLiberali May 4, 2023
a804977
refactor: time to utils
FrancoLiberali May 4, 2023
d5418b3
remove binary
FrancoLiberali May 4, 2023
845d6ae
add binary to git ignore
FrancoLiberali May 4, 2023
c28c25c
fix docker folders
FrancoLiberali May 4, 2023
dbd7e55
badgen with embed files to work on go install
FrancoLiberali May 4, 2023
bef1116
change name to badctl and add doc
FrancoLiberali May 4, 2023
d91f293
update doc to new version
FrancoLiberali May 4, 2023
e1c2f28
change port in config according to db provider
FrancoLiberali May 4, 2023
cbe153f
remove unnecesary config_path flag
FrancoLiberali May 5, 2023
792d48f
update readme
FrancoLiberali May 5, 2023
924be19
fix tests e2e?
FrancoLiberali May 5, 2023
1461d8a
add routes unit tests
FrancoLiberali May 5, 2023
15db0ea
fix tests e2e
FrancoLiberali May 5, 2023
5782fac
fix test e2e?
FrancoLiberali May 5, 2023
2cf2af0
add go.work to make e2e test work
FrancoLiberali May 5, 2023
a6a3732
go min version to 1.18
FrancoLiberali May 5, 2023
b0170c6
Merge branch 'feature/security_analysis' into feature/eav_2
FrancoLiberali May 5, 2023
89aa9d5
fix gosec
FrancoLiberali May 5, 2023
765a976
Merge branch 'feature/eav_2' into feature/badaas_as_library
FrancoLiberali May 5, 2023
d0f5d83
badctl add more doc
FrancoLiberali May 5, 2023
5427c1d
update pr template
FrancoLiberali May 5, 2023
ba731ed
fix md problems
FrancoLiberali May 5, 2023
ac5560d
add again config_path to badctl
FrancoLiberali May 5, 2023
2774cec
fix only log error when error is not nul
FrancoLiberali May 5, 2023
720f9be
Merge branch 'feature/security_analysis' into feature/badaas_as_library
FrancoLiberali May 5, 2023
cbd4c9e
allow user to set api version
FrancoLiberali May 5, 2023
9e5cec5
add docs about the controllers
FrancoLiberali May 5, 2023
42dff10
add unique index to entity-attibute of a value
FrancoLiberali May 12, 2023
99bf338
Merge branch 'feature/eav_2' into feature/badaas_as_library
FrancoLiberali May 16, 2023
c96d09a
run ci in all prs
FrancoLiberali May 16, 2023
439798e
Merge branch 'feature/eav_2' into feature/badaas_as_library
FrancoLiberali May 16, 2023
a8e07b6
Merge branch 'feature/badaas_as_library' of github.com:ditrit/badaas …
FrancoLiberali May 16, 2023
629891a
fix lint
FrancoLiberali May 16, 2023
e669266
fix gitignore
FrancoLiberali Jun 1, 2023
440e61b
Merge branch 'feature/eav_2' into feature/badaas_as_library
FrancoLiberali Jun 1, 2023
ddaa65f
fix execute ci on every pr
FrancoLiberali Jun 1, 2023
aebc4e8
fix lint
FrancoLiberali Jun 1, 2023
263c3e5
Merge branch 'feature/security_analysis' into feature/eav_2
FrancoLiberali Jun 1, 2023
5f93fe4
refactor to reduce not tested err != nil
FrancoLiberali Jun 2, 2023
5e5e84f
use version of linter that works
FrancoLiberali Jun 2, 2023
dcc0b5b
Merge branch 'feature/eav' into feature/eav_2
FrancoLiberali Jun 2, 2023
09c547e
Merge branch 'feature/eav_2' into feature/badaas_as_library
FrancoLiberali Jun 2, 2023
02b06a0
go mod tidy
FrancoLiberali Jun 2, 2023
154ff5f
excluse conflictive dockerfile from sonar
FrancoLiberali Jun 2, 2023
2ce8e47
Merge branch 'feature/eav_2' into feature/badaas_as_library
FrancoLiberali Jun 2, 2023
8ad7472
fix sonar
FrancoLiberali Jun 2, 2023
9a9bbcd
badctl run to makefile
FrancoLiberali Jun 5, 2023
b7efda5
badctl run to makefile 2
FrancoLiberali Jun 5, 2023
398f276
add badctl unit tests
FrancoLiberali Jun 5, 2023
1f22408
remove eav model
FrancoLiberali Jul 26, 2023
1e35425
remove int tests
FrancoLiberali Jul 26, 2023
b583b66
remove posibility to use psql as db for badaas
FrancoLiberali Jul 26, 2023
3e919d7
remove go sec
FrancoLiberali Jul 26, 2023
e703066
remove int tests 2
FrancoLiberali Jul 26, 2023
8c23877
revert unnecesary changes
FrancoLiberali Jul 26, 2023
c220140
badaas is always a http server
FrancoLiberali Jul 26, 2023
9f0d3b9
add invoke
FrancoLiberali Jul 26, 2023
1cd00c7
fix badctl unit tests
FrancoLiberali Jul 26, 2023
249d3c0
init to start
FrancoLiberali Jul 26, 2023
bc63618
adapt docs to new way to start the application
FrancoLiberali Jul 26, 2023
7a265dc
add commands initializer unit tests
FrancoLiberali Jul 27, 2023
0217678
comments and privicy for commands initializers
FrancoLiberali Jul 27, 2023
e0019b6
remove unused file
FrancoLiberali Jul 27, 2023
9c71d50
add tests for badaas initialization
FrancoLiberali Jul 27, 2023
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
21 changes: 12 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
.editorconfig
.git
.gitignore
.github
sonar-project.properties
AUTHORS.md
CONTRIBUTING.md
*.md
LICENSE
Makefile
NOTICE
README.md
arm/
powerpc/
mips/
.golangci.yml
_temp
.vscode
node1
node2
node3
.gitignore
changelog.md
go.work
go.work.sum
tools/
test_e2e/
!test_e2e/test_api.go
!test_e2e/go.mod
!test_e2e/go.sum
mocks/
docker/
**/*_test.go
15 changes: 9 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,33 @@ title: ''
labels: Bug
---

**Describe the bug**
## Describe the bug

A clear and concise description of what the bug is.

**To Reproduce**
## To Reproduce

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
## Expected behavior

A clear and concise description of what you expected to happen.

**Screenshots**
## Screenshots

If applicable, add screenshots to help explain your problem.

**Application (please complete the following information):**
## Application

Please complete the following information:

- badaas version [X.X.X] or commit hash

**Additional context**
## Additional context

Add any other context about the problem here.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/user_story.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ labels: User Story, To be verify

`[Put all others constraints here, like list of acceptances values or other]`

## Resources:
## Resources

`[Put all your resources here, like mockups, diagrams or other here]`

Expand All @@ -37,4 +37,3 @@ labels: User Story, To be verify
## Links

`[Only use by the team, to link this feature with epic, technical tasks or bugs]`

5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:information_source: Don't forget to modify the changelog.md before merging this branch.

:information_source: Don't forget to modify config files:
- `badaas.example.yml`: the example file.
- `/scripts/e2e/api/ci-conf.yml`: otherwise you will probably break the CI. (*For local testing please use [act](https://github.com/nektos/act)*).

- `badaas.example.yml`: the example file.
- `tools/badctl/cmd/config/badaas.yml`: the default config file generated by badctl.
64 changes: 37 additions & 27 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
branch-naming-rules:
name: Check branch name
Expand All @@ -18,8 +19,8 @@ jobs:
min_length: 5
max_length: 50

unit-tests:
name: Unit tests
check-style:
name: Code style
needs: [branch-naming-rules]
runs-on: ubuntu-latest
steps:
Expand All @@ -30,15 +31,16 @@ jobs:
with:
go-version: '^1.18'
cache: true
- name: Run test
run: go test $(go list ./... | sed 1d) -coverprofile=coverage.out -v
- uses: actions/upload-artifact@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
name: coverage
path: coverage.out
version: v1.52.2
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true

check-style:
name: Code style
unit-tests:
name: Unit tests
needs: [branch-naming-rules]
runs-on: ubuntu-latest
steps:
Expand All @@ -49,14 +51,18 @@ jobs:
with:
go-version: '^1.18'
cache: true

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
- name: Run BaDaaS tests
run: go test ./... -coverprofile=coverage_unit.out -v
- uses: actions/upload-artifact@v3
with:
version: latest
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
name: coverage_unit
path: coverage_unit.out
- name: Run BaDctl tests
run: go test ./tools/badctl/... -coverprofile=coverage_badctl.out -v
- uses: actions/upload-artifact@v3
with:
name: coverage_badctl
path: coverage_badctl.out

e2e-tests:
name: E2E Tests
Expand All @@ -71,25 +77,25 @@ jobs:
go-version: '^1.18'
cache: true
- name: Start containers
run: docker compose -f "scripts/e2e/docker-compose.yml" up -d --build
run: docker compose -f "docker/test_db/docker-compose.yml" -f "docker/test_api/docker-compose.yml" up -d --build
- name: Wait for API server to be up
uses: mydea/action-wait-for-api@v1
with:
url: "http://localhost:8000/info"
timeout: 20
timeout: 60
- name: Run test
run: go test -v
run: go test ./test_e2e -v
- name: Get logs
if: always()
run: docker compose -f "scripts/e2e/docker-compose.yml" logs --no-color 2>&1 | tee app.log &
run: docker compose -f "docker/test_db/docker-compose.yml" -f "docker/test_api/docker-compose.yml" logs --no-color 2>&1 | tee app.log &
- name: Stop containers
if: always()
run: docker compose -f "scripts/e2e/docker-compose.yml" down
run: docker compose -f "docker/test_db/docker-compose.yml" -f "docker/test_api/docker-compose.yml" down
- uses: actions/upload-artifact@v3
with:
name: docker-compose-e2e-logs
path: app.log

sonarcloud:
name: SonarCloud
needs: [unit-tests, check-style]
Expand All @@ -98,14 +104,18 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download line coverage report
- name: Download unit tests line coverage report
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage.out
name: coverage_unit
path: coverage_unit.out
- name: Download badctl unit tests line coverage report
uses: actions/download-artifact@v3
with:
name: coverage_badctl
path: coverage_badctl.out
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@
*.out

# Dependency directories (remove the comment below to include it)
# vendor/
vendor/

# Go workspace file
go.work
# go.work

# cockroach files
node*

#Vscode conf
# vscode conf
.vscode

# binary output
badaas

# temporary directories
_temp
badctl
!tools/badctl/
69 changes: 31 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

### Unit tests

We use the standard test suite in combination with [github.com/stretchr/testify](https://github.com/stretchr/testify) to do our unit testing. Mocks are generated using [mockery](https://github.com/vektra/mockery) a mock generator using this command `mockery --all --keeptree`.
We use the standard test suite in combination with [github.com/stretchr/testify](https://github.com/stretchr/testify) to do our unit testing. Mocks are generated using [mockery](https://github.com/vektra/mockery) a mock generator using this command `make test_generate_mocks`.

To run them, please run:

```sh
go test $(go list ./... | sed 1d) -v
make -k test_unit
```

### Feature tests (of end to end tests)
Expand All @@ -29,75 +29,68 @@ We use docker to run a Badaas instance in combination with one node of Cockroach
Run:

```sh
docker compose -f "scripts/e2e/docker-compose.yml" up -d --build
make test_e2e
```

Then in an another shell:

```sh
go test -v
```

The feature files can be found in the `feature` folder.
The feature files can be found in the `test_e2e/features` folder.

## Logger

We use ubber's [zap](https://pkg.go.dev/go.uber.org/zap) to log stuff, please take `zap.Logger` as an argument for your services constructors. [fx](https://github.com/uber-go/fx) will provide your service with an instance.
We use uber's [zap](https://pkg.go.dev/go.uber.org/zap) to log stuff, please take `zap.Logger` as an argument for your services constructors. [fx](https://github.com/uber-go/fx) will provide your service with an instance.

## Directory structure

This is the directory structure we use for the project:

- `commands/` *(Go code)*: Contains all the CLI commands. This package relies heavily on github.com/ditrit/verdeter.
- `configuration/` *(Go code)*: Contains all the configuration holders. Please only use the interfaces, they are all mocked for easy testing
- `configuration/` *(Go code)*: Contains all the configuration holders. Please only use the interfaces, they are all mocked for easy testing.
- `controllers/` *(Go code)*: Contains all the http controllers, they handle http requests and consume services.
- `docs/`: Contains the documentation.
- `features/`: Contains all the feature tests (or end to end tests).
- `test_e2e/`: Contains all the feature and steps for e2e tests.
- `logger/` *(Go code)*: Contains the logger creation logic. Please don't call it from your own services and code, use the dependency injection system.
- `persistance/` *(Go code)*:
- `/gormdatabase/` *(Go code)*: Contains the logic to create a <https://gorm.io> database. Also contains a go package named `gormzap`: it is a compatibility layer between *gorm.io/gorm* and *github.com/uber-go/zap*.
- `/models/` *(Go code)*: Contains the models. (For a structure to me considered a valid model, it has to embed `models.BaseModel` and satisfy the `models.Tabler` interface. This interface returns the name of the sql table.)
- `/dto/` *(Go code)*: Contains the Data Transfert Objects. They are used mainly to decode json payloads.
- `/pagination/` *(Go code)*: Contains the pagination logic.
- `/repository/` *(Go code)*: Contains the repository interface and implementation. Use uint as ID when using gorm models.
- `persistance/` *(Go code)*:
- `gormdatabase/` *(Go code)*: Contains the logic to create a <https://gorm.io> database. Also contains a go package named `gormzap`: it is a compatibility layer between *gorm.io/gorm* and *github.com/uber-go/zap*.
- `models/` *(Go code)*: Contains the models. (For a structure to me considered a valid model, it has to embed `models.BaseModel` and satisfy the `models.Tabler` interface. This interface returns the name of the sql table.).
- `dto/` *(Go code)*: Contains the Data Transfer Objects. They are used mainly to decode json payloads.
- `pagination/` *(Go code)*: Contains the pagination logic.
- `repository/` *(Go code)*: Contains the repository interfaces and implementations to manage queries to the database.
- `resources/` *(Go code)*: Contains the resources shared with the rest of the codebase (ex: API version).
- `router/` *(Go code)*: Contains http router of badaas.
- `/middlewares/` *(Go code)*: Contains the various http middlewares that we use.
- `scripts/e2e/` : Contains the docker-compose file for end-to-end test.
- `/api/` : Contains the Dockerfile to build badaas with a dedicated config file.
- `/db/` : Contains the Dockerfile to build a developpement version of CockroachDB.
- `services/` *(Go code)*: Contains the Dockerfile to build a developpement version of CockroachDB.
- `/auth/protocols/`: Contains the implementations of authentication clients for differents protocols.
- `/basicauth/` *(Go code)*: Handle the authentification using email/password.
- `/oidc/` *(Go code)*: Handle the authentication via Open-ID Connect.
- `/sessionservice/` *(Go code)*: Handle sessions and their lifecycle.
- `/userservice/` *(Go code)*: Handle users.
- `validators/` *(Go code)*: Contains validators such as an email validator.
- `middlewares/` *(Go code)*: Contains the various http middlewares that we use.
- `docker/` : Contains the docker, docker-compose file and configuration files for different environments.
- `api/` : Contains the Dockerfile to build badaas with a dedicated config file.
- `test_db/` : Contains the Dockerfile to build a development/test version of CockroachDB.
- `test_api/` : Contains files to build a development/test version of the api.
- `services/` *(Go code)*: Contains services.
- `auth/protocols/`: Contains the implementations of authentication clients for different protocols.
- `basicauth/` *(Go code)*: Handle the authentication using email/password.
- `oidc/` *(Go code)*: Handle the authentication via Open-ID Connect.
- `sessionservice/` *(Go code)*: Handle sessions and their lifecycle.
- `userservice/` *(Go code)*: Handle users.
- `validators/` *(Go code)*: Contains validators such as an email validator.

At the root of the project, you will find:

- The README.
- The changelog.
- The files for the E2E test http support.
- The LICENCE file.
- The LICENSE file.

## Git

### Branch naming policy

`[BRANCH_TYPE]/[BRANCH_NAME]`

- `BRANCH_TYPE` is a prefix to describe the purpose of the branch.

- `BRANCH_TYPE` is a prefix to describe the purpose of the branch.
Accepted prefixes are:
- `feature`, used for feature development
- `bugfix`, used for bug fix
- `improvement`, used for refacto
- `improvement`, used for refactor
- `library`, used for updating library
- `prerelease`, used for preparing the branch for the release
- `release`, used for releasing project
- `hotfix`, used for applying a hotfix on main
- `poc`, used for proof of concept
- `poc`, used for proof of concept
- `BRANCH_NAME` is managed by this regex: `[a-z0-9._-]` (`_` is used as space character).

### Default branch
Expand All @@ -117,5 +110,5 @@ Steps to release:
- Verify the content of the `changelog.md`.
- Commit the modifications with the label `Release version X.Y.Z`.
- Create a pull request on github for this branch into `main`.
- Once the pull request validated and merged, tag the `main` branch with `vX.Y.Z`
- After the tag is pushed, make the release on the tag in GitHub
- Once the pull request validated and merged, tag the `main` branch with `vX.Y.Z`.
- After the tag is pushed, make the release on the tag in GitHub.
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

Loading
Loading