Loading
Make CI job trace update intervals configurable
What does this MR do and why?
Makes CI job trace update intervals configurable at the instance level.
GitLab already tells GitLab Runner when to upload trace updates with the
X-GitLab-Trace-Update-Interval header. The default values remain 60 seconds
when a job log is not being watched and 3 seconds when it is being watched.
This MR exposes those values through Application Settings, the Admin area, and
the Settings API.
This lets self-managed administrators reduce the initial live log delay for short jobs without patching constants locally.
References
Closes #565373 (closed)
Screenshots or screen recordings
Not included. This adds two numeric fields to an existing Admin area settings form, and local GDK was not running.
How to set up and validate locally
- Go to Admin area > Settings > CI/CD > Job logs.
- Set Job log update interval to
10. - Set Watched job log update interval to
3. - Start a CI job with a runner.
- Confirm
PATCH /api/v4/jobs/:id/traceresponses includeX-GitLab-Trace-Update-Interval: 10before the job log is opened. - Open the job log.
- Confirm subsequent trace
PATCHresponses includeX-GitLab-Trace-Update-Interval: 3.
MR acceptance checklist
- The existing default intervals stay unchanged.
- The settings are documented for the Admin area and Settings API.
- Tests cover defaults, validation, and runner trace response headers.
Local verification
git diff --checkmise exec -- ruby -e 'require "haml"; Haml::Engine.new(File.read("app/views/admin/application_settings/_job_logs_form.html.haml")); puts "haml parse ok"'mise exec -- ruby -e 'require "yaml"; YAML.load_file("doc/api/openapi/openapi_v3.yaml"); puts "openapi yaml ok"'mise exec -- ruby -e 'require "json"; JSON.parse(File.read("app/validators/json_schemas/application_setting_ci_cd_settings.json")); puts "json schema ok"'mise exec -- ruby tooling/bin/gettext_extractor locale/gitlab.potmise exec -- bundle exec rspec spec/lib/gitlab/ci/trace_spec.rb spec/requests/api/ci/runner/jobs_trace_spec.rb spec/models/application_setting_spec.rb spec/requests/api/settings_spec.rb spec/views/admin/application_settings/ci_cd.html.haml_spec.rb(blocked: local bundle is missing gems)
Related to #565373 (closed)