diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0354a2b650b..591c83f0cff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,8 @@ default: .default-branch-incident-variables: &default-branch-incident-variables CREATE_INCIDENT_FOR_PIPELINE_FAILURE: "true" NOTIFY_PIPELINE_FAILURE_CHANNEL: "master-broken" + BROKEN_BRANCH_INCIDENTS_PROJECT: "gitlab-org/quality/engineering-productivity/master-broken-incidents" + BROKEN_BRANCH_INCIDENTS_PROJECT_TOKEN: "${BROKEN_MASTER_INCIDENTS_PROJECT_TOKEN}" workflow: name: '$PIPELINE_NAME' @@ -107,6 +109,9 @@ workflow: <<: *ruby2-variables NOTIFY_PIPELINE_FAILURE_CHANNEL: "releases" PIPELINE_NAME: 'Ruby 2 $CI_COMMIT_BRANCH branch pipeline' + CREATE_INCIDENT_FOR_PIPELINE_FAILURE: "true" + BROKEN_BRANCH_INCIDENTS_PROJECT: "gitlab-org/release/tasks" + BROKEN_BRANCH_INCIDENTS_PROJECT_TOKEN: "${BROKEN_STABLE_INCIDENTS_PROJECT_TOKEN}" - if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/' variables: <<: *ruby2-variables diff --git a/.gitlab/ci/notify.gitlab-ci.yml b/.gitlab/ci/notify.gitlab-ci.yml index 84fb5a55ed1..bdd7979126f 100644 --- a/.gitlab/ci/notify.gitlab-ci.yml +++ b/.gitlab/ci/notify.gitlab-ci.yml @@ -43,8 +43,9 @@ notify-pipeline-failure: - .notify:rules:notify-pipeline-failure image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION} variables: - BROKEN_MASTER_INCIDENTS_PROJECT: "gitlab-org/quality/engineering-productivity/master-broken-incidents" - BROKEN_MASTER_INCIDENT_JSON: "${CI_PROJECT_DIR}/incident.json" + INCIDENT_PROJECT: "#{BROKEN_BRANCH_INCIDENTS_PROJECT}" + BROKEN_BRANCH_PROJECT_TOKEN: "${BROKEN_BRANCH_INCIDENTS_PROJECT_TOKEN}" + INCIDENT_JSON: "${CI_PROJECT_DIR}/incident.json" SLACK_CHANNEL: "${NOTIFY_PIPELINE_FAILURE_CHANNEL}" FAILED_PIPELINE_SLACK_MESSAGE_FILE: "${CI_PROJECT_DIR}/failed_pipeline_slack_message.json" before_script: @@ -54,17 +55,17 @@ notify-pipeline-failure: script: - | if [[ "${CREATE_INCIDENT_FOR_PIPELINE_FAILURE}" == "true" ]]; then - scripts/create-pipeline-failure-incident.rb -p ${BROKEN_MASTER_INCIDENTS_PROJECT} -f ${BROKEN_MASTER_INCIDENT_JSON} -t ${BROKEN_MASTER_INCIDENTS_PROJECT_TOKEN}; - echosuccess "Created incident $(jq '.web_url' ${BROKEN_MASTER_INCIDENT_JSON})"; + scripts/create-pipeline-failure-incident.rb -p ${INCIDENT_PROJECT} -f ${INCIDENT_JSON} -t ${BROKEN_BRANCH_PROJECT_TOKEN}; + echosuccess "Created incident $(jq '.web_url' ${INCIDENT_JSON})"; fi - | - scripts/generate-failed-pipeline-slack-message.rb -i ${BROKEN_MASTER_INCIDENT_JSON} -f ${FAILED_PIPELINE_SLACK_MESSAGE_FILE}; + scripts/generate-failed-pipeline-slack-message.rb -i ${INCIDENT_JSON} -f ${FAILED_PIPELINE_SLACK_MESSAGE_FILE}; curl -X POST -H 'Content-Type: application/json' --data @${FAILED_PIPELINE_SLACK_MESSAGE_FILE} "$CI_SLACK_WEBHOOK_URL" || scripts/slack ${SLACK_CHANNEL} "☠️ Broken pipeline notification failed! ☠️ See ${CI_JOB_URL}" ci_failing "Failed pipeline reporter" artifacts: paths: - - ${BROKEN_MASTER_INCIDENT_JSON} + - ${INCIDENT_JSON} - ${FAILED_PIPELINE_SLACK_MESSAGE_FILE} when: always expire_in: 2 days diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 718b4e67f4e..c26dd45ae93 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -2096,7 +2096,7 @@ changes: *code-patterns when: manual allow_failure: true - - <<: *if-dot-com-gitlab-org-schedule + - <<: *if-dot-com-ee-schedule-default-branch-maintenance allow_failure: true .review:rules:review-k8s-resources-count-checks: diff --git a/.rubocop_todo/performance/string_include.yml b/.rubocop_todo/performance/string_include.yml deleted file mode 100644 index 2a2d0559397..00000000000 --- a/.rubocop_todo/performance/string_include.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Cop supports --autocorrect. -Performance/StringInclude: - Exclude: - - 'app/models/snippet_repository.rb' - - 'config/initializers/macos.rb' - - 'config/spring.rb' - - 'ee/app/models/ee/container_registry/event.rb' - - 'ee/lib/gitlab/auth/smartcard/certificate.rb' - - 'lib/kramdown/parser/atlassian_document_format.rb' - - 'lib/prometheus/pid_provider.rb' - - 'spec/features/projects/jobs_spec.rb' - - 'spec/spec_helper.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 2dd600c5f52..3a65378f961 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -4e200026c03189abe2c60b071204340c4af5cf35 +6eb7389db0d54ef9ba3622eb7d1412f71e9deb2f diff --git a/app/assets/javascripts/graphql_shared/issuable_client.js b/app/assets/javascripts/graphql_shared/issuable_client.js index 745a03f411a..316bc746051 100644 --- a/app/assets/javascripts/graphql_shared/issuable_client.js +++ b/app/assets/javascripts/graphql_shared/issuable_client.js @@ -6,6 +6,8 @@ import getIssueStateQuery from '~/issues/show/queries/get_issue_state.query.grap import createDefaultClient from '~/lib/graphql'; import typeDefs from '~/work_items/graphql/typedefs.graphql'; import { WIDGET_TYPE_NOTES } from '~/work_items/constants'; +import getWorkItemLinksQuery from '~/work_items/graphql/work_item_links.query.graphql'; +import { findHierarchyWidgetChildren } from '~/work_items/utils'; export const config = { typeDefs, @@ -143,6 +145,28 @@ export const config = { export const resolvers = { Mutation: { + addHierarchyChild: (_, { id, workItem }, { cache }) => { + const queryArgs = { query: getWorkItemLinksQuery, variables: { id } }; + const sourceData = cache.readQuery(queryArgs); + + const data = produce(sourceData, (draftState) => { + findHierarchyWidgetChildren(draftState.workItem).push(workItem); + }); + + cache.writeQuery({ ...queryArgs, data }); + }, + removeHierarchyChild: (_, { id, workItem }, { cache }) => { + const queryArgs = { query: getWorkItemLinksQuery, variables: { id } }; + const sourceData = cache.readQuery(queryArgs); + + const data = produce(sourceData, (draftState) => { + const hierarchyChildren = findHierarchyWidgetChildren(draftState.workItem); + const index = hierarchyChildren.findIndex((child) => child.id === workItem.id); + hierarchyChildren.splice(index, 1); + }); + + cache.writeQuery({ ...queryArgs, data }); + }, updateIssueState: (_, { issueType = undefined, isDirty = false }, { cache }) => { const sourceData = cache.readQuery({ query: getIssueStateQuery }); const data = produce(sourceData, (draftData) => { diff --git a/app/assets/javascripts/issues/show/graphql.js b/app/assets/javascripts/issues/show/graphql.js deleted file mode 100644 index deee034f9d1..00000000000 --- a/app/assets/javascripts/issues/show/graphql.js +++ /dev/null @@ -1,9 +0,0 @@ -import Vue from 'vue'; -import VueApollo from 'vue-apollo'; -import { defaultClient } from '~/graphql_shared/issuable_client'; - -Vue.use(VueApollo); - -export default new VueApollo({ - defaultClient, -}); diff --git a/app/assets/javascripts/issues/show/index.js b/app/assets/javascripts/issues/show/index.js index 8b8c710c641..489b65b8704 100644 --- a/app/assets/javascripts/issues/show/index.js +++ b/app/assets/javascripts/issues/show/index.js @@ -1,6 +1,7 @@ import Vue from 'vue'; import { mapGetters } from 'vuex'; import errorTrackingStore from '~/error_tracking/store'; +import { apolloProvider } from '~/graphql_shared/issuable_client'; import { parseBoolean } from '~/lib/utils/common_utils'; import { scrollToTargetOnResize } from '~/lib/utils/resize_observer'; import IssueApp from './components/app.vue'; @@ -8,7 +9,6 @@ import HeaderActions from './components/header_actions.vue'; import IncidentTabs from './components/incidents/incident_tabs.vue'; import SentryErrorStackTrace from './components/sentry_error_stack_trace.vue'; import { INCIDENT_TYPE, issueState } from './constants'; -import apolloProvider from './graphql'; import getIssueStateQuery from './queries/get_issue_state.query.graphql'; const bootstrapApollo = (state = {}) => { diff --git a/app/assets/javascripts/related_issues/index.js b/app/assets/javascripts/related_issues/index.js index c77a67c4287..c42ee27fbdf 100644 --- a/app/assets/javascripts/related_issues/index.js +++ b/app/assets/javascripts/related_issues/index.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import apolloProvider from '~/issues/show/graphql'; +import { apolloProvider } from '~/graphql_shared/issuable_client'; import { parseBoolean } from '~/lib/utils/common_utils'; import RelatedIssuesRoot from './components/related_issues_root.vue'; diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue index 62680195984..3c3d5f0b42f 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue @@ -1,6 +1,5 @@