Make collapsible sections infinitely nested

Merged Jose Ivan Vargas requested to merge jivanvl-fix-collapsible-sections into master

What does this MR do?

This makes the collapsible sections of the job log feature infinitely nested, addressing some of the current bugs and improving the overall performance of the collapsible section algorithm.

The changes are behind the following feature flag: infinitely_collapsible_sections

Rollout issue for the feature flag: #335297 (closed)

Issue for the feature: #29766

Screenshots or Screencasts (strongly suggested)

Multiple inner collapsible sections

Screen_Recording_2021-07-06_at_10.17.34

An example CI config file to try the above is:

Click to expand
stages:
  - qa

image: alpine

collapsible_job_single:
  stage: qa
  script:
    - echo -e "\e[0Ksection_start:`date +%s`:my_first_section\r\e[0KHeader of the 1st collapsible section"
    - echo 'this line should be hidden when collapsed'
    - echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"

collapsible_job_multiple:
  stage: qa
  script:
    - echo -e "\e[0Ksection_start:`date +%s`:my_first_section\r\e[0KHeader of the 1st collapsible section"
    - echo 'this line should be hidden when collapsed'
    - echo -e "\e[0Ksection_start:`date +%s`:second_section\r\e[0KHeader of the 2nd collapsible section"
    - echo 'this line should be hidden when collapsed'
    - echo -e "\e[0Ksection_end:`date +%s`:second_section\r\e[0K"
    - echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Jose Ivan Vargas