autoindex: trigger autoindex job from UI
Created by: Strum355
Review recommended with: :ballot_box_with_check:Hide whitespace changes
Backend changes:
- Extracted the index queueing logic to a separate package to be reused in the graphql resolver and the frontend codeintel background indexing package
- Added a
ForceQueueIndex
to skip the logic that checks if an index is already queued or if an upload exists for the HEAD commit - GraphQL mutation on the resolver to queue an index
- Extracted autoindexer metrics to separate package, changing to singleton with sync.Once
Frontend changes:
-
DynamicallyImportedMonacoSettingsEditor
(jsdoc to be added)- This can now take a custom
SaveToolbar
, if one needs additional functionality in the baseSaveToolbar
- As there is no inheritance in function components, only composition, and the custom
SaveToolbar
may have additional props ontop of theSaveToolbar
props, a function that merges theSaveToolbar
props with their custom additional props must be passed along with the custom toolbarReact.FunctionComponent
. This is defined/typified asSaveToolbarPropsGenerator
- This fallsback to the original behaviour if nothing is set for the custom toolbar, and the generic T (which is the type of the custom toolbar props) defaults to {}
- This can now take a custom
-
SaveToolbar
-
Props
becameReact.PropsWithChildren<Props>
to allow custom toolbars to pass in additional react nodes to be included. Example can be seen inCodeIntelAutoIndexSaveToolbar
, where we add an additional button and additional LoadingSpinner for the new state(s) that we can have - As custom toolbars may want to override when Save and Discard buttons are disabled and/or when errors are displayed, this is customizable by setting the
saveDiscardDisabled
andwillShowError
property functions.- By default, the former was when
saving || !dirty
and the latter was!saving
. Overriding the impl must also do this if they wish to append to existing functionality rather than change it.
- By default, the former was when
-
-
CodeIntelAutoIndexSaveToolbar
-
React.FunctionComponent
that "implements" a toolbar by composition of aSaveToolbar
. - Overrides the save/discard button disabling and error displaying based on whether the "Queue Job" button was clicked
-
-
CodeIntelIndexConfigurationPage
- State is no longer binary saving|!saving, was expanded to Idle|Saving|Queueing
- The
CodeIntelAutoIndexSaveToolbar
"Save", "Discard" and "Queue Job" buttons are disabled when either "Save" or "Queue Job" is clicked
Failing tests to be addressed and additional in-code docs to be added