Skip to content

search: make new commit search job check dynamic limits at runtime

Administrator requested to merge rvt/commit-job-sep into main

Created by: rvantonder

Prep for the next PR: https://github.com/sourcegraph/sourcegraph/pull/26750. see that PR first to understand what's going on, then review this one.

OK welcome back :-) So to pull off that future PR, we moved the dynamic value repos to be available at Run, but not before. Because the validation CheckSearchLimits depends on the dynamic value repos, it needs to move into Run. All runtime-dependent checks, specific to a kind of job, should happen there. But, of course, that check also looks at some values in the original Query. We definitely don't want Query to be part of the commit search type, so we "map" the relevant parts for the validation (which comes down just to the property HasTimeFilter).

Basically, my the next PR makes dependency repos imply CheckSearchLimits must now become a runtime check. Because it is a runtime check, we need to extract the static concerns (time filter values in original query) and map it to an appropriate value for commit search. Of course, if things grow and we actually care about the value of those fields, then they should be mapped into the commit type too--I just went for the smallest thing.

Merge request reports

Loading