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

View File

@@ -1,5 +1,7 @@
# gosearch # 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 ### Diagram of the Architecture
```mermaid ```mermaid

View File

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

View File

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

1
sonar-project.properties Normal file
View File

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