Pre-Collapsed sections in job logs
Problem to solve
Currently there is the possibility to make sections in the jobs logs collapsible.
section_start:<current_timestamp>:<section_name>\r\033[0K [..] section_end:<current_timestamp>:<section_name>\r\033[0K
All these sections are then still opened but could be collapsed to make the log better parseable by humans. However sometimes there are very long sections, which just stuff like:
- Downloading caches/dependencies
- Long Error/Warning Messages
... which might be great that this is collapsed by default and will be only expanded if the user wants to look into that.
Everybody who looks often at jobs logs according to his work.
- Rachel (Release Manager)
- Delaney (Development Team Lead)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Sam (Security Analyst)
- Dana (Data Analyst)
There are 3 different variants proposed:
section_start:<current_timestamp>:<section_name>[collapsed=true]\r\033[0K [..] section_end:<current_timestamp>:<section_name>[collapsed=true]\r\033[0K
- This gives the possibility to add other optional parameters in the future, if required.
- Have to be limited functionally to ensure to not collide with following tokens.
- Caused by Con 1. maybe harder to implement and quite complex to test.
2. An optional suffix
section_start:<current_timestamp>:<section_name>[:collapsed]\r\033[0K [..] section_end:<current_timestamp>:<section_name>[:collapsed]\r\033[0K
- Risk of colliding with other following tokens are low
- Effort for implementing and testing might be manageable.
- Not very future proof if other features of the sections might be desired.
3. An optional section name marker suffix
section_start:<current_timestamp>:<section_name>[_collapsed]\r\033[0K [..] section_end:<current_timestamp>:<section_name>[_collapsed]\r\033[0K
See Pro of 2. An optional suffix
See Con of 2. An optional suffix, plus:
- Looks like a lazy solution.
Behavior in the UI
- While the current section is still active: Do not collapse
- Is the section finished and is marked as
collapsed: Collapse it.
- If someone uses a line jump link (like
https://gitlab.com/foo/bar/-/jobs/123#L456) and this line is inside a collapsed section: Do not collapse also if point 2. happens.
Permissions and Security
No more additional permissions required nor checks.
Right now there seems to be no documentation for sections in GitLab at all. Maybe it worth it to put a small documentation for that in parallel to https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html.
By now, the documentation for sections was written here: https://docs.gitlab.com/ee/ci/pipelines/#expand-and-collapse-job-log-sections
Availability & Testing
What does success look like, and how can we measure that?
People starting to use this feature (like us) and maybe it will be already used for all standard stuff of the logs like:
Using Docker executor with image...
Fetching changes with git depth set to...
But a statistically logging is hard.
What is the type of buyer?
Tier: Core/Free, Starter/Bronze, Premium/Silver, Ultimate/Gold
Links / references
- gitlab-foss#14664 (closed): Collapsable job log