Skip to content

Commit

Permalink
Merge pull request #32 from LabGraphTeam/fix/refactoring
Browse files Browse the repository at this point in the history
Fix/refactoring
  • Loading branch information
LeonardoMeireles55 authored Jan 26, 2025
2 parents 45f787a + d171a8a commit e9b7827
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 10 deletions.
50 changes: 49 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Existing exclusions
**/target/
**/docs/
**/view/
Expand All @@ -6,4 +7,51 @@
**/CITATION.cff
**/LICENSE
**/.vscode
**/.editorconfig
**/.editorconfig

# Build and Dependencies
**/*.jar
**/*.war
**/*.ear
**/build/
**/.mvn/
**/node_modules/
**/package-lock.json

# IDE Files
**/.idea/
**/.settings/
**/.project
**/.classpath
**/*.iml
**/*.iws
**/*.ipr
**/.factorypath
**/.sts4-cache/

# Logs and Temp Files
**/*.log
**/logs/
**/*.tmp
**/*.temp
**/.env*
**/*.env

# Test and Documentation
**/test/
**/tests/
**/coverage/
**/*.md
**/javadoc/
**/swagger/

# OS Files
**/.DS_Store
**/Thumbs.db

# Development Files
**/.gitignore
**/.dockerignore
**/docker-compose*.yml
**/.editorconfig
**/sonar-project.properties
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Existing entries
HELP.md
lab.log
*.log
Expand All @@ -8,6 +9,7 @@ target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
Expand All @@ -16,11 +18,13 @@ target/
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
Expand All @@ -30,8 +34,50 @@ target/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
.env
package-lock.json
package.json

### Additional Spring Boot ###
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.env
.env.local
.env.development.local
.env.test.local
.env.production.local

### System Files ###
.DS_Store
Thumbs.db
*.swp
*.swo

### Logs ###
logs/
*.tmp
*.temp

### Spring Specific ###
application-*.yml
application-*.properties
!application.yml
!application.properties

### Maven ###
.mvn/*
!.mvn/wrapper/maven-wrapper.properties
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
2 changes: 1 addition & 1 deletion docker-compose-db-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ services:
- ${DB_LOCAL_PORT}:${DB_DOCKER_PORT}
volumes:
- mysql-volume:/var/lib/mysql
- ./database:/docker-entrypoint-initdb.
- ./database:/docker-entrypoint-initdb.d
volumes:
mysql-volume:
12 changes: 10 additions & 2 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mariadb:
image: mariadb:10.10
image: mariadb:11.2
restart: always
env_file: ./.env
environment:
Expand All @@ -15,7 +15,7 @@ services:
- app-network

quality-lab-pro:
restart: on-failure
restart: always
build:
context: ./
dockerfile: Dockerfile
Expand All @@ -25,9 +25,17 @@ services:
ports:
- ${SERVER_LOCAL_PORT}:${SERVER_DOCKER_PORT}
environment:
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE}
SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL}
SPRING_DATASOURCE_USERNAME: ${DB_USER}
SPRING_DATASOURCE_PASSWORD: ${DB_ROOT_PASSWORD}
SERVER_PORT: ${SERVER_DOCKER_PORT}
API_SECURITY_TOKEN_SECRET: ${API_SECURITY_TOKEN_SECRET}
API_SECURITY_ISSUER: ${API_SECURITY_ISSUER}
SPRING_MAIL_USERNAME: ${SPRING_MAIL_USERNAME}
SPRING_MAIL_PASSWORD: ${SPRING_MAIL_PASSWORD}
EMAIL_TO_SEND_LIST: ${EMAIL_TO_SEND_LIST}
command: [ "java", "-jar", "-Dspring.profiles.active=local", "app.jar" ]
networks:
- app-network

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import org.springframework.data.web.config.EnableSpringDataWebSupport;

@EnableCaching
@EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO)
@EnableSpringDataWebSupport(
pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO)
@SpringBootApplication()
public class ControlApplication {
public static void main(final String[] args) {
SpringApplication.run(ControlApplication.class, args);
}
public static void main(final String[] args) {
SpringApplication.run(ControlApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean isAnalyticsNonExistent(AnalyticsRecord values) {

private boolean isRuleBroken(AnalyticsRecord record) {
String rules = record.rules();
return (!"Average".equals(rules));
return ("+3s".equals(rules) || "-3s".equals(rules) || "-2s".equals(rules) || "+2s".equals(rules));
}

public List<AnalyticsRecord> validateAnalyticsNameExists(List<AnalyticsRecord> results) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{"properties": [
{
"name": "api.security.issuer",
"type": "java.lang.String",
"description": "A description for 'api.security.issuer'"
},
{
"name": "api.security.token.secret",
"type": "java.lang.String",
"description": "A description for 'api.security.token.secret'"
},
{
"name": "email.to.send.list",
"type": "java.lang.String",
"description": "A description for 'email.to.send.list'"
},
{
"name": "DATABASE_TO_UPPER",
"type": "java.lang.String",
"description": "A description for 'DATABASE_TO_UPPER'"
}
]}
2 changes: 1 addition & 1 deletion src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ logging.level.leonardo=DEBUG
management.endpoint.health.show-details=always
# Database config
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mariadb://localhost:3306/lab_api_alpha}
spring.datasource.url=${SPRING_DATASOURCE_URL}
spring.datasource.username=root
spring.datasource.password=root
spring.flyway.clean-disabled=false
Expand Down

0 comments on commit e9b7827

Please sign in to comment.