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 {