mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 13:51:46 +00:00
fix(search_jobs): progress reporting (#64287)
Relates to #64186 With this PR we only show `83 out of 120 tasks` if the search job is currently processing. In all other states, we don't show this stat. This is a consequence of the janitor job I recently added, because after aggregation, this data is not available anymore. User's can still inspect the logs and download results to get a detailed view of which revisions were searched. I also remove an unnecessary dependency of the download links on the job state. ## Test plan: I ran a search job locally and confirmed that the progress message is only visible while the job is processing and that logs and downloads are always available. ## Changelog - Show detailed progress only while job is in status "processing" - Remove dependency of download links on job state
This commit is contained in:
parent
38633daef0
commit
155975259a
@ -351,7 +351,7 @@ const SearchJob: FC<SearchJobProps> = props => {
|
||||
</span>
|
||||
|
||||
<span className={styles.jobQuery}>
|
||||
{job.state !== SearchJobState.COMPLETED && (
|
||||
{job.state === SearchJobState.PROCESSING && (
|
||||
<Text className="m-0 text-muted">
|
||||
{repoStats.completed} out of {repoStats.total} tasks
|
||||
</Text>
|
||||
|
||||
@ -76,25 +76,19 @@ func (r *searchJobResolver) FinishedAt(ctx context.Context) *gqlutil.DateTime {
|
||||
}
|
||||
|
||||
func (r *searchJobResolver) URL(ctx context.Context) (*string, error) {
|
||||
if r.Job.State == types.JobStateCompleted {
|
||||
exportPath, err := url.JoinPath(conf.Get().ExternalURL, fmt.Sprintf("/.api/search/export/%d.jsonl", r.Job.ID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return pointers.Ptr(exportPath), nil
|
||||
exportPath, err := url.JoinPath(conf.Get().ExternalURL, fmt.Sprintf("/.api/search/export/%d.jsonl", r.Job.ID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, nil
|
||||
return pointers.Ptr(exportPath), nil
|
||||
}
|
||||
|
||||
func (r *searchJobResolver) LogURL(ctx context.Context) (*string, error) {
|
||||
if r.Job.State == types.JobStateCompleted {
|
||||
exportPath, err := url.JoinPath(conf.Get().ExternalURL, fmt.Sprintf("/.api/search/export/%d.log", r.Job.ID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return pointers.Ptr(exportPath), nil
|
||||
exportPath, err := url.JoinPath(conf.Get().ExternalURL, fmt.Sprintf("/.api/search/export/%d.log", r.Job.ID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, nil
|
||||
return pointers.Ptr(exportPath), nil
|
||||
}
|
||||
|
||||
func (r *searchJobResolver) RepoStats(ctx context.Context) (graphqlbackend.SearchJobStatsResolver, error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user