Commit e9e8c67f authored by Rémy Coutable's avatar Rémy Coutable 🏖

Merge branch '20321-handle-long-variable-values-better' into 'master'

Handle variable values

## What does this MR do?
User can display variables on click. Variables will hide after page is refresh.

## What are the relevant issue numbers?
Closes #20321 

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG]( entry added

- Tests
 - [x] All builds are passing
 - [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
 - [x] [Squashed related commits together](

cc: @kradydal @grzesiek @yorickpeterse [@chastell]( @tmaczukin 

See merge request !5628
parents c61ebeda 651f4c8e
Pipeline #4160627 failed with stages
in 40 minutes and 11 seconds
......@@ -88,6 +88,7 @@ v 8.12.0 (unreleased)
- Fixed invisible scroll controls on build page on iPhone
- Fix error on raw build trace download for old builds stored in database !4822
- Refactor the triggers page and documentation !6217
- Show values of CI trigger variables only when clicked (Katarzyna Kobierska Ula Budziszewska)
v 8.11.5 (unreleased)
- Optimize branch lookups and force a repository reload for Repository#find_branch
......@@ -115,6 +115,16 @@
width: 100%;
.js-build-variable {
color: $code-color;
.js-build-value {
padding: 2px 4px;
color: $black;
background-color: $white-light;
.build-sidebar-header {
padding: 0 $gl-padding $gl-padding;
......@@ -90,12 +90,13 @@
- if @build.trigger_request.variables
%p Variables: Reveal Variables
- @build.trigger_request.variables.each do |key, value|
.js-build-variable= key
.js-build-value= value
......@@ -164,6 +164,26 @@ describe "Builds" do
expect(page).to have_link 'Raw'
describe 'Variables' do
before do
@trigger_request = create :ci_trigger_request_with_variables
@build = create :ci_build, pipeline: @commit, trigger_request: @trigger_request
visit namespace_project_build_path(@project.namespace, @project, @build)
it 'shows variable key and value after click', js: true do
expect(page).to have_css('.reveal-variables')
expect(page).not_to have_css('.js-build-variable')
expect(page).not_to have_css('.js-build-value')
click_button 'Reveal Variables'
expect(page).not_to have_css('.reveal-variables')
expect(page).to have_selector('.js-build-variable', text: 'TRIGGER_KEY_1')
expect(page).to have_selector('.js-build-value', text: 'TRIGGER_VALUE_1')
describe "POST /:project/builds/:id/cancel" do
......@@ -59,14 +59,10 @@ describe 'projects/builds/show' do
it 'shows trigger variables in separate lines' do
expect(rendered).to have_css('code', text: variable_regexp('TRIGGER_KEY_1', 'TRIGGER_VALUE_1'))
expect(rendered).to have_css('code', text: variable_regexp('TRIGGER_KEY_2', 'TRIGGER_VALUE_2'))
expect(rendered).to have_css('.js-build-variable', visible: false, text: 'TRIGGER_KEY_1')
expect(rendered).to have_css('.js-build-variable', visible: false, text: 'TRIGGER_KEY_2')
expect(rendered).to have_css('.js-build-value', visible: false, text: 'TRIGGER_VALUE_1')
expect(rendered).to have_css('.js-build-value', visible: false, text: 'TRIGGER_VALUE_2')
def variable_regexp(key, value)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment