From 0ad218275cda3699c75859ae0bcf8dee82128c61 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 18 Jun 2025 21:12:36 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/frontend.gitlab-ci.yml | 2 - .gitlab/ci/rules.gitlab-ci.yml | 4 + .../pipeline_inputs/pipeline_inputs_form.vue | 22 +- .../pipeline_inputs_preview_drawer.vue | 67 +++++ .../ci/common/pipeline_inputs/utils.js | 123 ++++++++ .../ci/common/private/job_action_button.vue | 2 +- .../components/invite_members_modal.vue | 10 +- .../invite_members/utils/member_utils.js | 4 + app/assets/javascripts/issues/list/index.js | 2 + .../repository/components/table/row.vue | 3 + .../javascripts/snippets/components/edit.vue | 2 +- .../deployment/deployment_view_button.vue | 1 + .../components/widget/action_buttons.vue | 2 +- .../components/create_work_item.vue | 13 +- .../work_item_projects_listbox.vue | 9 +- app/assets/javascripts/work_items/index.js | 2 + app/helpers/issues_helper.rb | 1 + app/helpers/work_items_helper.rb | 2 + app/models/ci/slsa/provenance_statement.rb | 116 +++++++ app/models/ci/slsa/resource_descriptor.rb | 11 + .../slsa/in_toto_v1/provenance_v1.json | 170 +++++++++++ app/views/layouts/minimal.html.haml | 2 +- config/routes/admin.rb | 6 +- doc/ci/_index.md | 1 - doc/integration/exact_code_search/zoekt.md | 26 ++ doc/topics/git/get_started.md | 1 - .../get-started-security.md | 1 - .../get_started/get_started_deploy_release.md | 1 - .../get_started/get_started_managing_code.md | 1 - .../get_started_managing_infrastructure.md | 2 +- .../get_started/get_started_monitoring.md | 1 - .../get_started/get_started_planning_work.md | 1 - doc/user/get_started/get_started_projects.md | 1 - doc/user/group/epics/epic_work_items.md | 4 +- .../merge_requests/duo_in_merge_requests.md | 69 +++++ locale/gitlab.pot | 35 +++ package.json | 2 +- .../release_with_glab_spec.rb | 6 +- scripts/frontend/quarantined_vue3_specs.txt | 6 - spec/factories/ci/builds.rb | 4 +- spec/factories/ci/job_artifacts.rb | 6 + .../factories/ci/slsa/provenance_statement.rb | 80 +++++ .../__snapshots__/alerts_form_spec.js.snap | 1 + .../pipeline_inputs_form_spec.js | 48 ++- .../pipeline_inputs_preview_drawer_spec.js | 252 ++++++++++++++++ .../ci/common/pipeline_inputs/utils_spec.js | 282 +++++++++++++++++- .../common/private/job_action_button_spec.js | 2 +- .../__snapshots__/popover_spec.js.snap | 2 + .../__snapshots__/toolbar_button_spec.js.snap | 9 +- .../__snapshots__/list_spec.js.snap | 2 - .../toolbar/__snapshots__/index_spec.js.snap | 4 + .../upload/__snapshots__/button_spec.js.snap | 4 + .../__snapshots__/pagerduty_form_spec.js.snap | 2 + .../components/invite_members_modal_spec.js | 8 + .../invite_members/utils/member_utils_spec.js | 13 +- .../collapsible_section_spec.js.snap | 4 + .../__snapshots__/file_sha_spec.js.snap | 2 + .../package_list_row_spec.js.snap | 2 + .../__snapshots__/file_sha_spec.js.snap | 2 + .../project_delete_button_spec.js.snap | 2 + .../__snapshots__/last_commit_spec.js.snap | 4 + .../table/__snapshots__/row_spec.js.snap | 6 + .../clear_icon_button_spec.js.snap | 2 + .../__snapshots__/todo_spec.js.snap | 1 + .../deployment/deployment_view_button_spec.js | 3 +- .../widgets/test_report/index_spec.js | 1 + .../components/create_work_item_spec.js | 1 + .../__snapshots__/upload_button_spec.js.snap | 2 + .../work_item_projects_listbox_spec.js | 30 +- spec/helpers/issues_helper_spec.rb | 1 + spec/helpers/work_items_helper_spec.rb | 2 + .../ci/slsa/provenance_statement_spec.rb | 162 ++++++++++ spec/routing/admin_routing_spec.rb | 2 + yarn.lock | 8 +- 74 files changed, 1637 insertions(+), 53 deletions(-) create mode 100644 app/assets/javascripts/ci/common/pipeline_inputs/pipeline_inputs_preview_drawer.vue create mode 100644 app/models/ci/slsa/provenance_statement.rb create mode 100644 app/models/ci/slsa/resource_descriptor.rb create mode 100644 app/validators/json_schemas/slsa/in_toto_v1/provenance_v1.json create mode 100644 spec/factories/ci/slsa/provenance_statement.rb create mode 100644 spec/frontend/ci/common/pipeline_inputs/pipeline_inputs_preview_drawer_spec.js create mode 100644 spec/models/ci/slsa/provenance_statement_spec.rb diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index c5449af9460..56d3942e5c6 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -105,8 +105,6 @@ gdk:compile-test-assets: extends: - compile-test-assets - .build-images:rules:build-gdk-image - variables: - BABEL_ENV: "istanbul" update-assets-compile-production-cache: extends: diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index fb27f528f99..18c44ca2fa1 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1144,6 +1144,10 @@ - !reference [".qa:rules:e2e-test-never-run", rules] - <<: *if-default-branch-schedule-nightly # already executed in the 2-hourly schedule when: never + - <<: *if-dot-com-gitlab-org-schedule + variables: + BABEL_ENV: "istanbul" + CACHE_ASSETS_AS_PACKAGE: "false" - <<: *if-default-branch-refs - <<: *if-merge-request-labels-run-all-e2e - <<: *if-merge-request-labels-run-cs-evaluation diff --git a/app/assets/javascripts/ci/common/pipeline_inputs/pipeline_inputs_form.vue b/app/assets/javascripts/ci/common/pipeline_inputs/pipeline_inputs_form.vue index db65e7ed8f6..b31640063a9 100644 --- a/app/assets/javascripts/ci/common/pipeline_inputs/pipeline_inputs_form.vue +++ b/app/assets/javascripts/ci/common/pipeline_inputs/pipeline_inputs_form.vue @@ -1,5 +1,5 @@ + + diff --git a/app/assets/javascripts/ci/common/pipeline_inputs/utils.js b/app/assets/javascripts/ci/common/pipeline_inputs/utils.js index cf26dc8d7ac..0765d82e5fd 100644 --- a/app/assets/javascripts/ci/common/pipeline_inputs/utils.js +++ b/app/assets/javascripts/ci/common/pipeline_inputs/utils.js @@ -1,3 +1,5 @@ +import { isEqual } from 'lodash'; + /** * Generates skeleton rect props for the skeleton loader based on column and row indices * @@ -15,3 +17,124 @@ export const getSkeletonRectProps = (columnIndex, rowIndex) => { ry: 2, }; }; + +/** + * Formats a value for display in the input preview + * @param {*} value - The value to format + * @returns {string} - Formatted string representation + */ +export function formatValue(value) { + if (value === null) return 'null'; + if (value === undefined) return 'undefined'; + if (typeof value === 'string') return `"${value}"`; + if (typeof value === 'object') return JSON.stringify(value); + return String(value); +} + +/** + * Checks if an input value has changed from its default + * @param {*} value - Current value + * @param {*} defaultValue - Default value + * @returns {boolean} - True if values are different + */ +export function hasValueChanged(value, defaultValue) { + if (typeof value === 'object' || typeof defaultValue === 'object') { + return !isEqual(value, defaultValue); + } + return value !== defaultValue; +} + +/** + * Formats value lines for diff display + * @param {Object} input - Input object with value, default, etc. + * @param {boolean} isChanged - Whether the value has changed + * @returns {Array} - Array of line objects + */ +export function formatValueLines(input, isChanged) { + const lines = []; + const formattedValue = formatValue(input.value); + const formattedDefault = formatValue(input.default); + + if (isChanged) { + lines.push({ + // eslint-disable-next-line @gitlab/require-i18n-strings + content: `- value: ${formattedDefault}`, + type: 'old', + }); + lines.push({ + // eslint-disable-next-line @gitlab/require-i18n-strings + content: `+ value: ${formattedValue}`, + type: 'new', + }); + } else { + lines.push({ + // eslint-disable-next-line @gitlab/require-i18n-strings + content: ` value: ${formattedValue}`, + type: '', + }); + } + + return lines; +} + +/** + * Formats metadata lines (type, description) + * @param {Object} input - Input object + * @returns {Array} - Array of line objects + */ +export function formatMetadataLines(input) { + const lines = []; + + if (input.type) { + lines.push({ + // eslint-disable-next-line @gitlab/require-i18n-strings + content: ` type: "${input.type}"`, + type: '', + }); + } + + if (input.description) { + lines.push({ + // eslint-disable-next-line @gitlab/require-i18n-strings + content: ` description: "${input.description}"`, + type: '', + }); + } + + return lines; +} + +/** + * Formats a single input into display lines + * @param {Object} input - Input object + * @returns {Array} - Array of line objects + */ +export function formatInputLines(input) { + const lines = []; + const isChanged = hasValueChanged(input.value, input.default); + + lines.push({ + content: `${input.name}:`, + type: '', + }); + + lines.push(...formatValueLines(input, isChanged)); + + lines.push(...formatMetadataLines(input)); + + lines.push({ + content: '', + type: '', + }); + + return lines; +} + +/** + * Formats all inputs into display lines + * @param {Array} inputs - Array of input objects + * @returns {Array} - Array of line objects for display + */ +export function formatInputsForDisplay(inputs) { + return inputs.flatMap(formatInputLines); +} diff --git a/app/assets/javascripts/ci/common/private/job_action_button.vue b/app/assets/javascripts/ci/common/private/job_action_button.vue index d7d3c4be691..76e25d2b9b5 100644 --- a/app/assets/javascripts/ci/common/private/job_action_button.vue +++ b/app/assets/javascripts/ci/common/private/job_action_button.vue @@ -132,7 +132,7 @@ export default { data-testid="ci-action-button" @click.prevent="onActionButtonClick" > - + @ {{ shortSha }} + diff --git a/app/assets/javascripts/snippets/components/edit.vue b/app/assets/javascripts/snippets/components/edit.vue index acc877f9ea9..d02ac7c1bcf 100644 --- a/app/assets/javascripts/snippets/components/edit.vue +++ b/app/assets/javascripts/snippets/components/edit.vue @@ -266,7 +266,7 @@ export default { > diff --git a/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue b/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue index b7eee8e68eb..62187396f3a 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue @@ -64,6 +64,7 @@ export default { size="small" placement="bottom-end" searchable + data-testid="deploy-url-menu" @search="search" >