Previously:
- There is confusion between nameWithOwner and queryLanguage. Both are strings.
Between
runResult, err := codeql.RunQuery(databasePath, job.QueryLanguage, queryPackPath, tempDir)
(agent.go l205)
and
func RunQuery(database string, nwo string, queryPackPath string, tempDir string) (*RunQueryResult, error)
QueryLanguage is suddenly name with owner in the code.
Added some debugging, the value is the query language in the two places it gets used:
server | 2024/07/03 18:30:15 DEBUG Processed request info location="{Data:map[bucket:packs key:1]}" language=cpp
...
agent | 2024/07/03 18:30:15 DEBUG XX: is nwo a name/owner, or the original callers' queryLanguage? nwo=cpp
...
agent | 2024/07/03 18:30:19 DEBUG XX: 2: is nwo a name/owner, or the original callers' queryLanguage? nwo=cpp
Changes:
- Introduce explicit type QueryLanguage = string and update code to clarify
- inline trivial function
37 lines
771 B
Go
37 lines
771 B
Go
package server
|
|
|
|
import (
|
|
"mrvacommander/pkg/artifactstore"
|
|
"mrvacommander/pkg/common"
|
|
"mrvacommander/pkg/qldbstore"
|
|
"mrvacommander/pkg/queue"
|
|
"mrvacommander/pkg/state"
|
|
)
|
|
|
|
type SessionInfo struct {
|
|
ID int
|
|
QueryPack string
|
|
Language queue.QueryLanguage
|
|
AccessMismatchRepos []common.NameWithOwner
|
|
NotFoundRepos []common.NameWithOwner
|
|
NoCodeqlDBRepos []common.NameWithOwner
|
|
}
|
|
|
|
type CommanderSingle struct {
|
|
v *Visibles
|
|
}
|
|
|
|
func NewCommanderSingle(st *Visibles) *CommanderSingle {
|
|
c := CommanderSingle{v: st}
|
|
setupEndpoints(&c)
|
|
go c.ConsumeResults()
|
|
return &c
|
|
}
|
|
|
|
type Visibles struct {
|
|
Queue queue.Queue
|
|
State state.ServerState
|
|
Artifacts artifactstore.Store
|
|
CodeQLDBStore qldbstore.Store
|
|
}
|