wip: server is now fully functional, some FIXMEs remain
This commit is contained in:
committed by
=Michael Hohn
parent
f7155eba50
commit
ba44db04da
@@ -12,7 +12,9 @@ DBOWNER=$1
|
|||||||
shift
|
shift
|
||||||
DBREPO=$1
|
DBREPO=$1
|
||||||
|
|
||||||
|
# FIXME Provide this via environment or explicit argument
|
||||||
GMSROOT=/Users/hohn/local/ghes-mirva-server
|
GMSROOT=/Users/hohn/local/ghes-mirva-server
|
||||||
|
GMSROOT=/Users/hohn/work-gh/mrva/mrvacommander/cmd/server
|
||||||
|
|
||||||
#* Set up derived paths
|
#* Set up derived paths
|
||||||
DBPATH=$GMSROOT/var/codeql/dbs/$DBOWNER/$DBREPO
|
DBPATH=$GMSROOT/var/codeql/dbs/$DBOWNER/$DBREPO
|
||||||
@@ -30,7 +32,6 @@ QUERYOUTF=$QUERYOUTD/${DBOWNER}_${DBREPO}.sarif
|
|||||||
#** Extract database
|
#** Extract database
|
||||||
mkdir -p $DBEXTRACT && cd $DBEXTRACT
|
mkdir -p $DBEXTRACT && cd $DBEXTRACT
|
||||||
unzip -o -q $DBZIP
|
unzip -o -q $DBZIP
|
||||||
DBINFIX=`\ls | head -1` # Could be cpp, codeql_db, or whatever
|
|
||||||
|
|
||||||
# Extract query pack
|
# Extract query pack
|
||||||
mkdir -p $QUERYEXTRACT && cd $QUERYEXTRACT
|
mkdir -p $QUERYEXTRACT && cd $QUERYEXTRACT
|
||||||
@@ -41,17 +42,17 @@ mkdir -p $QUERYOUTD
|
|||||||
|
|
||||||
#* run database analyze
|
#* run database analyze
|
||||||
cd $GMSROOT
|
cd $GMSROOT
|
||||||
codeql database analyze --format=sarif-latest --rerun \
|
codeql database analyze --format=sarif-latest --rerun \
|
||||||
--output $QUERYOUTF \
|
--output $QUERYOUTF \
|
||||||
-j8 \
|
-j8 \
|
||||||
-- $DBPATH/$DBINFIX $QUERYEXTRACT
|
-- $DBPATH $QUERYEXTRACT
|
||||||
|
|
||||||
#* report result
|
#* report result
|
||||||
# var/codeql/sarif/localrun/google/flatbuffers/google_flatbuffers.sarif
|
|
||||||
printf "run-analysis-output in %s\n" $QUERYOUTF
|
printf "run-analysis-output in %s\n" $QUERYOUTF
|
||||||
|
|
||||||
# TODO Is the bqrs really necessary? It can also be found by the go code at this point.
|
# TODO Is the bqrs really necessary? It can also be found by the go code at this point.
|
||||||
# The name of the query is only found in the query pack itself and would have to be
|
# TODO The name of the query is only found in the query pack itself and would have
|
||||||
# extracted from there.
|
# to be extracted from there.
|
||||||
# var/codeql/dbs/google/flatbuffers/cpp/results/codeql-remote/query/FlatBuffersFunc.bqrs
|
|
||||||
# BQRSPATH=$GMSROOT/var/codeql/dbs/$DBOWNER/$DBREPO/$LANGUAGE/results/codeql-remote/query/
|
# BQRSPATH=$GMSROOT/var/codeql/dbs/$DBOWNER/$DBREPO/$LANGUAGE/results/codeql-remote/query/
|
||||||
# printf "run-analysis-bqrs in %s\n" $QUERYOUTF
|
# printf "run-analysis-bqrs in %s\n" $QUERYOUTF
|
||||||
@@ -45,7 +45,7 @@ func (r *RunnerSingle) worker(wid int) {
|
|||||||
|
|
||||||
slog.Debug("Analysis: running", "job", job)
|
slog.Debug("Analysis: running", "job", job)
|
||||||
storage.SetStatus(job.QueryPackId, job.ORL, common.StatusQueued)
|
storage.SetStatus(job.QueryPackId, job.ORL, common.StatusQueued)
|
||||||
cmd := exec.Command(path.Join(cwd, "cmd", "run-analysis.sh"),
|
cmd := exec.Command(path.Join(cwd, "bin", "run-analysis.sh"),
|
||||||
strconv.FormatInt(int64(job.QueryPackId), 10),
|
strconv.FormatInt(int64(job.QueryPackId), 10),
|
||||||
job.QueryLanguage, job.ORL.Owner, job.ORL.Repo)
|
job.QueryLanguage, job.ORL.Owner, job.ORL.Repo)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user