Skip to content

fix(web/loader): use job not found for missing external job ID batch slots#21712

Open
cuiweixie wants to merge 1 commit intosmartcontractkit:developfrom
cuiweixie:fix/web-loader-external-job-id-not-found-msg
Open

fix(web/loader): use job not found for missing external job ID batch slots#21712
cuiweixie wants to merge 1 commit intosmartcontractkit:developfrom
cuiweixie:fix/web-loader-external-job-id-not-found-msg

Conversation

@cuiweixie
Copy link

Summary

When batch-loading jobs by external job ID, unfilled slots now return the same "job not found" error as the pipeline-spec ID path, instead of the incorrect "feeds manager not found". Updated the stale comment to match.

Testing

  • go test ./core/web/loader/... (local env had toolchain/GOSUMDB issue)

…slots

Replace the misleading "feeds manager not found" message with "job not
found", matching loadByPipelineSpecIDs and the job dataloader context.
Copilot AI review requested due to automatic review settings March 26, 2026 02:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Risk Rating: LOW

Aligns GraphQL dataloader behavior for missing jobs when batch-loading by external job ID with the existing pipeline-spec ID path by returning "job not found" instead of an unrelated "feeds manager not found" error.

Changes:

  • Update the default “missing slot” error in loadByExternalJobIDs to "job not found".
  • Update the related in-code comment to refer to missing jobs (not feeds managers).

Comment on lines +58 to 61
// fill array positions without any jobs
for _, ix := range keyOrder {
results[ix] = &dataloader.Result{Data: nil, Error: errors.New("feeds manager not found")}
results[ix] = &dataloader.Result{Data: nil, Error: errors.New("job not found")}
}
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters the observable error for missing external job IDs, but there is no unit test covering the "missing slot" behavior for JobsByExternalJobIDs (loader_test.go only covers the success case). Add a test that requests multiple external IDs with at least one not returned by the ORM and assert the missing position returns "job not found" (matching the pipeline-spec path).

Copilot generated this review using guidance from repository custom instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants