Fix job log search for multiple segments
What does this MR do and why?
Job log search was initially built to support single segments. There is now use-cases for multiple content segments. This MR ensures users are able to find any segment with a search string.
Single segment use-case:
<div class="js-log-line job-log-line"><a id="L1821" href="/gitlab-com/gl-infra/us-public-sector/switchboard_pubsec/-/jobs/10777036965#L1821" class="job-log-line-number">1821</a><span class="job-log-line-content"><span class="term-fg-l-black">2025-07-22 21:41:21</span><span class=""> </span><span class="term-fg-green">INF</span><span class=""> </span><span class="term-bold">Ignoring old update for Nodegroup</span><span class=""> </span><span class="term-fg-cyan">created=</span><span class="">2025-05-27T22:18:02Z </span><span class="term-fg-cyan">nodegroup=</span><span class="">gitlab_observability_pool_20250129191004115200000054 </span><span class="term-fg-cyan">status=</span><span class="">Successful </span><span class="term-fg-cyan">updateId=</span><span class="">81d231de-d4b3-37d6-bfe8-f0b030797548</span></span></div>
Multiple segments use-case:
<div class="js-log-line job-log-line job-log-line-highlight"><a id="L12" href="/root/ci-project/-/jobs/409#L12" class="job-log-line-number">12</a><span class="job-log-line-content"><span class="">Using effective pull policy of [if-not-present] for container sha256:ade4ddc799487c073b672b15dd514096254840e08c378c9e4bd6b268cbc8e72c</span></span></div>
References
Screenshots or screen recordings
How to set up and validate locally
- Setup a job that produces multiple segment output
test_job_colorized:
stage: test
script:
- echo -e "\033[32mINF\033[0m \033[1mIgnoring old update for Nodegroup\033[0m \033[36mcreated=\033[0m2025-05-27T22:18:02Z"
- echo -e "\033[31mERROR\033[0m Something failed here"
- echo -e "\033[33mWARN\033[0m This is a warning message"
- echo -e "\033[1;31mFATAL\033[0m Critical error occurred"
- Ensure you can search past the first segment. I.E
Something failed herestring
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.
Related to #557440 (closed)
Edited by Payton Burdette
