6 Commits

Author SHA1 Message Date
64efaf5514 fix: add default log level
Some checks failed
Release / Generate changelog (push) Failing after -16s
2025-03-26 09:32:00 +01:00
8d320f96cd docs: add sonarqube badge
All checks were successful
Go / build (push) Successful in -11s
renovate / renovate (push) Successful in 19s
SonarQube Scan / Build and analyze (push) Successful in 11s
2025-03-26 08:33:01 +01:00
75c5e7ea4c fix: add sonarqube properties
All checks were successful
Go / build (push) Successful in -12s
renovate / renovate (push) Successful in 18s
SonarQube Scan / Build and analyze (push) Successful in 20s
2025-03-26 08:29:48 +01:00
e6e668451a ci: add quality gate
Some checks failed
Go / build (push) Successful in -11s
renovate / renovate (push) Successful in 19s
SonarQube Scan / Build and analyze (push) Failing after 2s
2025-03-26 08:24:21 +01:00
9528fca452 ci: update sonarqube pipeline
Some checks failed
Go / build (push) Successful in -12s
renovate / renovate (push) Successful in 18s
SonarQube Scan / SonarQube Trigger (push) Failing after 3s
2025-03-26 08:19:30 +01:00
cf95ee2acb fix: Updated AddDocToIndex function to ignore additional special characters in scanner.Text()
Some checks failed
Go / build (push) Successful in -11s
renovate / renovate (push) Successful in 19s
SonarQube Scan / SonarQube Trigger (push) Failing after -17s
2025-03-26 08:14:11 +01:00
5 changed files with 21 additions and 14 deletions

View File

@@ -7,17 +7,19 @@ on:
name: SonarQube Scan
jobs:
sonarqube:
name: SonarQube Trigger
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- name: Checking out
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: kitabisa/sonarqube-action@v1.2.0
with:
host: ${{ secrets.SONARQUBE_HOST }}
login: ${{ secrets.SONARQUBE_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
- uses: SonarSource/sonarqube-quality-gate-action@v1
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}

View File

@@ -1,5 +1,7 @@
# gosearch
[![Quality Gate Status](https://sonar.dev-null.rocks/api/project_badges/measure?project=gosearch&metric=alert_status&token=sqb_4d86c3b73f6837027a319df42d2f70ccb46e56a2)](https://sonar.dev-null.rocks/dashboard?id=gosearch)
### Diagram of the Architecture
```mermaid

View File

@@ -2,6 +2,7 @@ package http
import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/log"
"github.com/gofiber/fiber/v2/middleware/logger"
)
@@ -12,6 +13,7 @@ func StartService() {
app.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
log.SetLevel(log.LevelInfo)
// Configure Routes
app = configureRoutes(app)

View File

@@ -87,7 +87,7 @@ func AddDocToIndex(url string, content string) {
scanner.Split(bufio.ScanWords)
for scanner.Scan() {
word := strings.ToLower(strings.Trim(scanner.Text(), ",.!?"))
word := strings.ToLower(strings.Trim(scanner.Text(), ",.!?&<>;:=§$%{}[]()|"))
if Index[word] == nil {
Index[word] = make(map[string]int)
@@ -100,7 +100,7 @@ func AddDocToIndex(url string, content string) {
}
}
updateIndex("default")
go updateIndex("default")
}
func writeStructToFile(filename string, data interface{}) error {

1
sonar-project.properties Normal file
View File

@@ -0,0 +1 @@
sonar.projectKey=gosearch