Keep the Orbit overview globe while new projects index

What does this MR do and why?

Orbit reports a group as INDEXING while one of its projects has no code index. Busy groups get new projects every day, so the Overview hid the globe long after the first index.

  • The Overview blocks only while an area other than source_code is not READY (the first index).
  • After that, an "Indexing N projects" button shows the projects that wait for code indexing, per group.

Follow-up: a job ledger in Orbit, so the server can report the end of the first index.

References

Screenshots or screen recordings

Local GDK in SaaS mode with a local Orbit (main). The group has 3 projects, and 1 project waits for code indexing for about 3 minutes. The videos play at 4x speed.

Before After
The indexing alert and the overlay hide the globe and the counts for 3 minutes. The globe and the counts stay. "Indexing 1 project" opens a popover with the group, and goes away when the project is indexed.

How to set up and validate locally

  1. Start Orbit on your GDK. Turn on Orbit for a group with projects, and wait until the Group status tab shows the group as indexed.

  2. Create a project in the group.

  3. Open /dashboard/orbit/overview while the new project waits for code indexing:

    • On master, the indexing alert and the overlay show.
    • On this branch, the globe and the counts show, with an "Indexing 1 project" button. Select it to see the group.
  4. Wait until the project is indexed. The button goes away.

  5. Run the specs:

    yarn jest ee/spec/frontend/orbit/utils/orbit_group_state_spec.js ee/spec/frontend/orbit/dashboard
Open the wait window on purpose

A local Orbit can index the code of a new project before its Project node arrives, so step 3 can miss the window. To open it, remove the code checkpoint of an indexed project in the local graph. Orbit then counts the project as waiting, and indexes it again on the next minute:

INSERT INTO `gkg-development`.v103_code_indexing_checkpoint
  (traversal_path, project_id, branch, last_task_id, last_commit, indexed_at, is_default_branch, _deleted)
SELECT traversal_path, project_id, branch, argMax(last_task_id, _version), argMax(last_commit, _version),
       argMax(indexed_at, _version), true, true
FROM `gkg-development`.v103_code_indexing_checkpoint
WHERE project_id = <project id>
GROUP BY traversal_path, project_id, branch

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jean-Gabriel Doyon

Merge request reports

Loading
Loading