File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ linters:
9191 - unused
9292 # - whitespace
9393issues :
94+ exclude-dirs :
95+ - test/testdata_etc
96+ - internal/cache
97+ - internal/renameio
98+ - internal/robustio
9499 # Excluding configuration per-path, per-linter, per-text and per-source
95100 exclude-rules :
96101 - path : _test\.go
@@ -106,8 +111,4 @@ issues:
106111 text : " unnecessaryDefer:"
107112run :
108113 timeout : 5m
109- skip-dirs :
110- - test/testdata_etc
111- - internal/cache
112- - internal/renameio
113- - internal/robustio
114+
Original file line number Diff line number Diff line change @@ -8,44 +8,6 @@ import (
88 "github.com/updatecli/udash/pkg/database"
99)
1010
11- // dbGetSCMFromTarget represents a specific scm configuration from the database.
12- func dbGetSCMFromTarget () ([]DatabaseSCMRow , error ) {
13-
14- query := `
15- SELECT j.targets -> 'Scm' ->> 'URL', j.targets -> 'Scm' -> 'Branch' ->> 'Target'
16- FROM (
17- SELECT jsonb_path_query(data::jsonb, '$.Targets[*].*') as targets
18- FROM pipelineReports
19- ) j group by 1,2;`
20-
21- rows , err := database .DB .Query (context .Background (), query )
22- if err != nil {
23- logrus .Errorf ("get scm from pipeline target(s): %q\n \t %s" , query , err )
24- return nil , err
25- }
26-
27- results := []DatabaseSCMRow {}
28-
29- for rows .Next () {
30- r := DatabaseSCMRow {}
31-
32- err = rows .Scan (& r .URL , & r .Branch )
33- if err != nil {
34- logrus .Errorf ("scanning scm row failed: %s" , err )
35- continue
36- }
37-
38- // No need to return empty git url
39- if r .URL == "" {
40- continue
41- }
42-
43- results = append (results , r )
44- }
45-
46- return results , nil
47- }
48-
4911func dbInsertSCM (url , branch string ) (string , error ) {
5012
5113 var ID uuid.UUID
You can’t perform that action at this time.
0 commit comments