Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

insights: allow repo iterators to be created over zero repos#50561

Merged
coury-clark merged 1 commit into
mainfrom
cw/allow-empty-insights
Apr 17, 2023
Merged

insights: allow repo iterators to be created over zero repos#50561
coury-clark merged 1 commit into
mainfrom
cw/allow-empty-insights

Conversation

@chwarwick

Copy link
Copy Markdown
Contributor

Currently insights that have resolve to matching no repos will fail the backfill because a repo iterator isn't allowed to be created for 0 repos. I don't see a reason why we need to disallow empty iterators. This removes that restriction.

Test plan

Unit test added
Created an insight over 0 repos using repo search repo:notarepo - verified insight completed backfilling with zero data.

@cla-bot cla-bot Bot added the cla-signed label Apr 12, 2023
@chwarwick chwarwick requested a review from coury-clark April 12, 2023 16:06
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff ed6aa96...bc7c6a7.

Notify File(s)
@sourcegraph/code-insights-backend enterprise/internal/insights/scheduler/iterator/repo_iterator.go
enterprise/internal/insights/scheduler/iterator/repo_iterator_test.go

@coury-clark coury-clark merged commit c928f0a into main Apr 17, 2023
@coury-clark coury-clark deleted the cw/allow-empty-insights branch April 17, 2023 20:06
github-actions Bot pushed a commit that referenced this pull request Apr 17, 2023
Currently insights that have resolve to matching no repos will fail the
backfill because a repo iterator isn't allowed to be created for 0
repos. I don't see a reason why we need to disallow empty iterators.
This removes that restriction.
## Test plan
Unit test added
Created an insight over 0 repos using repo search `repo:notarepo` -
verified insight completed backfilling with zero data.
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

(cherry picked from commit c928f0a)
coury-clark pushed a commit that referenced this pull request Apr 17, 2023
… repos (#50745)

Currently insights that have resolve to matching no repos will fail the
backfill because a repo iterator isn&#39;t allowed to be created for 0
repos. I don&#39;t see a reason why we need to disallow empty iterators.
This removes that restriction.
## Test plan
Unit test added
Created an insight over 0 repos using repo search `repo:notarepo` -
verified insight completed backfilling with zero data.
&lt;!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
--&gt;
 <br> Backport c928f0a from #50561

Co-authored-by: Chris Warwick <christopher.warwick@sourcegraph.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants