From 035cd5ee5e42fda4a896ed43147ebf455fa2f5ba Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 19 Jul 2022 09:08:45 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/rules.gitlab-ci.yml | 19 +- .gitlab/ci/static-analysis.gitlab-ci.yml | 37 -- .gitlab/sast-ruleset.toml | 10 + .../components/work_item_assignees.vue | 25 +- .../components/work_item_detail.vue | 2 + app/assets/stylesheets/pages/issues.scss | 22 +- app/controllers/search_controller.rb | 28 +- .../mutations/work_items/widgetable.rb | 10 +- app/graphql/mutations/work_items/create.rb | 2 +- app/graphql/mutations/work_items/update.rb | 2 +- .../widgets/hierarchy_update_input_type.rb | 3 +- app/models/ci/pipeline.rb | 6 +- app/models/namespace.rb | 4 + app/models/notification_recipient.rb | 4 + app/models/project.rb | 3 + app/services/search_service.rb | 11 + .../work_items/parent_links/create_service.rb | 7 +- .../widgets/hierarchy_service/base_service.rb | 10 +- config/application.rb | 13 - .../mr_show_reports_immediately.yml | 8 + config/initializers/00_connection_logger.rb | 26 - config/initializers/database_config.rb | 6 + config/routes.rb | 592 +++++++++--------- doc/api/dora/metrics.md | 44 +- doc/ci/yaml/index.md | 6 + doc/development/cicd/templates.md | 33 +- doc/development/rails_initializers.md | 18 +- .../img/mr_approvals_by_code_owners_v12_7.png | Bin 25594 -> 0 bytes .../img/mr_approvals_by_code_owners_v15_2.png | Bin 0 -> 11263 bytes .../project/merge_requests/approvals/rules.md | 4 +- .../milestones/burndown_and_burnup_charts.md | 6 +- .../img/burndown_and_burnup_charts_v15_1.png | Bin 34450 -> 0 bytes .../img/burndown_and_burnup_charts_v15_3.png | Bin 0 -> 47558 bytes .../milestones/img/burndown_chart_v15_1.png | Bin 20287 -> 0 bytes .../milestones/img/burndown_chart_v15_3.png | Bin 0 -> 26157 bytes .../milestones/img/burnup_chart_v15_1.png | Bin 21144 -> 0 bytes .../milestones/img/burnup_chart_v15_3.png | Bin 0 -> 26933 bytes doc/user/project/milestones/index.md | 2 +- lib/api/users.rb | 2 + lib/gitlab/ci/templates/Bash.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/C++.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Chef.gitlab-ci.yml | 13 +- lib/gitlab/ci/templates/Clojure.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Crystal.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Dart.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Elixir.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Flutter.gitlab-ci.yml | 3 + .../templates/Getting-Started.gitlab-ci.yml | 13 +- lib/gitlab/ci/templates/Go.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Grails.gitlab-ci.yml | 13 +- lib/gitlab/ci/templates/Julia.gitlab-ci.yml | 13 +- lib/gitlab/ci/templates/Laravel.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Mono.gitlab-ci.yml | 13 +- lib/gitlab/ci/templates/Nodejs.gitlab-ci.yml | 3 + .../ci/templates/OpenShift.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/PHP.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Ruby.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Rust.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Scala.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/Swift.gitlab-ci.yml | 3 + lib/gitlab/ci/templates/dotNET.gitlab-ci.yml | 3 + .../ci/templates/iOS-Fastlane.gitlab-ci.yml | 13 +- lib/initializer_connections.rb | 29 + locale/gitlab.pot | 31 +- scripts/process_custom_semgrep_results.sh | 2 +- spec/controllers/search_controller_spec.rb | 15 +- .../merge_request/user_sees_versions_spec.rb | 36 +- .../components/work_item_assignees_spec.js | 50 +- .../initializers/00_connection_logger_spec.rb | 39 -- spec/lib/initializer_connections_spec.rb | 63 ++ spec/models/ci/pipeline_spec.rb | 32 +- spec/models/namespace_spec.rb | 8 + spec/models/project_spec.rb | 8 + .../mutations/work_items/create_spec.rb | 14 + .../mutations/work_items/update_spec.rb | 27 + .../parent_links/create_service_spec.rb | 22 +- .../work_items/update_service_spec.rb | 2 +- .../hierarchy_service/update_service_spec.rb | 14 +- 78 files changed, 904 insertions(+), 582 deletions(-) create mode 100644 .gitlab/sast-ruleset.toml create mode 100644 config/feature_flags/development/mr_show_reports_immediately.yml delete mode 100644 config/initializers/00_connection_logger.rb delete mode 100644 doc/user/project/merge_requests/approvals/img/mr_approvals_by_code_owners_v12_7.png create mode 100644 doc/user/project/merge_requests/approvals/img/mr_approvals_by_code_owners_v15_2.png delete mode 100644 doc/user/project/milestones/img/burndown_and_burnup_charts_v15_1.png create mode 100644 doc/user/project/milestones/img/burndown_and_burnup_charts_v15_3.png delete mode 100644 doc/user/project/milestones/img/burndown_chart_v15_1.png create mode 100644 doc/user/project/milestones/img/burndown_chart_v15_3.png delete mode 100644 doc/user/project/milestones/img/burnup_chart_v15_1.png create mode 100644 doc/user/project/milestones/img/burnup_chart_v15_3.png create mode 100644 lib/initializer_connections.rb delete mode 100644 spec/initializers/00_connection_logger_spec.rb create mode 100644 spec/lib/initializer_connections_spec.rb diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 7f0de878744..5d551c2564b 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1465,24 +1465,6 @@ - <<: *if-merge-request changes: *static-analysis-patterns -.semgrep-appsec-custom-rules:rules: - rules: - - <<: *if-not-ee - when: never - - <<: *if-merge-request - changes: *code-backstage-qa-patterns - -.ping-appsec-for-sast-findings:rules: - rules: - # Requiring $CUSTOM_SAST_RULES_BOT_PAT prevents the bot from running on forks or CE - # Without it the script would fail too. - - if: "$CUSTOM_SAST_RULES_BOT_PAT == null" - when: never - - <<: *if-not-ee - when: never - - <<: *if-merge-request - changes: *code-backstage-qa-patterns - ####################### # Vendored gems rules # ####################### @@ -1569,6 +1551,7 @@ - '**/*.tsx' - '**/*.c' - '**/*.go' + - '**/*.rb' .reports:rules:secret_detection: rules: diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml index cb3a9706a18..b4efd9e49bf 100644 --- a/.gitlab/ci/static-analysis.gitlab-ci.yml +++ b/.gitlab/ci/static-analysis.gitlab-ci.yml @@ -7,7 +7,6 @@ variables: SETUP_DB: "false" ENABLE_SPRING: "1" - SKIP_LOG_INITIALIZER_CONNECTIONS: "1" # Disable warnings in browserslist which can break on backports # https://github.com/browserslist/browserslist/blob/a287ec6/node.js#L367-L384 BROWSERSLIST_IGNORE_OLD_DATA: "true" @@ -160,39 +159,3 @@ feature-flags-usage: when: always paths: - tmp/feature_flags/ - -semgrep-appsec-custom-rules: - stage: lint - extends: - - .semgrep-appsec-custom-rules:rules - image: returntocorp/semgrep - needs: [] - script: - # Required to avoid a timeout https://github.com/returntocorp/semgrep/issues/5395 - - git fetch origin master - # Include/exclude list isn't ideal https://github.com/returntocorp/semgrep/issues/5399 - - | - semgrep ci --gitlab-sast --metrics off --config $CUSTOM_RULES_URL \ - --include app --include lib --include workhorse \ - --exclude '*_test.go' --exclude spec --exclude qa > gl-sast-report.json || true - variables: - CUSTOM_RULES_URL: https://gitlab.com/gitlab-com/gl-security/appsec/sast-custom-rules/-/raw/main/appsec-pings/rules.yml - artifacts: - paths: - - gl-sast-report.json - reports: - sast: gl-sast-report.json - -ping-appsec-for-sast-findings: - stage: lint - image: alpine:latest - extends: - - .ping-appsec-for-sast-findings:rules - variables: - # Project Access Token bot ID for /gitlab-com/gl-security/appsec/sast-custom-rules - BOT_USER_ID: 11727358 - needs: - - semgrep-appsec-custom-rules - script: - - apk add jq curl - - scripts/process_custom_semgrep_results.sh diff --git a/.gitlab/sast-ruleset.toml b/.gitlab/sast-ruleset.toml new file mode 100644 index 00000000000..6bfb4618b73 --- /dev/null +++ b/.gitlab/sast-ruleset.toml @@ -0,0 +1,10 @@ +[semgrep] + description = 'semgrep custom rules configuration' + targetdir = "/sgrules" + validate = true + + [[semgrep.passthrough]] + type = "git" + value = "https://gitlab.com/gitlab-com/gl-security/appsec/sast-custom-rules.git" + ref = "refs/heads/main" + subdir = "appsec-pings" diff --git a/app/assets/javascripts/work_items/components/work_item_assignees.vue b/app/assets/javascripts/work_items/components/work_item_assignees.vue index 5349b40da8e..9ff424aa20f 100644 --- a/app/assets/javascripts/work_items/components/work_item_assignees.vue +++ b/app/assets/javascripts/work_items/components/work_item_assignees.vue @@ -15,10 +15,11 @@ import currentUserQuery from '~/graphql_shared/queries/current_user.query.graphq import userSearchQuery from '~/graphql_shared/queries/users_search.query.graphql'; import InviteMembersTrigger from '~/invite_members/components/invite_members_trigger.vue'; import { n__, s__ } from '~/locale'; +import Tracking from '~/tracking'; import SidebarParticipant from '~/sidebar/components/assignees/sidebar_participant.vue'; import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; import localUpdateWorkItemMutation from '../graphql/local_update_work_item.mutation.graphql'; -import { i18n } from '../constants'; +import { i18n, TRACKING_CATEGORY_SHOW } from '../constants'; function isTokenSelectorElement(el) { return el?.classList.contains('gl-token-close') || el?.classList.contains('dropdown-item'); @@ -44,6 +45,7 @@ export default { GlDropdownItem, GlDropdownDivider, }, + mixins: [Tracking.mixin()], inject: ['fullPath'], props: { workItemId: { @@ -58,6 +60,15 @@ export default { type: Boolean, required: true, }, + workItemType: { + type: String, + required: true, + }, + canUpdate: { + type: Boolean, + required: false, + default: false, + }, }, data() { return { @@ -95,6 +106,13 @@ export default { }, }, computed: { + tracking() { + return { + category: TRACKING_CATEGORY_SHOW, + label: 'item_assignees', + property: `type_${this.workItemType}`, + }; + }, assigneeListEmpty() { return this.assignees.length === 0; }, @@ -163,6 +181,7 @@ export default { }, }, }); + this.track('updated_assignees'); }, handleFocus() { this.isEditing = true; @@ -208,9 +227,11 @@ export default { ref="tokenSelector" :selected-tokens="localAssignees" :container-class="containerClass" - class="assignees-selector gl-flex-grow-1 gl-border gl-border-white gl-hover-border-gray-200 gl-rounded-base col-9 gl-align-self-start gl-px-0!" + class="assignees-selector gl-flex-grow-1 gl-border gl-border-white gl-rounded-base col-9 gl-align-self-start gl-px-0!" + :class="{ 'gl-hover-border-gray-200': canUpdate }" :dropdown-items="dropdownItems" :loading="isLoadingUsers" + :view-only="!canUpdate" @input="handleAssigneesInput" @text-input="debouncedSearchKeyUpdate" @focus="handleFocus" diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index 7314b0afc54..ad90fe88947 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -216,9 +216,11 @@ export default {