Scroll to job line from URL hash
What does this MR do and why?
URLs like https://gitlab.com/gitlab-org/gitlab/-/jobs/4080590653#L47
with a hash previously always scrolled to the bottom of the job log. The hash was not taken into account. This MR grabs the hash and scrolls to the line number if a hash exists. If a hash exists and their are collapsed sections, we expand the sections before hand to ensure line numbers are rendered in the DOM.
Screenshots or screen recordings
How to set up and validate locally
- Have a job with a large log output
- Visit the job with a line number hash (should scroll to hash)
- Visit the job without a line number hash (should scroll to end of log)
- Visit a line within a collapsed section (should open section and scroll to line)
Example of custom collapsed section with large output. Note sometimes collapsed sections like this don't play nice with local shell runner, I had to setup a docker runner for this to render correctly.
large_log_output:
stage: build
script:
- echo -e "\e[0Ksection_start:`date +%s`:my_first_section[collapsed=true]\r\e[0KHeader of the 1st collapsible section"
- cat README.md
- echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"
- echo "hello world!"
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #211793 (closed)