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

badaas as library #61

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

badaas as library #61

wants to merge 20 commits into from

Conversation

FrancoLiberali
Copy link

@FrancoLiberali FrancoLiberali commented Jul 27, 2023

  • Convert BaDaaS into a library: before this repository was a test http server, now BaDaaS is a library, which implies multiple changes in files like badaas.go, ModuleFx.go and the way an application is created. At https://github.com/ditrit/badaas-example an example of badaas usage is shown. This also implies a complete refactoring of the commands/ folder, which is now in configuration/. This change is very important for the progress of the project because in the next pull requests the object persistence module will be added and for that badaas needs to be a library.
  • Add badctl (tools/badctl) to generate the files required to run a badaas application

Related with the pull requests ditrit/badaas-example#8 and ditrit/badaas-cli#1

@FrancoLiberali FrancoLiberali changed the title Feature/badaas as library 2 badaas as library Jul 27, 2023
@FrancoLiberali FrancoLiberali marked this pull request as ready for review July 27, 2023 09:59
logger,
userService,
sessionService,
)
response := httptest.NewRecorder()
request := httptest.NewRequest(
"POST",
"/v1/auth/basic/login",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this changes from commit "fix typo in Authentication" because it's not a typo.

logger,
userService,
sessionService,
)
response := httptest.NewRecorder()
request := httptest.NewRequest(
"POST",
"/v1/auth/basic/login",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this changes from commit "fix typo in Authentication" because it's not a typo.

@@ -86,7 +86,7 @@ func Test_BasicLoginHandler_LoginFailed(t *testing.T) {
response := httptest.NewRecorder()
request := httptest.NewRequest(
"POST",
"/v1/auth/basic/login",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this changes from commit "fix typo in Authentication" because it's not a typo.

@@ -129,7 +129,7 @@ func Test_BasicLoginHandler_LoginSuccess(t *testing.T) {
response := httptest.NewRecorder()
request := httptest.NewRequest(
"POST",
"/v1/auth/basic/login",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this changes from commit "fix typo in Authentication" because it's not a typo.

@@ -125,3 +125,8 @@ func NewUnauthorizedError(errorName string, msg string) HTTPError {
true,
)
}

// A constructor for an HTTPError "Bad Request"
func NewBadRequestError(err string, msg string) HTTPError {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this changes from commit "fix typo in Authentication" because it's not a typo.

@@ -0,0 +1,84 @@
# badctl: the BadAas controller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace all "BadAas" by "Badaas"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be done in new repo

@@ -0,0 +1,84 @@
# badctl: the BadAas controller

`badctl` is the command line tool that makes it possible to configure and run your BadAas applications easily.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename "badctl" by "badaas-cli"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be done in new repo

badctl help [command]
```

### gen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rework on title to make it comprehensible

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be done in new repo

@@ -0,0 +1,94 @@
package cmd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing all documentation on this file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be done in new repo

@@ -0,0 +1,41 @@
package cmd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad test file, because we want to have readable scenario like:

generateDockerFiles should generate all wanted file
copyDir should stop if os.IsNotExists
(...)

I don't see any test case in your test, for me you don't check success or errors cases.

@FrancoLiberali FrancoLiberali force-pushed the feature/badaas_as_library_2 branch 8 times, most recently from 02962d5 to 3c6cee9 Compare July 31, 2023 12:24
@FrancoLiberali FrancoLiberali self-assigned this Aug 1, 2023
@sonarcloud
Copy link

sonarcloud bot commented Aug 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

84.6% 84.6% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants