Add ability to query a single job from Prow in ResultStore. - #1274
Conversation
|
/retest |
ab21f0f to
7832e6a
Compare
| } | ||
|
|
||
| var ( | ||
| queryRe = regexp.MustCompile(`target:"?.*"?`) |
There was a problem hiding this comment.
Seems this regexp permits patterns like
target:"foo
target:foo"
target:"foo", "bar"
etc.
Do you need it to be more defensive? What is the source of these strings?
There was a problem hiding this comment.
It doesn't have to be, but for now it probably should be. The source of these is either user-defined (so someone can misconfigure it, we just want to discourage it), or automatically-generated TestGrid groups (like groups created from Prow annotations or the like; in this case, for auto-generation when we know a Prow job is using a ResultStore source).
Tightened up the regular expression, thanks for catching this!
| return "", nil | ||
| } | ||
| // For now, we expect a query with a single atom, with the exact form `target:"<target>"` | ||
| if !queryRe.MatchString(simpleQuery) { |
There was a problem hiding this comment.
MatchString matches a substring--"target:" could appear anywhere. Should anchor if that is the intent.
There was a problem hiding this comment.
Thanks for the reminder! Updated, and added a test case to catch it.
Our ResultStore implementation at the moment is limited to Prow results from ResultStore (e.g. has "label:prow"). This is fine for our current assumptions, but if results for multiple Prow jobs are uploaded to the same project (a common use case), then all the results get processed in TestGrid on the same tab, which we want to avoid for users and development. Instead, allow a very simple query (only `target:"<job name>"`), so it's possible to specify a particular job for a tab instead of the results for everything uploaded from Prow.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: airbornepony, michelle192837 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Our ResultStore implementation at the moment is limited to Prow results from ResultStore (e.g. has "label:prow"). This is fine for our current assumptions, but if results for multiple Prow jobs are uploaded to the same project (a common use case), then all the results get processed in TestGrid on the same tab, which we want to avoid for users and development.
Instead, allow a very simple query (only
target:"<job name>"), so it's possible to specify a particular job for a tab instead of the results for everything uploaded from Prow.