Skip to content

Commit 008abd4

Browse files
ethanalee-workgopherbot
authored andcommitted
internal: append JobID column to table schema
- Previously, one was unable to inspect individual jobs triggered by the ejobs command. - Now, tables can be queried via JobID for individual jobs. Change-Id: I595693197b7290f28217f42a11c5082e564c42f3 Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/698315 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Ethan Lee <[email protected]> Reviewed-by: Markus Kusano <[email protected]>
1 parent a9a23b6 commit 008abd4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

internal/analysis/analysis.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ type Result struct {
150150
Version string `bigquery:"version"`
151151
SortVersion string `bigquery:"sort_version"`
152152
CommitTime time.Time `bigquery:"commit_time"`
153+
JobID string `bigquery:"job_id"`
153154
// The name of the analysis binary that was executed.
154155
// A single binary may run multiple analyzers.
155156
BinaryName string `bigquery:"binary_name"`

internal/worker/analysis.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ func (s *analysisServer) readWorkVersion(ctx context.Context, module_path, versi
187187
func (s *analysisServer) scan(ctx context.Context, req *analysis.ScanRequest, localBinaryPath string, wv analysis.WorkVersion) *analysis.Result {
188188
row := &analysis.Result{
189189
ModulePath: req.Module,
190+
JobID: req.JobID,
190191
Version: req.Version,
191192
BinaryName: req.Binary,
192193
WorkVersion: wv,

internal/worker/analysis_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func TestAnalysisScan(t *testing.T) {
158158
Version: version,
159159
SortVersion: "0,0,0,~20250813163312-416cbb1e76e6",
160160
CommitTime: commitTime,
161+
JobID: "jid",
161162
BinaryName: "analyzer",
162163
WorkVersion: wv,
163164
Error: "",
@@ -193,6 +194,7 @@ func TestAnalysisScan(t *testing.T) {
193194
ModulePath: modulePath,
194195
Version: version,
195196
SortVersion: "0,0,0,~20250813163312-416cbb1e76e6",
197+
JobID: "jid",
196198
BinaryName: "bad",
197199
WorkVersion: wv,
198200
ErrorCategory: "SYNTHETIC - MISC",

0 commit comments

Comments
 (0)