Sign and verify ansi2json state
What does this MR do and why?
This state serves as a sort of a pagination cursor for the jobs controller trace rendering.
The state is passed in a base64 encoded query parameter, and gets embedded in the JSON output in a way that makes it look like the values originate from the GitLab backend itself.
To prevent confusion, we are appending a signature to the state and only restoring states with a valid signature.
See #392794 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Make sure you have a runner configured in your GDK
- Create a long running job in a project:
# .gitlab-ci.yml many-echoes: script: for i in $(seq 1000); do echo $i; sleep 1; done - Observe that the job trace keeps updating over time
-
Optional: Repeat the experiment by checking out
masterfirst and then switching to this branch while on the page of a running job. Observe that the trace keeps updating. This is because we fall back to the empty state and send an a full trace back to the frontend that falls under theappend == falsecase.
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.
Edited by Hordur Freyr Yngvason