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

[Backport 5.2] Surfaces errors in autoindex configuration#59756

Merged
unknwon merged 1 commit into5.2from
backport-58879-to-5.2
Jan 23, 2024
Merged

[Backport 5.2] Surfaces errors in autoindex configuration#59756
unknwon merged 1 commit into5.2from
backport-58879-to-5.2

Conversation

@sourcegraph-release-bot
Copy link
Collaborator

Fixes #58453

Test plan

Add the vitejs/vite repo to your local sg instance, and view the autoindex configuration page.

After this PR you should see the real error:
Error fetching index configuration: Inference limit: requested content for more than 100 (100) files

instead of a nil pointer exception.

Implementation notes

I added two commits, but the first is completely overridden by the second. In 67ed1c3 I tried to 'interpret' what the code was trying to do in the first place, and return a 'succesful' result even if the evaluation ran into a limit error. That produces very confusing UX though, because now it looks like everything is fine on the configuration page, but there are no build jobs. I think it's better to surface the error in the UI here.

This change leaves things in a bit of an awkward spot. The assignment to limitErr is dead code. I don't think the special handling for limit errors make sense here, and it doesn't work anyway (because somewhere on the code path it's not treated different from other errors). I tried ripping it out, but my go-foo isn't quite there yet. I could either open an issue for the follow-up cleanup, or we could try to pair on it @varungandhi-src WDYT?

Backport f92302f from #58879

Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
(cherry picked from commit f92302f)
@sourcegraph-bot
Copy link
Contributor

📖 Storybook live preview

@unknwon unknwon merged commit aa4efd3 into 5.2 Jan 23, 2024
@unknwon unknwon deleted the backport-58879-to-5.2 branch January 23, 2024 12:51
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.

4 participants