Skip to content

fix: return early in DiscoverRunner on first match#2871

Merged
jiparis merged 1 commit intochainloop-dev:mainfrom
waveywaves:fix/runner-discovery-early-return
Mar 19, 2026
Merged

fix: return early in DiscoverRunner on first match#2871
jiparis merged 1 commit intochainloop-dev:mainfrom
waveywaves:fix/runner-discovery-early-return

Conversation

@waveywaves
Copy link
Contributor

@waveywaves waveywaves commented Mar 17, 2026

Summary

  • Stop iterating through all runner factories in DiscoverRunner after the first match — return it immediately instead of collecting all matches into a slice
  • Avoids unnecessary CheckEnv() calls from remaining runners, which becomes more impactful as more runner implementations are added

Fixes #2834

Stop iterating through all runner factories after the first matching
runner is found. This avoids unnecessary CheckEnv() calls from remaining
runners as more runner implementations are added.

Fixes chainloop-dev#2834

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
@waveywaves waveywaves force-pushed the fix/runner-discovery-early-return branch from 76988bb to b486f4e Compare March 17, 2026 11:18
@waveywaves waveywaves changed the title fix: return early in DiscoverRunner to avoid unnecessary env checks fix: return early in DiscoverRunner on first match Mar 17, 2026
@waveywaves waveywaves marked this pull request as ready for review March 18, 2026 09:36
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@waveywaves
Copy link
Contributor Author

cc @jiparis

@migmartri
Copy link
Member

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Copy link
Collaborator

@Piskoo Piskoo left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

Copy link
Member

@jiparis jiparis left a comment

Choose a reason for hiding this comment

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

Awesomw, thanks @waveywaves !

@jiparis jiparis merged commit 618daed into chainloop-dev:main Mar 19, 2026
15 checks passed
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.

Do not try all runners in runner discovery

4 participants