diff --git a/.eslintrc.yml b/.eslintrc.yml index 77b1b72fe6..ebf8048f19 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -33,6 +33,15 @@ rules: - error - max: 1 promise/catch-or-return: error + no-param-reassign: + - error + - props: true + ignorePropertyModificationsFor: + - "acc" # for reduce accumulators + - "accumulator" # for reduce accumulators + - "el" # for DOM elements + - "element" # for DOM elements + - "state" # for Vuex mutations no-underscore-dangle: - error - allow: diff --git a/.flayignore b/.flayignore deleted file mode 100644 index 4b6f7ba693..0000000000 --- a/.flayignore +++ /dev/null @@ -1,34 +0,0 @@ -*.erb -lib/gitlab/sanitizers/svg/whitelist.rb -lib/gitlab/diff/position_tracer.rb -app/controllers/projects/approver_groups_controller.rb -app/controllers/projects/approvers_controller.rb -app/controllers/projects/protected_branches/merge_access_levels_controller.rb -app/controllers/projects/protected_branches/push_access_levels_controller.rb -app/controllers/projects/protected_tags/create_access_levels_controller.rb -app/policies/project_policy.rb -app/models/concerns/relative_positioning.rb -app/workers/stuck_merge_jobs_worker.rb -lib/gitlab/redis/*.rb -lib/gitlab/gitaly_client/operation_service.rb -app/models/project_services/packagist_service.rb -lib/gitlab/background_migration/normalize_ldap_extern_uids_range.rb -lib/gitlab/background_migration/* -app/models/project_services/kubernetes_service.rb -lib/gitlab/workhorse.rb -lib/gitlab/ci/trace/chunked_io.rb -lib/gitlab/gitaly_client/ref_service.rb -lib/gitlab/gitaly_client/commit_service.rb -lib/gitlab/git/commit.rb -lib/gitlab/git/tag.rb - -ee/db/**/* -ee/app/serializers/ee/merge_request_widget_entity.rb -ee/lib/api/epics.rb -ee/lib/api/geo_nodes.rb -ee/lib/ee/api/group_boards.rb -ee/lib/ee/api/boards.rb -ee/lib/ee/gitlab/ldap/sync/admin_users.rb -ee/app/workers/geo/file_download_dispatch_worker/job_artifact_job_finder.rb -ee/app/workers/geo/file_download_dispatch_worker/lfs_object_job_finder.rb -ee/spec/**/* diff --git a/.gitignore b/.gitignore index 9a42a663fb..eb0875a977 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,4 @@ eslint-report.html /plugins/* /.gitlab_pages_secret package-lock.json +/junit_rspec.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd02d72b4c..28cf43f442 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.4.4-golang-1.9-git-2.18-chrome-67.0-node-8.x-yarn-1.2-postgresql-9.6-graphicsmagick-1.3.29" +image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.4.4-golang-1.9-git-2.18-chrome-69.0-node-8.x-yarn-1.2-postgresql-9.6-graphicsmagick-1.3.29" .dedicated-runner: &dedicated-runner retry: 1 @@ -131,7 +131,7 @@ stages: .single-script-job: &single-script-job image: ruby:2.4-alpine before_script: [] - stage: build + stage: test cache: {} dependencies: [] variables: &single-script-job-variables @@ -171,7 +171,7 @@ stages: - '[[ -f $FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${FLAKY_RSPEC_REPORT_PATH}' - '[[ -f $NEW_FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${NEW_FLAKY_RSPEC_REPORT_PATH}' - scripts/gitaly-test-spawn - - knapsack rspec "--color --format documentation" + - knapsack rspec "--color --format documentation --format RspecJunitFormatter --out junit_rspec.xml" artifacts: expire_in: 31d when: always @@ -180,6 +180,8 @@ stages: - knapsack/ - rspec_flaky/ - tmp/capybara/ + reports: + junit: junit_rspec.xml .rspec-metadata-pg: &rspec-metadata-pg <<: *rspec-metadata @@ -311,10 +313,13 @@ review-docs-cleanup: environment: name: review-docs/$CI_COMMIT_REF_SLUG action: stop - when: manual script: - gem install gitlab --no-ri --no-rdoc - ./$SCRIPT_NAME cleanup + when: manual + only: + - branches@gitlab-org/gitlab-ce + - branches@gitlab-org/gitlab-ee ## # Trigger a docker image build in CNG (Cloud Native GitLab) repository @@ -322,7 +327,7 @@ review-docs-cleanup: cloud-native-image: image: ruby:2.4-alpine before_script: [] - stage: build + stage: test allow_failure: true variables: GIT_DEPTH: "1" @@ -703,7 +708,6 @@ gitlab:assets:compile: SETUP_DB: "false" SKIP_STORAGE_VALIDATION: "true" WEBPACK_REPORT: "true" - NO_COMPRESSION: "true" # we override the max_old_space_size to prevent OOM errors NODE_OPTIONS: --max_old_space_size=3584 script: @@ -717,6 +721,7 @@ gitlab:assets:compile: expire_in: 31d paths: - webpack-report/ + - public/assets/ karma: <<: *dedicated-no-docs-and-no-qa-pull-cache-job @@ -739,7 +744,7 @@ karma: - chrome_debug.log - coverage-javascript/ -codequality: +code_quality: <<: *dedicated-no-docs-no-db-pull-cache-job image: docker:stable allow_failure: true @@ -757,9 +762,13 @@ codequality: script: # Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable" for Security Products - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - - docker run --env SOURCE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code + - docker run + --env SOURCE_CODE="$PWD" + --volume "$PWD":/code + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code artifacts: - paths: [codeclimate.json] + paths: [gl-code-quality-report.json] expire_in: 1 week sast: diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS new file mode 100644 index 0000000000..7fd3256369 --- /dev/null +++ b/.gitlab/CODEOWNERS @@ -0,0 +1,17 @@ +# Backend Maintainers are the default for all ruby files +*.rb @ayufan @DouweM @dzaporozhets @grzesiek @nick.thomas @rspeicher @rymai @smcgivern +*.rake @ayufan @DouweM @dzaporozhets @grzesiek @nick.thomas @rspeicher @rymai @smcgivern + +# Technical writing team are the default reviewers for everything in `doc/` +/doc/ @axil @marcia + +# Frontend maintainers should see everything in `app/assets/` +app/assets/ @annabeldunstone @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann + +# Someone from the database team should review changes in `db/` +db/ @abrandl @NikolayS + +# Feature specific owners +/ee/lib/gitlab/code_owners/ @reprazent +/ee/lib/ee/gitlab/auth/ldap/ @dblessing @mkozono +/lib/gitlab/auth/ldap/ @dblessing @mkozono diff --git a/.gitlab/issue_templates/Acceptance_Testing.md b/.gitlab/issue_templates/Acceptance_Testing.md new file mode 100644 index 0000000000..f1fbb96ce6 --- /dev/null +++ b/.gitlab/issue_templates/Acceptance_Testing.md @@ -0,0 +1,100 @@ +## Details +- **Feature Toggle Name**: `FEATURE_NAME` +- **Required GitLab Version**: `vX.X` + +-------------------------------------------------------------------------------- + +## 1. Preparation + +- [ ] **Controllers and workers**: + 1. Please link to dashboards of the workers, and the controllers and actions that can be impacted + 2. ... + 3. ... + +## 2. Development Trial + +#### Check Dev Server Versions +- [ ] GitLab: https://dev.gitlab.org/help + +#### Enable on `dev.gitlab.org`: +- [ ] `/chatops feature set FEATURE_NAME true --dev` in [`#dev-gitlab`](https://gitlab.slack.com/messages/C6WQ87MU3) + +Then leave running while monitoring and performing some testing through web, api or SSH. + +#### Monitor + +- [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) +- [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) +- [ ] [Check for errors in GitLab Dev Sentry](https://sentry.gitlap.com/gitlab/devgitlaborg/?query=is%3Aunresolved) + +## 2. Staging Trial + +#### Check Staging Server Versions +- [ ] GitLab: https://staging.gitlab.com/help + +#### Enable on `staging.gitlab.com` +- [ ] `/chatops run feature set FEATURE_NAME true --staging` in [`#development`](https://gitlab.slack.com/messages/C02PF508L/) + +Then leave running while monitoring for at least **15 minutes** while performing some testing through web, api or SSH. + +#### Monitor + +- [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) +- [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) + +## 4. Production Server Version Check + +- [ ] GitLab: https://gitlab.com/help + +## 5. Initial Impact Check + +- [ ] Enable for a subset of users, when using percentage gates: 1%. + +Then leave running while monitoring for at least **15 minutes** while performing some testing through web, api or SSH. + +#### Monitor + +- [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) +- [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) + +## 6. Low Impact Check + +- [ ] Enable for a bigger subset of users, when using percentage gates: 10%. + +Then leave running while monitoring for at least **30 minutes** while performing some testing through web, api or SSH. + +#### Monitor + +- [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) +- [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) + +## 7. Mid Impact Trial + +- [ ] Enable for a big subset of users, when using percentage gates: 50%. + +Then leave running while monitoring for at least **12 hours** while performing some testing through web, api or SSH. + +#### Monitor + +- [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) +- [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) + +## 8. Full Impact Trial + +- [ ] Enable for all users: `/chatops run feature set FEATURE_NAME true + +Then leave running while monitoring for at least **1 week**. + +#### Monitor + +- [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) +- [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) +- [ ] [Check for errors in GitLab Dev Sentry](https://sentry.gitlap.com/gitlab/devgitlaborg/?query=is%3Aunresolved) + +#### Success? + +- [ ] Remove the feature gate from the code, and close this issue with that MR. diff --git a/.gitlab/issue_templates/Documentation.md b/.gitlab/issue_templates/Documentation.md new file mode 100644 index 0000000000..b33ed5bcaa --- /dev/null +++ b/.gitlab/issue_templates/Documentation.md @@ -0,0 +1,54 @@ + + + + + + + + +- [ ] Documents Feature A +- [ ] Follow-up from: #XXX, !YYY + +## New doc or update? + + + +- [ ] New documentation +- [ ] Update existing documentation + +## Checklists + +### Product Manager + + + +- [ ] Add the correct labels +- [ ] Add the correct milestone +- [ ] Indicate the correct document/directory for this feature +- [ ] Fill the doc blurb below + +#### Documentation blurb + + + +- Doc **title** + + + +- Feature **overview/description** + + + +- Feature **use cases** + + + +### Developer + + + +- [ ] Copy the doc blurb above and paste it into the doc +- [ ] Write the tutorial - explain how to use the feature +- [ ] Submit the MR using the appropriate MR description template + +/label ~Documentation diff --git a/.gitlab/issue_templates/Security developer workflow.md b/.gitlab/issue_templates/Security developer workflow.md index c1f702e938..64b54b171f 100644 --- a/.gitlab/issue_templates/Security developer workflow.md +++ b/.gitlab/issue_templates/Security developer workflow.md @@ -12,7 +12,7 @@ Set the title to: `[Security] Description of the original issue` - [ ] Link to the original issue adding it to the [links section](#links) - [ ] Run `scripts/security-harness` in the CE, EE, and/or Omnibus to prevent pushing to any remote besides `dev.gitlab.org` - [ ] Create an MR targetting `org` `master`, prefixing your branch with `security-` -- [ ] Label your MR with the ~security label, prefix the title with `WIP: [master]` +- [ ] Label your MR with the ~security label, prefix the title with `WIP: [master]` - [ ] Add a link to the MR to the [links section](#links) - [ ] Add a link to an EE MR if required - [ ] Make sure the MR remains in-progress and gets approved after the review cycle, **but never merged**. @@ -22,13 +22,13 @@ Set the title to: `[Security] Description of the original issue` - [ ] Once the MR is ready to be merged, create MRs targetting the last 3 releases - [ ] At this point, it might be easy to squash the commits from the MR into one - - You can use the script `bin/secpick` instead of the following steps, to help you cherry-picking. See the [seckpick documentation] + - You can use the script `bin/secpick` instead of the following steps, to help you cherry-picking. See the [secpick documentation] - [ ] Create the branch `security-X-Y` from `X-Y-stable` if it doesn't exist (and make sure it's up to date with stable) - [ ] Create each MR targetting the security branch `security-X-Y` - [ ] Add the ~security label and prefix with the version `WIP: [X.Y]` the title of the MR - [ ] Make sure all MRs have a link in the [links section](#links) and are assigned to a Release Manager. -[seckpick documentation]: https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md#secpick-script +[secpick documentation]: https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md#secpick-script #### Documentation and final details @@ -68,4 +68,4 @@ Set the title to: `[Security] Description of the original issue` [security process for developers]: https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md [RM list]: https://about.gitlab.com/release-managers/ -/label ~security +/label ~security diff --git a/.gitlab/issue_templates/Test plan.md b/.gitlab/issue_templates/Test plan.md new file mode 100644 index 0000000000..580fab206b --- /dev/null +++ b/.gitlab/issue_templates/Test plan.md @@ -0,0 +1,96 @@ +# Test Plan + + + +## Introduction + + + +## Scope + + + +## ACC Matrix + + + +| | Simple | Secure | Responsive | Obvious | Stable | +|------------|:------:|:------:|:----------:|:-------:|:------:| +| Admin | | | | | | +| Groups | | | | | | +| Project | | | | | | +| Repository | | | | | | +| Issues | | | | | | +| MRs | | | | | | +| CI/CD | | | | | | +| Ops | | | | | | +| Registry | | | | | | +| Wiki | | | | | | +| Snippets | | | | | | +| Settings | | | | | | +| Tracking | | | | | | +| API | | | | | | + +## Capabilities + + + +## Test Plan + + + +/label ~Quality \ No newline at end of file diff --git a/.gitlab/merge_request_templates/Change documentation location.md b/.gitlab/merge_request_templates/Change documentation location.md new file mode 100644 index 0000000000..b4a6d2bd3b --- /dev/null +++ b/.gitlab/merge_request_templates/Change documentation location.md @@ -0,0 +1,32 @@ + + + + +## What does this MR do? + + + +## Related issues + + + +Closes + +## Moving docs to a new location? + +Read the guidelines: +https://docs.gitlab.com/ce/development/documentation/index.html#changing-document-location + +- [ ] Make sure the old link is not removed and has its contents replaced with + a link to the new location. +- [ ] Make sure internal links pointing to the document in question are not broken. +- [ ] Search and replace any links referring to old docs in GitLab Rails app, + specifically under the `app/views/` and `ee/app/views` (for GitLab EE) directories. +- [ ] Make sure to add [`redirect_from`](https://docs.gitlab.com/ce/development/writing_documentation.html#redirections-for-pages-with-disqus-comments) + to the new document if there are any Disqus comments on the old document thread. +- [ ] Update the link in `features.yml` (if applicable) +- [ ] If working on CE and the `ee-compat-check` jobs fails, submit an MR to EE + with the changes as well (https://docs.gitlab.com/ce/development/writing_documentation.html#cherry-picking-from-ce-to-ee). +- [ ] Ping one of the technical writers for review. + +/label ~Documentation diff --git a/.gitlab/merge_request_templates/Documentation.md b/.gitlab/merge_request_templates/Documentation.md index 531035b376..ca38c881c6 100644 --- a/.gitlab/merge_request_templates/Documentation.md +++ b/.gitlab/merge_request_templates/Documentation.md @@ -1,4 +1,8 @@ - + + + + + ## What does this MR do? @@ -10,20 +14,19 @@ Closes -## Moving docs to a new location? +## Author's checklist -Read the guidelines: -https://docs.gitlab.com/ee/development/documentation/#changing-document-location +- [ ] [Apply the correct labels and milestone](https://docs.gitlab.com/ee/development/documentation/workflow.html#2-developer-s-role-in-the-documentation-process) +- [ ] Crosslink the document from the higher-level index +- [ ] Crosslink the document from other subject-related docs +- [ ] Correctly apply the product [badges](https://docs.gitlab.com/ee/development/documentation/styleguide.html#product-badges) and [tiers](https://docs.gitlab.com/ee/development/documentation/styleguide.html#gitlab-versions-and-tiers) +- [ ] [Port the MR to EE (or backport from CE)](https://docs.gitlab.com/ee/development/documentation/index.html#cherry-picking-from-ce-to-ee): _always recommended, required when the `ee-compat-check` job fails_ -- [ ] Make sure the old link is not removed and has its contents replaced with - a link to the new location. -- [ ] Make sure internal links pointing to the document in question are not broken. -- [ ] Search and replace any links referring to the old docs in the GitLab Rails app, - specifically under the `app/views/` and `ee/app/views` (for GitLab EE) directories. -- [ ] Make sure to add [`redirect_from`](https://docs.gitlab.com/ee/development/documentation/index.html#redirections-for-pages-with-disqus-comments) - to the new document if there are any Disqus comments on the old document thread. -- [ ] If working on CE and the `ee-compat-check` jobs fails, [submit an MR to EE - with the changes](https://docs.gitlab.com/ee/development/documentation/index.html#cherry-picking-from-ce-to-ee) as well. -- [ ] Ping one of the technical writers for review. +## Review checklist + +- [ ] Your team's review (required) +- [ ] PM's review (recommended, but not a blocker) +- [ ] Technical writer's review (required) +- [ ] Merge the EE-MR first, CE-MR afterwards /label ~Documentation diff --git a/.haml-lint.yml b/.haml-lint.yml index 32c7de0fb7..bad918ef35 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -70,14 +70,15 @@ linters: enabled: false RuboCop: - enabled: false + enabled: true # These cops are incredibly noisy when it comes to HAML templates, so we # ignore them. ignored_cops: - - Lint/BlockAlignment - - Lint/EndAlignment + - Layout/BlockAlignment + - Layout/EndAlignment - Lint/Void - Metrics/LineLength + - Naming/FileName - Style/AlignParameters - Style/BlockNesting - Style/ElseAlignment @@ -91,6 +92,51 @@ linters: - Style/TrailingWhitespace - Style/WhileUntilModifier + # These cops should eventually get enabled + - Cop/LineBreakAfterGuardClauses + - Cop/LineBreakAroundConditionalBlock + - Cop/ProjectPathHelper + - GitlabSecurity/PublicSend + - Layout/LeadingCommentSpace + - Layout/SpaceAfterColon + - Layout/SpaceAfterComma + - Layout/SpaceAroundOperators + - Layout/SpaceBeforeBlockBraces + - Layout/SpaceBeforeComma + - Layout/SpaceBeforeFirstArg + - Layout/SpaceInsideArrayLiteralBrackets + - Layout/SpaceInsideHashLiteralBraces + - Layout/SpaceInsideStringInterpolation + - Layout/TrailingBlankLines + - Lint/BooleanSymbol + - Lint/LiteralInInterpolation + - Lint/ParenthesesAsGroupedExpression + - Lint/RedundantWithIndex + - Lint/Syntax + - Metrics/BlockNesting + - Naming/VariableName + - Performance/RedundantMatch + - Performance/StringReplacement + - Rails/Presence + - Rails/RequestReferer + - Style/AndOr + - Style/ColonMethodCall + - Style/ConditionalAssignment + - Style/HashSyntax + - Style/IdenticalConditionalBranches + - Style/NegatedIf + - Style/NestedTernaryOperator + - Style/Not + - Style/ParenthesesAroundCondition + - Style/RedundantParentheses + - Style/SelfAssignment + - Style/Semicolon + - Style/TernaryParentheses + - Style/TrailingCommaInHashLiteral + - Style/UnlessElse + - Style/WordArray + - Style/ZeroLengthPredicate + RubyComments: enabled: true diff --git a/.rubocop.yml b/.rubocop.yml index c8b1ce327e..9858bbe0dd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -31,6 +31,10 @@ Style/MutableConstant: - 'ee/db/post_migrate/**/*' - 'ee/db/geo/migrate/**/*' +# TODO: Move this to gitlab-styles +Style/SafeNavigation: + Enabled: false + Naming/FileName: ExpectMatchingDefinition: true Exclude: @@ -44,6 +48,8 @@ Naming/FileName: - 'qa/bin/*' - 'config/**/*' - 'lib/generators/**/*' + - 'locale/unfound_translations.rb' + - 'ee/locale/unfound_translations.rb' - 'ee/lib/generators/**/*' IgnoreExecutableScripts: true AllowedAcronyms: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8a1ca6747a..54e3b8217d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -706,12 +706,6 @@ Style/RescueModifier: Style/RescueStandardError: Enabled: false -# Offense count: 92 -# Cop supports --auto-correct. -# Configuration parameters: ConvertCodeThatCanStartToReturnNil. -Style/SafeNavigation: - Enabled: false - # Offense count: 8 # Cop supports --auto-correct. Style/SelfAssignment: diff --git a/CHANGELOG.md b/CHANGELOG.md index 41c3450370..00ade26925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,38 +2,76 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. -## 11.2.8 (2018-10-31) +## 11.3.10 (2018-11-18) + +### Security (1 change) + +- Escape user fullname while rendering autocomplete template to prevent XSS. + + +## 11.3.9 (2018-10-31) ### Security (1 change) - Monkey kubeclient to not follow any redirects. -## 11.2.7 (2018-10-27) +## 11.3.8 (2018-10-27) - No changes. -## 11.2.6 (2018-10-26) +## 11.3.7 (2018-10-26) -### Security (5 changes) +### Security (6 changes) -- Escape entity title while autocomplete template rendering to prevent XSS. !2558 +- Escape entity title while autocomplete template rendering to prevent XSS. !2557 +- Persist only SHA digest of PersonalAccessToken#token. - Fix XSS in merge request source branch name. - Redact personal tokens in unsubscribe links. -- Persist only SHA digest of PersonalAccessToken#token. - Prevent SSRF attacks in HipChat integration. +- Validate Wiki attachments are valid temporary files. -## 11.2.5 (2018-10-05) +## 11.3.6 (2018-10-17) + +- No changes. + +## 11.3.5 (2018-10-15) + +### Fixed (2 changes) + +- Fix loading issue on some merge request discussion. !21982 +- Fix project deletion when there is a export available. !22276 + + +## 11.3.4 (2018-10-05) ### Security (3 changes) -- Filter user sensitive data from discussions JSON. !2538 +- Filter user sensitive data from discussions JSON. !2537 - Properly filter private references from system notes. - Markdown API no longer displays confidential title references unless authorized. -## 11.2.4 (2018-09-26) +## 11.3.3 (2018-10-04) + +- No changes. + +## 11.3.2 (2018-10-03) + +### Fixed (4 changes) + +- Fix NULL pipeline import problem and pipeline user mapping issue. !21875 +- Fix migration to avoid an exception during upgrade. !22055 +- Fixes admin runners table not wrapping content. +- Fix Error 500 when forking projects with Gravatar disabled. + +### Other (1 change) + +- Removes the 'required' attribute from the 'project name' field. !21770 + + +## 11.3.1 (2018-09-26) ### Security (6 changes) @@ -45,9 +83,258 @@ entry. - Block loopback addresses in UrlBlocker. +## 11.3.0 (2018-09-22) + +### Security (5 changes, 1 of them is from the community) + +- Disable the Sidekiq Admin Rack session. !21441 +- Set issuable_sort, diff_view, and perf_bar_enabled cookies to secure when possible. !21442 +- Update rubyzip to 1.2.2 (CVE-2018-1000544). !21460 (Takuya Noguchi) +- Fixed persistent XSS rendering/escaping of diff location lines. +- Block link-local addresses in URLBlocker. + +### Removed (1 change) + +- Remove Gemnasium service. !21185 + +### Fixed (83 changes, 24 of them are from the community) + +- Hide PAT creation advice for HTTP clone if PAT exists. !18208 (George Thomas @thegeorgeous) +- Allow spaces in wiki markdown links when using CommonMark. !20417 +- disable_statement_timeout no longer leak to other migrations. !20503 +- Events API now requires the read_user or api scope. !20627 (Warren Parad) +- Fix If-Check the result that a function was executed several times. !20640 (Max Dicker) +- Add migration to cleanup internal_ids inconsistency. !20926 +- Fix fallback logic for automatic MR title assignment. !20930 (Franz Liedke) +- Fixed bug when the project logo file is stored in LFS. !20948 +- Fix buttons on the new file page wrapping outside of the container. !21015 +- Solve tooltip appears under modal. !21017 +- Fix Bitbucket Cloud importer omitting replies. !21076 +- Fix pipeline fixture seeder. !21088 +- Fix blocked user card style. !21095 +- Fix empty merge requests not opening in the Web IDE. !21102 +- Fix label list item container height when there is no label description. !21106 +- Fixes input alignment in user admin form with errors. !21108 (Jacopo Beschi @jacopo-beschi) +- Rails5 fix specs duplicate key value violates unique constraint 'index_gpg_signatures_on_commit_sha'. !21119 (Jasper Maes) +- Add gitlab theme to spam logs pagination. !21145 +- Split remembering sorting for issues and merge requests. !21153 (Jacopo Beschi @jacopo-beschi) +- Fix git submodule link for subgroup projects with relative path. !21154 +- Fix: Project deletion may not log audit events during group deletion. !21162 +- Fix 1px cutoff of emojis. !21180 (gfyoung) +- Auto-DevOps.gitlab-ci.yml: update glibc package to 2.28. !21191 (sgerrand) +- Show google icon in audit log. !21207 (Jan Beckmann) +- Fix bin/secpick error and security branch prefixing. !21210 +- Importing a project no longer fails when visibility level holds a string value type. !21242 +- Fix attachments not displaying inline with Google Cloud Storage. !21265 +- Fix IDE issues with persistent banners. !21283 +- Fix "Confidential comments" button not saving in project hooks. !21289 +- Bump fog-google to 1.7.0 and google-api-client to 0.23.0. !21295 +- Don't use arguments keyword in gettext script. !21296 (gfyoung) +- Fix breadcrumb link to issues on new issue page. !21305 (J.D. Bean) +- Show '< 1%' when percent value evaluated is less than 1 on Stacked Progress Bar. !21306 +- API: Catch empty commit messages. !21322 (Robert Schilling) +- Fix SQL error when sorting 2FA-enabled users by name in admin area. !21324 +- API: Catch empty code content for project snippets. !21325 (Robert Schilling) +- Avoid nil safe message. !21326 (Yi Siliang) +- Allow date parameters on Issues, Notes, and Discussions API for group owners. !21342 (Florent Dubois) +- Fix remote mirrors failing if Git remotes have not been added. !21351 +- Removing a group no longer triggers hooks for project deletion twice. !21366 +- Use slugs for default project path and sanitize names before import. !21367 +- Vertically centres landscape avatars. !21371 (Vicary Archangel) +- Fix Web IDE unable to commit to same file twice. !21372 +- Fix project transfer name validation issues causing a redirect loop. !21408 +- Fix Error 500s due to encoding issues when Wiki hooks fire. !21414 +- Rails 5: include opclasses in rails 5 schema dump. !21416 (Jasper Maes) +- Bump GitLab Pages to v1.1.0. !21419 +- Fix links in RSS feed elements. !21424 (Marc Schwede) +- Allow gaps in multiseries metrics charts. !21427 +- Auto-DevOps.gitlab-ci.yml: fix redeploying deleted app gives helm error. !21429 +- Use sample data for push event when no commits created. !21440 (Takuya Noguchi) +- Fix importers not assigning a new default group. !21456 +- Fix edge cases of JUnitParser. !21469 +- Fix breadcrumb link to merge requests on new merge request page. !21502 (J.D. Bean) +- Handle database statement timeouts in usage ping. !21523 +- Handles exception during file upload - replaces the stack trace with a small error message. !21528 +- Fix closing issue default pattern. !21531 (Samuele Kaplun) +- Fix outdated discussions being shown on Merge Request Changes tab. !21543 +- Remove orphaned label links. !21552 +- Delete a container registry asynchronously. !21553 +- Make MR diff file filter input Clear button functional. !21556 +- Replace white spaces in wiki attachments file names. !21569 +- API: Use find_branch! in all places. !21614 (Robert Schilling) +- Fixes double +/- on inline diff view. !21634 +- Fix broken exports when they include a projet avatar. !21649 +- Fix workhorse temp path for namespace uploads. !21650 +- Fixed resolved discussions not toggling expanded state on changes tab. !21676 +- Update GitLab Shell to v8.3.2. !21701 +- Fix absent Click to Expand link on diffs not rendered on first load of Merge Requests Changes tab. !21716 +- Update GitLab Shell to v8.3.3. !21750 +- Fix import error when archive does not have the correct extension. !21765 +- Fixed IDE deleting new files creating wrong state. +- Does not collapse runners section when using pagination. +- Fix Emojis cutting in the right way. (Alexander Popov) +- Fix NamespaceUploader.base_dir for remote uploads. +- Increase width of checkout branch modal box. +- Fixes SVGs for empty states in job page overflowing on mobile. +- Fix checkboxes on runner admin settings - The labels are now clickable. +- Fixed IDE file row scrolling into view when hovering. +- Accept upload files in public/uplaods/tmp when using accelerated uploads. +- Include correct CSS file for xterm in environments page. +- Increase padding in code blocks. +- Fix: Project deletion may not log audit events during user deletion. + +### Changed (32 changes, 5 of them are from the community) + +- Add default avatar to group. !17271 (George Tsiolis) +- Allow project owners to set up forking relation through API. !18104 +- Limit navbar search for current project or group for small viewports. !18634 (George Tsiolis) +- Add Noto Color Emoji font support. !19036 (Alexander Popov) +- Update design of project overview page. !20536 +- Improve visuals of language bar on projects. !21006 +- Migrate NULL wiki_access_level to correct number so we count active wikis correctly. !21030 +- Support a custom action, such as proxying to another server, after /api/v4/internal/allowed check succeeds. !21034 +- Remove storage path dependency of gitaly install task. !21101 +- Support Kubernetes RBAC for GitLab Managed Apps when adding a existing cluster. !21127 +- Change 'Backlog' list title to 'Open' in Issue Boards. !21131 +- Enable Auto DevOps Instance Wide Default. !21157 +- Allow author to vote on their own issue and MRs. !21203 +- Truncate branch names and update "commits behind" text in MR page. !21206 +- Adds count for different board list types (label lists, assignee lists, and milestone lists) to usage statistics. !21208 +- Render files (`.md`) and wikis using CommonMark. !21228 +- Show deprecation message on project milestone page for category tabs. !21236 +- Remove redundant header from metrics page. !21282 +- Add default parameter to branches API. !21294 (Riccardo Padovani) +- Restrict reopening locked issues for non authorized issue authors. !21299 +- Send back required object storage PUT headers in /uploads/authorize API. !21319 +- Display default status emoji if only message is entered. !21330 +- Move badge settings to general settings. !21333 +- Move project settings for default branch under "Repository". !21380 +- Import all common metrics into database. !21459 +- Improved commit panel in Web IDE. !21471 +- Administrative cleanup rake tasks now leverage Gitaly. !21588 +- Remove health check feature flag in BackgroundMigrationWorker. +- Expose user's id in /admin/users/ show page. (Eva Kadlecova) +- Improved styling of top bar in IDE job trace pane. +- Make terminal button more visible. +- Shows download artifacts button for pipelines on small screens. + +### Performance (13 changes, 2 of them are from the community) + +- Enable frozen string in rest of app/models/**/*.rb. +- Add background migrations for legacy artifacts. !18615 +- Optimize querying User#manageable_groups. !21050 +- Incremental rendering with Vue on merge request page. !21063 +- Remove redundant ci_builds (status) index. !21070 +- Enable frozen in app/mailers/**/*.rb. !21147 (gfyoung) +- Improve performance when fetching related merge requests for an issue. !21237 +- Speed up diff comparisons by limiting number of commit messages rendered. !21335 +- Write diff highlighting cache upon MR creation (refactors caching). !21489 +- Bulk-render commit titles in the tree view to improve performance. !21500 +- Enable frozen string in vestigial app files. (gfyoung) +- Disable project avatar validation if avatar has not changed. +- Bitbucket Server importer: Eliminate most idle-in-transaction issues. + +### Added (41 changes, 17 of them are from the community) + +- API: Protected tags. !14986 (Robert Schilling) +- Include private contributions to contributions calendar. !17296 (George Tsiolis) +- Add an option to whitelist users based on email address as internal when the "New user set to external" setting is enabled. !17711 (Roger Rüttimann) +- Overhaul listing of projects in the group overview page. !20262 +- Add the ability to reference projects in comments and other markdown text. !20285 (Reuben Pereira) +- Add branch filter to project webhooks. !20338 (Duana Saskia) +- Allows to cancel a Created job. !20635 (Jacopo Beschi @jacopo-beschi) +- First Improvements made to the contributor on-boarding experience. !20682 (Eddie Stubbington) +- `/tag` quick action on Commit comments. !20694 (Peter Leitzen) +- Allow admins to configure the maximum Git push size. !20758 +- Expose all artifacts sizes in jobs api. !20821 (Peter Marko) +- Get the merge base of two refs through the API. !20929 +- Add ability to suppress the global "You won't be able to use SSH" message. !21027 (Ævar Arnfjörð Bjarmason) +- API: Add expiration date for shared projects to the project entity. !21104 (Robert Schilling) +- Added tooltips to tree list header. !21138 +- #47845 Add failure_reason to job webhook. !21143 (matemaciek) +- Vendor Auto-DevOps.gitlab-ci.yml with new proxy env vars passed through to docker. !21159 (kinolaev) +- Disable Auto DevOps for project upon first pipeline failure. !21172 +- Add rake command to migrate archived traces from local storage to object storage. !21193 +- Add Czech as an available language. !21201 +- Add Galician as an available language. !21202 +- Add support for extendable CI/CD config with. !21243 +- Disable Web IDE button if user is not allowed to push the source branch. !21288 +- Feature flag to disable Hashed Storage migration when renaming a repository. !21291 +- Store wiki uploads inside git repository. !21362 +- Adds Rubocop rule to enforce class_methods over module ClassMethods. !21379 (Jacopo Beschi @jacopo-beschi) +- Merge request copies all associated issue labels and milestone on creation. !21383 +- Add group name badge under group milestone. !21384 +- Adds diverged_commits_count field to GET api/v4/projects/:project_id/merge_requests/:merge_request_iid. !21405 (Jacopo Beschi @jacopo-beschi) +- Update Import/Export to only use new storage uploaders logic. !21409 +- Ask user explicitly about usage stats agreement on single user deployments. !21423 +- Added atom feed for tags. !21428 +- Add search to a group labels page. !21480 +- Display banner on project page if AutoDevOps is implicitly enabled. !21503 +- Recognize 'UNLICENSE' license files. !21508 (J.D. Bean) +- Add git_v2 feature flag. !21520 +- Added file templates to the Web IDE. +- Enabled multiple file uploads in the Web IDE. +- Allow to delete group milestones. +- Use separate model for tracking resource label changes and render label system notes based on data from this model. +- Add system note when due date is changed. (Eva Kadlecova) + +### Other (48 changes, 16 of them are from the community) + +- Remove extra spaces from MR discussion notes. !18946 (Takuya Noguchi) +- Add an example of the configuration of archive trace cron worker in gitlab.yml.example. !20583 +- Add target branch name to cherrypick confirmation message. !20846 (George Andrinopoulos) +- CE Port of Protected Environments backend. !20859 +- Added missing i18n strings to issue boards lables dropdown. !21081 +- Combines emoji award spec files into single user_interacts_with_awards_in_issue_spec.rb file. !21126 (Nate Geslin) +- Clarify current runners online text. !21151 (Ben Bodenmiller) +- Rails5: Enable verbose query logs. !21231 (Jasper Maes) +- Update presentation for SSO providers on log in page. !21233 +- Make margin of user status emoji consistent. !21268 +- Move usage ping payload from User Cohorts page to admin application settings. !21343 +- Add JSON logging for Bitbucket Server importer. !21378 +- Re-add project name field on "Create new project" page. !21386 +- Rails 5: replace removed silence_stream. !21387 (Jasper Maes) +- Rails5 update Gemfile.rails5.lock. !21388 (Jasper Maes) +- Rails5: fix can't quote ActiveSupport::HashWithIndifferentAccess. !21397 (Jasper Maes) +- Don't show flash messages for performance bar errors. !21411 +- Backport schema_changed.sh from EE which prints the diff if the schema is different. !21422 (Jasper Maes) +- Remove unused CSS part in mobile framework. !21439 (Takuya Noguchi) +- Bump unauthenticated session time from 1 hour to 2 hours. !21453 +- Run review-docs-cleanup job for gitlab-org repos only. !21463 (Takuya Noguchi) +- Rails 5: support schema t.index for mysql. !21485 (Jasper Maes) +- Add route information to lograge structured logging for API logs. !21487 +- Add gitaly_calls attribute to API logs. !21496 +- Ignore irrelevant sql commands in metrics. !21498 +- Rails 5: fix hashed_path? method that looks up file_location that doesn't exist when running certain migration specs. !21510 (Jasper Maes) +- Explicit hashed path check for trace, prevents background migration from accessing file_location column that doesn't exist. !21533 (Jasper Maes) +- Add terminal_path to job API response. !21537 +- Add User-Agent to production_json.log. !21546 +- Make cluster page settings easier to read. !21550 +- Remove striped table styling of Find files and Admin Area Applications views. !21560 (Andreas Kämmerle) +- Update ffi to 1.9.25. !21561 (Takuya Noguchi) +- Send max_patch_bytes to Gitaly via Gitaly::CommitDiffRequest. !21575 +- Add margin between username and subsequent text in issuable header. !21697 +- Send artifact information in job API. !50460 +- Reduce differences between CE and EE code base in reports components. +- Move project services log to a separate file. +- Creates vue component for job log top bar with controllers. +- Creates Vue component for trigger variables block in job log page. +- Creates Vvue component for warning block about stuck runners. +- Creates vue component for job log trace. +- Creates vue component for erased block on job view. +- Creates vue component for environments information in job log view. +- Upgrade Monaco editor. +- Creates empty state vue component for job view. +- Creates vue component for commit block in job log page. +- Creates vue components for stage dropdowns and job list container for job log view. +- Creates Vue component for artifacts block on job page. + + ## 11.2.3 (2018-08-28) -- No changes. +### Fixed (1 change) + +- Fixed cache invalidation issue with diff lines from 11.2.2. ## 11.2.2 (2018-08-27) @@ -310,6 +597,25 @@ entry. - Moves help_popover component to a common location. +## 11.1.6 (2018-08-28) + +### Fixed (1 change) + +- Fixed cache invalidation issue with diff lines from 11.2.2. + +## 11.1.5 (2018-08-27) + +### Security (3 changes) + +- Fixed persistent XSS rendering/escaping of diff location lines. +- Adding CSRF protection to Hooks resend action. +- Block link-local addresses in URLBlocker. + +### Fixed (1 change, 1 of them is from the community) + +- Sanitize git URL in import errors. (Jamie Schembri) + + ## 11.1.4 (2018-07-30) ### Fixed (4 changes, 1 of them is from the community) @@ -592,6 +898,19 @@ entry. - Use monospaced font for MR diff commit link ref on GFM. +## 11.0.6 (2018-08-27) + +### Security (3 changes) + +- Fixed persistent XSS rendering/escaping of diff location lines. +- Adding CSRF protection to Hooks resend action. +- Block link-local addresses in URLBlocker. + +### Fixed (1 change, 1 of them is from the community) + +- Sanitize git URL in import errors. (Jamie Schembri) + + ## 11.0.5 (2018-07-26) ### Security (4 changes) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0bf8cba76f..7f1da58fa9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,48 +21,54 @@ _This notice should stay as the first item in the CONTRIBUTING.md file._ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* +- [Contributing Documentation has been moved](#contributing-documentation-has-been-moved) - [Contribute to GitLab](#contribute-to-gitlab) - [Security vulnerability disclosure](#security-vulnerability-disclosure) +- [Code of conduct](#code-of-conduct) - [Closing policy for issues and merge requests](#closing-policy-for-issues-and-merge-requests) - [Helping others](#helping-others) - [I want to contribute!](#i-want-to-contribute) +- [Contribution Flow](#contribution-flow) - [Workflow labels](#workflow-labels) - - [Type labels](#type-labels) - - [Subject labels](#subject-labels) - - [Team labels](#team-labels) - - [Release Scoping labels](#release-scoping-labels) - - [Bug Priority labels](#bug-priority-labels) - - [Bug Severity labels](#bug-severity-labels) - - [Severity impact guidance](#severity-impact-guidance) - - [Label for community contributors](#label-for-community-contributors) -- [Implement design & UI elements](#implement-design-ui-elements) + - [Type labels](#type-labels) + - [Subject labels](#subject-labels) + - [Team labels](#team-labels) + - [Release Scoping labels](#release-scoping-labels) + - [Priority labels](#priority-labels) + - [Severity labels](#severity-labels) + - [Severity impact guidance](#severity-impact-guidance) + - [Label for community contributors](#label-for-community-contributors) +- [Implement design & UI elements](#implement-design--ui-elements) - [Issue tracker](#issue-tracker) - - [Issue triaging](#issue-triaging) - - [Feature proposals](#feature-proposals) - - [Issue tracker guidelines](#issue-tracker-guidelines) - - [Issue weight](#issue-weight) - - [Regression issues](#regression-issues) - - [Technical and UX debt](#technical-and-ux-debt) - - [Stewardship](#stewardship) + - [Issue triaging](#issue-triaging) + - [Feature proposals](#feature-proposals) + - [Issue tracker guidelines](#issue-tracker-guidelines) + - [Issue weight](#issue-weight) + - [Regression issues](#regression-issues) + - [Technical and UX debt](#technical-and-ux-debt) + - [Stewardship](#stewardship) - [Merge requests](#merge-requests) - - [Merge request guidelines](#merge-request-guidelines) - - [Contribution acceptance criteria](#contribution-acceptance-criteria) + - [Merge request guidelines](#merge-request-guidelines) + - [Contribution acceptance criteria](#contribution-acceptance-criteria) - [Definition of done](#definition-of-done) - [Style guides](#style-guides) -- [Code of conduct](#code-of-conduct) -- [Contribution Flow](#contribution-flow) --- +## Contributing Documentation has been moved + +As of July 2018, all the documentation for contributing to the GitLab project has been moved to a new location. +[view the new documentation](doc/development/contributing/index.md) to find the latest information. + ## Contribute to GitLab -For a first-time step-by-step guide to the contribution process, see -["Contributing to GitLab"](https://about.gitlab.com/contributing/). - Thank you for your interest in contributing to GitLab. This guide details how -to contribute to GitLab in a way that is efficient for everyone. +to contribute to GitLab in a way that is easy for everyone. + +For a first-time step-by-step guide to the contribution process, please see +["Contributing to GitLab"](https://about.gitlab.com/contributing/). Looking for something to work on? Look for issues with the label [Accepting Merge Requests](#i-want-to-contribute). @@ -71,10 +77,10 @@ source edition, and GitLab Enterprise Edition (EE) which is our commercial edition. Throughout this guide you will see references to CE and EE for abbreviation. -If you have read this guide and want to know how the GitLab [core team] +If you want to know how the GitLab [core team] operates please see [the GitLab contributing process](PROCESS.md). -- [GitLab Inc engineers should refer to the engineering workflow document](https://about.gitlab.com/handbook/engineering/workflow/) +[GitLab Inc engineers should refer to the engineering workflow document](https://about.gitlab.com/handbook/engineering/workflow/) ## Security vulnerability disclosure @@ -84,6 +90,36 @@ Please report suspected security vulnerabilities in private to Please do **NOT** create publicly viewable issues for suspected security vulnerabilities. +## Code of conduct + +As contributors and maintainers of this project, we pledge to respect all +people who contribute through reporting issues, posting feature requests, +updating documentation, submitting pull requests or patches, and other +activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual +language or imagery, derogatory comments or personal attacks, trolling, public +or private harassment, insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. Project maintainers who do not +follow the Code of Conduct may be removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior can be +reported by emailing `contact@gitlab.com`. + +This Code of Conduct is adapted from the [Contributor Covenant][contributor-covenant], version 1.1.0, +available at [http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/). + ## Closing policy for issues and merge requests GitLab is a popular open source project and the capacity to deal with issues @@ -123,623 +159,6 @@ learn how to communicate with GitLab. If you're looking for a Gitter or Slack ch please consider we favor [asynchronous communication](https://about.gitlab.com/handbook/communication/#internal-communication) over real time communication. Thanks for your contribution! -## Workflow labels - -To allow for asynchronous issue handling, we use [milestones][milestones-page] -and [labels][labels-page]. Leads and product managers handle most of the -scheduling into milestones. Labelling is a task for everyone. - -Most issues will have labels for at least one of the following: - -- Type: ~"feature proposal", ~bug, ~customer, etc. -- Subject: ~wiki, ~"container registry", ~ldap, ~api, ~frontend, etc. -- Team: ~"CI/CD", ~Plan, ~Manage, ~Quality, etc. -- Release Scoping: ~Deliverable, ~Stretch, ~"Next Patch Release" -- Priority: ~P1, ~P2, ~P3, ~P4 -- Severity: ~S1, ~S2, ~S3, ~S4 - -All labels, their meaning and priority are defined on the -[labels page][labels-page]. - -If you come across an issue that has none of these, and you're allowed to set -labels, you can _always_ add the team and type, and often also the subject. - -[milestones-page]: https://gitlab.com/gitlab-org/gitlab-ce/milestones -[labels-page]: https://gitlab.com/gitlab-org/gitlab-ce/labels - -### Type labels - -Type labels are very important. They define what kind of issue this is. Every -issue should have one or more. - -Examples of type labels are ~"feature proposal", ~bug, ~customer, ~security, -and ~"direction". - -A number of type labels have a priority assigned to them, which automatically -makes them float to the top, depending on their importance. - -Type labels are always lowercase, and can have any color, besides blue (which is -already reserved for subject labels). - -The descriptions on the [labels page][labels-page] explain what falls under each type label. - -### Subject labels - -Subject labels are labels that define what area or feature of GitLab this issue -hits. They are not always necessary, but very convenient. - -Examples of subject labels are ~wiki, ~ldap, ~api, -~issues, ~"merge requests", ~labels, and ~"container registry". - -If you are an expert in a particular area, it makes it easier to find issues to -work on. You can also subscribe to those labels to receive an email each time an -issue is labeled with a subject label corresponding to your expertise. - -Subject labels are always all-lowercase. - -### Team labels - -Team labels specify what team is responsible for this issue. -Assigning a team label makes sure issues get the attention of the appropriate -people. - -The current team labels are: - -- ~Configuration -- ~"CI/CD" -- ~Create -- ~Distribution -- ~Documentation -- ~Geo -- ~Gitaly -- ~Manage -- ~Monitoring -- ~Plan -- ~Quality -- ~Release -- ~Secure -- ~UX - -The descriptions on the [labels page][labels-page] explain what falls under the -responsibility of each team. - -Within those team labels, we also have the ~backend and ~frontend labels to -indicate if an issue needs backend work, frontend work, or both. - -Team labels are always capitalized so that they show up as the first label for -any issue. - -### Release Scoping labels - -Release Scoping labels help us clearly communicate expectations of the work for the -release. There are three levels of Release Scoping labels: - -- ~Deliverable: Issues that are expected to be delivered in the current - milestone. -- ~Stretch: Issues that are a stretch goal for delivering in the current - milestone. If these issues are not done in the current release, they will - strongly be considered for the next release. -- ~"Next Patch Release": Issues to put in the next patch release. Work on these - first, and add the "Pick Into X" label to the merge request, along with the - appropriate milestone. - -Each issue scheduled for the current milestone should be labeled ~Deliverable -or ~"Stretch". Any open issue for a previous milestone should be labeled -~"Next Patch Release", or otherwise rescheduled to a different milestone. - -### Priority labels - -Priority labels help us define the time a ~bug fix should be completed. Priority determines how quickly the defect turnaround time must be. -If there are multiple defects, the priority decides which defect has to be fixed immediately versus later. -This label documents the planned timeline & urgency which is used to measure against our actual SLA on delivering ~bug fixes. - -| Label | Meaning | Estimate time to fix | -|-------|-----------------|------------------------------------------------------------------| -| ~P1 | Urgent Priority | The current release + potentially immediate hotfix to GitLab.com | -| ~P2 | High Priority | The next release | -| ~P3 | Medium Priority | Within the next 3 releases (approx one quarter) | -| ~P4 | Low Priority | Anything outside the next 3 releases (approx beyond one quarter) | - -### Severity labels - -Severity labels help us clearly communicate the impact of a ~bug on users. - -| Label | Meaning | Impact on Functionality | Example | -|-------|-------------------|-------------------------------------------------------|---------| -| ~S1 | Blocker | Outage, broken feature with no workaround | Unable to create an issue. Data corruption/loss. Security breach. | -| ~S2 | Critical Severity | Broken Feature, workaround too complex & unacceptable | Can push commits, but only via the command line. | -| ~S3 | Major Severity | Broken Feature, workaround acceptable | Can create merge requests only from the Merge Requests page, not through the Issue. | -| ~S4 | Low Severity | Functionality inconvenience or cosmetic issue | Label colors are incorrect / not being displayed. | - -#### Severity impact guidance - -Severity levels can be applied further depending on the facet of the impact; e.g. Affected customers, GitLab.com availability, performance and etc. The below is a guideline. - -| Severity | Affected Customers/Users | GitLab.com Availability | Performance Degradation | -|----------|---------------------------------------------------------------------|----------------------------------------------------|------------------------------| -| ~S1 | >50% users affected (possible company extinction level event) | Significant impact on all of GitLab.com | | -| ~S2 | Many users or multiple paid customers affected (but not apocalyptic)| Significant impact on large portions of GitLab.com | Degradation is guaranteed to occur in the near future | -| ~S3 | A few users or a single paid customer affected | Limited impact on important portions of GitLab.com | Degradation is likely to occur in the near future | -| ~S4 | No paid users/customer affected, or expected to in the near future | Minor impact on on GitLab.com | Degradation _may_ occur but it's not likely | - -### Label for community contributors - -Issues that are beneficial to our users, 'nice to haves', that we currently do -not have the capacity for or want to give the priority to, are labeled as -~"Accepting Merge Requests", so the community can make a contribution. - -Community contributors can submit merge requests for any issue they want, but -the ~"Accepting Merge Requests" label has a special meaning. It points to -changes that: - -1. We already agreed on, -1. Are well-defined, -1. Are likely to get accepted by a maintainer. - -We want to avoid a situation when a contributor picks an -~"Accepting Merge Requests" issue and then their merge request gets closed, -because we realize that it does not fit our vision, or we want to solve it in a -different way. - -We add the ~"Accepting Merge Requests" label to: - -- Low priority ~bug issues (i.e. we do not add it to the bugs that we want to -solve in the ~"Next Patch Release") -- Small ~"feature proposal" -- Small ~"technical debt" issues - -After adding the ~"Accepting Merge Requests" label, we try to estimate the -[weight](#issue-weight) of the issue. We use issue weight to let contributors -know how difficult the issue is. Additionally: - -- We advertise ["Accepting Merge Requests" issues with weight < 5][up-for-grabs] - as suitable for people that have never contributed to GitLab before on the - [Up For Grabs campaign](http://up-for-grabs.net) -- We encourage people that have never contributed to any open source project to - look for ["Accepting Merge Requests" issues with a weight of 1][firt-timers] - -If you've decided that you would like to work on an issue, please @-mention -the [appropriate product manager](https://about.gitlab.com/handbook/product/#who-to-talk-to-for-what) -as soon as possible. The product manager will then pull in appropriate GitLab team -members to further discuss scope, design, and technical considerations. This will -ensure that that your contribution is aligned with the GitLab product and minimize -any rework and delay in getting it merged into master. - -GitLab team members who apply the ~"Accepting Merge Requests" label to an issue -should update the issue description with a responsible product manager, inviting -any potential community contributor to @-mention per above. - -[up-for-grabs]: https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name=Accepting+Merge+Requests&scope=all&sort=weight_asc&state=opened -[firt-timers]: https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=Accepting+Merge+Requests&scope=all&sort=upvotes_desc&state=opened&weight=1 - -## Implement design & UI elements - -For guidance on UX implementation at GitLab, please refer to our [Design System](https://design.gitlab.com/). - -The UX team uses labels to manage their workflow. - -The ~"UX" label on an issue is a signal to the UX team that it will need UX attention. -To better understand the priority by which UX tackles issues, see the [UX section](https://about.gitlab.com/handbook/engineering/ux) of the handbook. - -Once an issue has been worked on and is ready for development, a UXer removes the ~"UX" label and applies the ~"UX ready" label to that issue. - -The UX team has a special type label called ~"design artifact". This label indicates that the final output -for an issue is a UX solution/design. The solution will be developed by frontend and/or backend in a subsequent milestone. -Any issue labeled ~"design artifact" should not also be labeled ~"frontend" or ~"backend" since no development is -needed until the solution has been decided. - -~"design artifact" issues are like any other issue and should contain a milestone label, ~"Deliverable" or ~"Stretch", when scheduled in the current milestone. - -To prevent the misunderstanding that a feature will be be delivered in the -assigned milestone, when only UX design is planned for that milestone, the -Product Manager should create a separate issue for the ~"design artifact", -assign the ~UX, ~"design artifact" and ~"Deliverable" labels, add a milestone -and use a title that makes it clear that the scheduled issue is design only -(e.g. `Design exploration for XYZ`). - -When the ~"design artifact" issue has been completed, the UXer removes the ~UX -label, adds the ~"UX ready" label and closes the issue. This indicates the -design artifact is complete. The UXer will also copy the designs to related -issues for implementation in an upcoming milestone. - -## Issue tracker - -To get support for your particular problem please use the -[getting help channels](https://about.gitlab.com/getting-help/). - -The [GitLab CE issue tracker on GitLab.com][ce-tracker] is for bugs concerning -the latest GitLab release and [feature proposals](#feature-proposals). - -When submitting an issue please conform to the issue submission guidelines -listed below. Not all issues will be addressed and your issue is more likely to -be addressed if you submit a merge request which partially or fully solves -the issue. - -If you're unsure where to post, post to the [mailing list][google-group] or -[Stack Overflow][stackoverflow] first. There are a lot of helpful GitLab users -there who may be able to help you quickly. If your particular issue turns out -to be a bug, it will find its way from there. - -If it happens that you know the solution to an existing bug, please first -open the issue in order to keep track of it and then open the relevant merge -request that potentially fixes it. - -### Issue triaging - -Our issue triage policies are [described in our handbook]. You are very welcome -to help the GitLab team triage issues. We also organize [issue bash events] once -every quarter. - -The most important thing is making sure valid issues receive feedback from the -development team. Therefore the priority is mentioning developers that can help -on those issues. Please select someone with relevant experience from the -[GitLab team][team]. If there is nobody mentioned with that expertise look in -the commit history for the affected files to find someone. - -We also use [GitLab Triage] to automate some triaging policies. This is -currently setup as a [scheduled pipeline] running on [quality/triage-ops] -project. - -[described in our handbook]: https://about.gitlab.com/handbook/engineering/issue-triage/ -[issue bash events]: https://gitlab.com/gitlab-org/gitlab-ce/issues/17815 -[GitLab Triage]: https://gitlab.com/gitlab-org/gitlab-triage -[scheduled pipeline]: https://gitlab.com/gitlab-org/quality/triage-ops/pipeline_schedules/10512/edit -[quality/triage-ops]: https://gitlab.com/gitlab-org/quality/triage-ops - -### Feature proposals - -To create a feature proposal for CE, open an issue on the -[issue tracker of CE][ce-tracker]. - -For feature proposals for EE, open an issue on the -[issue tracker of EE][ee-tracker]. - -In order to help track the feature proposals, we have created a -[`feature proposal`][fpl] label. For the time being, users that are not members -of the project cannot add labels. You can instead ask one of the [core team] -members to add the label ~"feature proposal" to the issue or add the following -code snippet right after your description in a new line: `~"feature proposal"`. - -Please keep feature proposals as small and simple as possible, complex ones -might be edited to make them small and simple. - -Please submit Feature Proposals using the ['Feature Proposal' issue template](.gitlab/issue_templates/Feature Proposal.md) provided on the issue tracker. - -For changes in the interface, it is helpful to include a mockup. Issues that add to, or change, the interface should -be given the ~"UX" label. This will allow the UX team to provide input and guidance. You may -need to ask one of the [core team] members to add the label, if you do not have permissions to do it by yourself. - -If you want to create something yourself, consider opening an issue first to -discuss whether it is interesting to include this in GitLab. - -### Issue tracker guidelines - -**[Search the issue tracker][ce-tracker]** for similar entries before -submitting your own, there's a good chance somebody else had the same issue or -feature proposal. Show your support with an award emoji and/or join the -discussion. - -Please submit bugs using the ['Bug' issue template](.gitlab/issue_templates/Bug.md) provided on the issue tracker. -The text in the parenthesis is there to help you with what to include. Omit it -when submitting the actual issue. You can copy-paste it and then edit as you -see fit. - -### Issue weight - -Issue weight allows us to get an idea of the amount of work required to solve -one or multiple issues. This makes it possible to schedule work more accurately. - -You are encouraged to set the weight of any issue. Following the guidelines -below will make it easy to manage this, without unnecessary overhead. - -1. Set weight for any issue at the earliest possible convenience -1. If you don't agree with a set weight, discuss with other developers until -consensus is reached about the weight -1. Issue weights are an abstract measurement of complexity of the issue. Do not -relate issue weight directly to time. This is called [anchoring](https://en.wikipedia.org/wiki/Anchoring) -and something you want to avoid. -1. Something that has a weight of 1 (or no weight) is really small and simple. -Something that is 9 is rewriting a large fundamental part of GitLab, -which might lead to many hard problems to solve. Changing some text in GitLab -is probably 1, adding a new Git Hook maybe 4 or 5, big features 7-9. -1. If something is very large, it should probably be split up in multiple -issues or chunks. You can simply not set the weight of a parent issue and set -weights to children issues. - -### Regression issues - -Every monthly release has a corresponding issue on the CE issue tracker to keep -track of functionality broken by that release and any fixes that need to be -included in a patch release (see [8.3 Regressions] as an example). - -As outlined in the issue description, the intended workflow is to post one note -with a reference to an issue describing the regression, and then to update that -note with a reference to the merge request that fixes it as it becomes available. - -If you're a contributor who doesn't have the required permissions to update -other users' notes, please post a new note with a reference to both the issue -and the merge request. - -The release manager will [update the notes] in the regression issue as fixes are -addressed. - -[8.3 Regressions]: https://gitlab.com/gitlab-org/gitlab-ce/issues/4127 -[update the notes]: https://gitlab.com/gitlab-org/release-tools/blob/master/doc/pro-tips.md#update-the-regression-issue - -### Technical and UX debt - -In order to track things that can be improved in GitLab's codebase, -we use the ~"technical debt" label in [GitLab's issue tracker][ce-tracker]. -For user experience improvements, we use the ~"UX debt" label. - -These labels should be added to issues that describe things that can be improved, -shortcuts that have been taken, features that need additional attention, and all -other things that have been left behind due to high velocity of development. -For example, code that needs refactoring should use the ~"technical debt" label, -user experience refinements should use the ~"UX debt" label. - -Everyone can create an issue, though you may need to ask for adding a specific -label, if you do not have permissions to do it by yourself. Additional labels -can be combined with these labels, to make it easier to schedule -the improvements for a release. - -Issues tagged with these labels have the same priority like issues -that describe a new feature to be introduced in GitLab, and should be scheduled -for a release by the appropriate person. - -Make sure to mention the merge request that the ~"technical debt" issue or -~"UX debt" issue is associated with in the description of the issue. - -### Stewardship - -For issues related to the open source stewardship of GitLab, -there is the ~"stewardship" label. - -This label is to be used for issues in which the stewardship of GitLab -is a topic of discussion. For instance if GitLab Inc. is planning to add -features from GitLab EE to GitLab CE, related issues would be labelled with -~"stewardship". - -A recent example of this was the issue for -[bringing the time tracking API to GitLab CE][time-tracking-issue]. - -[time-tracking-issue]: https://gitlab.com/gitlab-org/gitlab-ce/issues/25517#note_20019084 - -## Merge requests - -We welcome merge requests with fixes and improvements to GitLab code, tests, -and/or documentation. The issues that are specifically suitable for -community contributions are listed with the label -[`Accepting Merge Requests` on our issue tracker for CE][accepting-mrs-ce] -and [EE][accepting-mrs-ee], but you are free to contribute to any other issue -you want. - -Please note that if an issue is marked for the current milestone either before -or while you are working on it, a team member may take over the merge request -in order to ensure the work is finished before the release date. - -If you want to add a new feature that is not labeled it is best to first create -a feedback issue (if there isn't one already) and leave a comment asking for it -to be marked as `Accepting Merge Requests`. Please include screenshots or -wireframes if the feature will also change the UI. - -Merge requests should be opened at [GitLab.com][gitlab-mr-tracker]. - -If you are new to GitLab development (or web development in general), see the -[I want to contribute!](#i-want-to-contribute) section to get you started with -some potentially easy issues. - -To start with GitLab development download the [GitLab Development Kit][gdk] and -see the [Development section](doc/development/README.md) for some guidelines. - -### Merge request guidelines - -If you can, please submit a merge request with the fix or improvements -including tests. If you don't know how to fix the issue but can write a test -that exposes the issue we will accept that as well. In general bug fixes that -include a regression test are merged quickly while new features without proper -tests are least likely to receive timely feedback. The workflow to make a merge -request is as follows: - -1. Fork the project into your personal space on GitLab.com -1. Create a feature branch, branch away from `master` -1. Write [tests](https://docs.gitlab.com/ee/development/rake_tasks.html#run-tests) and code -1. [Generate a changelog entry with `bin/changelog`][changelog] -1. If you are writing documentation, make sure to follow the - [documentation guidelines][doc-guidelines] -1. If you have multiple commits please combine them into a few logically - organized commits by [squashing them][git-squash] -1. Push the commit(s) to your fork -1. Submit a merge request (MR) to the `master` branch - 1. Your merge request needs at least 1 approval but feel free to require more. - For instance if you're touching backend and frontend code, it's a good idea - to require 2 approvals: 1 from a backend maintainer and 1 from a frontend - maintainer - 1. You don't have to select any approvers, but you can if you really want - specific people to approve your merge request -1. The MR title should describe the change you want to make -1. The MR description should give a motive for your change and the method you - used to achieve it. - 1. If you are contributing code, fill in the template already provided in the - "Description" field. - 1. If you are contributing documentation, choose `Documentation` from the - "Choose a template" menu and fill in the template. - 1. Mention the issue(s) your merge request solves, using the `Solves #XXX` or - `Closes #XXX` syntax to auto-close the issue(s) once the merge request will - be merged. -1. If you're allowed to, set a relevant milestone and labels -1. If the MR changes the UI it should include *Before* and *After* screenshots -1. If the MR changes CSS classes please include the list of affected pages, - `grep css-class ./app -R` -1. Be prepared to answer questions and incorporate feedback even if requests - for this arrive weeks or months after your MR submission - 1. If a discussion has been addressed, select the "Resolve discussion" button - beneath it to mark it resolved. -1. If your MR touches code that executes shell commands, reads or opens files or - handles paths to files on disk, make sure it adheres to the - [shell command guidelines](doc/development/shell_commands.md) -1. If your code creates new files on disk please read the - [shared files guidelines](doc/development/shared_files.md). -1. When writing commit messages please follow - [these](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - [guidelines](http://chris.beams.io/posts/git-commit/). -1. If your merge request adds one or more migrations, make sure to execute all - migrations on a fresh database before the MR is reviewed. If the review leads - to large changes in the MR, do this again once the review is complete. -1. For more complex migrations, write tests. -1. Merge requests **must** adhere to the [merge request performance - guidelines](doc/development/merge_request_performance_guidelines.md). -1. For tests that use Capybara or PhantomJS, see this [article on how - to write reliable asynchronous tests](https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara). - -Please keep the change in a single MR **as small as possible**. If you want to -contribute a large feature think very hard what the minimum viable change is. -Can you split the functionality? Can you only submit the backend/API code? Can -you start with a very simple UI? Can you do part of the refactor? The increased -reviewability of small MRs that leads to higher code quality is more important -to us than having a minimal commit log. The smaller an MR is the more likely it -is it will be merged (quickly). After that you can send more MRs to enhance it. -The ['How to get faster PR reviews' document of Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md) also has some great points regarding this. - -For examples of feedback on merge requests please look at already -[closed merge requests][closed-merge-requests]. If you would like quick feedback -on your merge request feel free to mention someone from the [core team] or one -of the [Merge request coaches][team]. -Please ensure that your merge request meets the contribution acceptance criteria. - -When having your code reviewed and when reviewing merge requests please take the -[code review guidelines](doc/development/code_review.md) into account. - -### Contribution acceptance criteria - -1. The change is as small as possible -1. Include proper tests and make all tests pass (unless it contains a test - exposing a bug in existing code). Every new class should have corresponding - unit tests, even if the class is exercised at a higher level, such as a feature test. -1. If you suspect a failing CI build is unrelated to your contribution, you may - try and restart the failing CI job or ask a developer to fix the - aforementioned failing test -1. Your MR initially contains a single commit (please use `git rebase -i` to - squash commits) -1. Your changes can merge without problems (if not please rebase if you're the - only one working on your feature branch, otherwise, merge `master`) -1. Does not break any existing functionality -1. Fixes one specific issue or implements one specific feature (do not combine - things, send separate merge requests if needed) -1. Migrations should do only one thing (e.g., either create a table, move data - to a new table or remove an old table) to aid retrying on failure -1. Keeps the GitLab code base clean and well structured -1. Contains functionality we think other users will benefit from too -1. Doesn't add configuration options or settings options since they complicate - making and testing future changes -1. Changes do not adversely degrade performance. - - Avoid repeated polling of endpoints that require a significant amount of overhead - - Check for N+1 queries via the SQL log or [`QueryRecorder`](https://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - - Avoid repeated access of filesystem -1. If you need polling to support real-time features, please use - [polling with ETag caching][polling-etag]. -1. Changes after submitting the merge request should be in separate commits - (no squashing). -1. It conforms to the [style guides](#style-guides) and the following: - - If your change touches a line that does not follow the style, modify the - entire line to follow it. This prevents linting tools from generating warnings. - - Don't touch neighbouring lines. As an exception, automatic mass - refactoring modifications may leave style non-compliant. -1. If the merge request adds any new libraries (gems, JavaScript libraries, - etc.), they should conform to our [Licensing guidelines][license-finder-doc]. - See the instructions in that document for help if your MR fails the - "license-finder" test with a "Dependencies that need approval" error. -1. The merge request meets the [definition of done](#definition-of-done). - -## Definition of done - -If you contribute to GitLab please know that changes involve more than just -code. We have the following [definition of done][definition-of-done]. Please ensure you support -the feature you contribute through all of these steps. - -1. Description explaining the relevancy (see following item) -1. Working and clean code that is commented where needed -1. [Unit, integration, and system tests][testing] that pass on the CI server -1. Performance/scalability implications have been considered, addressed, and tested -1. [Documented][doc-guidelines] in the `/doc` directory -1. [Changelog entry added][changelog], if necessary -1. Reviewed and any concerns are addressed -1. Merged by a project maintainer -1. Added to the release blog article, if relevant -1. Added to [the website](https://gitlab.com/gitlab-com/www-gitlab-com/), if relevant -1. Community questions answered -1. Answers to questions radiated (in docs/wiki/support etc.) - -If you add a dependency in GitLab (such as an operating system package) please -consider updating the following and note the applicability of each in your -merge request: - -1. Note the addition in the release blog post (create one if it doesn't exist yet) https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/ -1. Upgrade guide, for example https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/7.5-to-7.6.md -1. Upgrader https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/upgrader.md#2-run-gitlab-upgrade-tool -1. Installation guide https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies -1. GitLab Development Kit https://gitlab.com/gitlab-org/gitlab-development-kit -1. Test suite https://gitlab.com/gitlab-org/gitlab-ce/blob/master/scripts/prepare_build.sh -1. Omnibus package creator https://gitlab.com/gitlab-org/omnibus-gitlab - -## Style guides - -1. [Ruby](https://github.com/bbatsov/ruby-style-guide). - Important sections include [Source Code Layout][rss-source] and - [Naming][rss-naming]. Use: - - multi-line method chaining style **Option A**: dot `.` on the second line - - string literal quoting style **Option A**: single quoted by default -1. [Rails](https://github.com/bbatsov/rails-style-guide) -1. [Newlines styleguide][newlines-styleguide] -1. [Testing][testing] -1. [JavaScript styleguide][js-styleguide] -1. [SCSS styleguide][scss-styleguide] -1. [Shell commands](doc/development/shell_commands.md) created by GitLab - contributors to enhance security -1. [Database Migrations](doc/development/migration_style_guide.md) -1. [Markdown](http://www.cirosantilli.com/markdown-styleguide) -1. [Documentation styleguide](https://docs.gitlab.com/ee/development/documentation/styleguide.html) -1. Interface text should be written subjectively instead of objectively. It - should be the GitLab core team addressing a person. It should be written in - present time and never use past tense (has been/was). For example instead - of _prohibited this user from being saved due to the following errors:_ the - text should be _sorry, we could not create your account because:_ -1. Code should be written in [US English][us-english] - -This is also the style used by linting tools such as -[RuboCop](https://github.com/bbatsov/rubocop), -[PullReview](https://www.pullreview.com/) and [Hound CI](https://houndci.com). - -## Code of conduct - -As contributors and maintainers of this project, we pledge to respect all -people who contribute through reporting issues, posting feature requests, -updating documentation, submitting pull requests or patches, and other -activities. - -We are committed to making participation in this project a harassment-free -experience for everyone, regardless of level of experience, gender, gender -identity and expression, sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, or religion. - -Examples of unacceptable behavior by participants include the use of sexual -language or imagery, derogatory comments or personal attacks, trolling, public -or private harassment, insults, or other unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. Project maintainers who do not -follow the Code of Conduct may be removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior can be -reported by emailing `contact@gitlab.com`. - -This Code of Conduct is adapted from the [Contributor Covenant][contributor-covenant], version 1.1.0, -available at [http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/). - ## Contribution Flow When contributing to GitLab, your merge request is subject to review by merge request maintainers of a particular specialty. @@ -789,3 +208,115 @@ When your code contains more than 500 changes, any major breaking changes, or an [polling-etag]: https://docs.gitlab.com/ce/development/polling.html [testing]: doc/development/testing_guide/index.md [us-english]: https://en.wikipedia.org/wiki/American_English + + +## Workflow labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Type labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Subject labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Team labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Release Scoping labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Priority labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Severity labels + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + +#### Severity impact guidance + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Label for community contributors + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +## Implement design & UI elements + +This [documentation](doc/development/contributing/design.md) has been moved. + + +## Issue tracker + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + +### Issue triaging + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Feature proposals + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + +### Issue tracker guidelines + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Issue weight + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Regression issues + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Technical and UX debt + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +### Stewardship + +This [documentation](doc/development/contributing/issue_workflow.md) has been moved. + + +## Merge requests + +This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved. + + +### Merge request guidelines + +This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved. + + +### Contribution acceptance criteria + +This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved. + + +## Definition of done + +This [documentation](doc/development/contributing/merge_request_workflow.md) has been moved. + + +## Style guides + +This [documentation](doc/development/contributing/design.md) has been moved. diff --git a/Dangerfile b/Dangerfile index 9217610da8..f57fcd1649 100644 --- a/Dangerfile +++ b/Dangerfile @@ -4,4 +4,5 @@ danger.import_dangerfile(path: 'danger/changelog') danger.import_dangerfile(path: 'danger/specs') danger.import_dangerfile(path: 'danger/gemfile') danger.import_dangerfile(path: 'danger/database') +danger.import_dangerfile(path: 'danger/documentation') danger.import_dangerfile(path: 'danger/frozen_string') diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 8387e21a25..dceaf0c78f 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -0.117.3 +0.120.1 diff --git a/GITLAB_PAGES_VERSION b/GITLAB_PAGES_VERSION index 3eefcb9dd5..9084fa2f71 100644 --- a/GITLAB_PAGES_VERSION +++ b/GITLAB_PAGES_VERSION @@ -1 +1 @@ -1.0.0 +1.1.0 diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION index 0e79152459..d127a0ff9f 100644 --- a/GITLAB_SHELL_VERSION +++ b/GITLAB_SHELL_VERSION @@ -1 +1 @@ -8.1.1 +8.3.3 diff --git a/GITLAB_WORKHORSE_VERSION b/GITLAB_WORKHORSE_VERSION index 831446cbd2..dfda3e0b4f 100644 --- a/GITLAB_WORKHORSE_VERSION +++ b/GITLAB_WORKHORSE_VERSION @@ -1 +1 @@ -5.1.0 +6.1.0 diff --git a/Gemfile b/Gemfile index dfa42680c2..f14e05d43e 100644 --- a/Gemfile +++ b/Gemfile @@ -68,7 +68,7 @@ gem 'u2f', '~> 0.2.1' gem 'validates_hostname', '~> 1.0.6' # Browser detection -gem 'browser', '~> 2.2' +gem 'browser', '~> 2.5' # GPG gem 'gpgme' @@ -107,7 +107,9 @@ gem 'kaminari', '~> 1.0' gem 'hamlit', '~> 2.8.8' # Files attachments -gem 'carrierwave', '~> 1.2' +# Locked until https://github.com/carrierwaveuploader/carrierwave/pull/2332/files is merged. +# config/initializers/carrierwave_patch.rb can be removed once that change is released. +gem 'carrierwave', '= 1.2.3' gem 'mini_magick' # Drag and Drop UI @@ -116,14 +118,14 @@ gem 'dropzonejs-rails', '~> 0.7.1' # for backups gem 'fog-aws', '~> 2.0.1' gem 'fog-core', '~> 1.44' -gem 'fog-google', '~> 1.3.3' +gem 'fog-google', '~> 1.7.1' gem 'fog-local', '~> 0.3' gem 'fog-openstack', '~> 0.1' gem 'fog-rackspace', '~> 0.1.1' gem 'fog-aliyun', '~> 0.2.0' # for Google storage -gem 'google-api-client', '~> 0.19.8' +gem 'google-api-client', '~> 0.23' # for aws storage gem 'unf', '~> 0.1.4' @@ -180,7 +182,7 @@ gem 'rufus-scheduler', '~> 3.4' gem 'httparty', '~> 0.13.3' # Colored output to console -gem 'rainbow', '~> 2.2' +gem 'rainbow', '~> 3.0' # Progress bar gem 'ruby-progressbar' @@ -195,6 +197,9 @@ gem 're2', '~> 1.1.1' gem 'version_sorter', '~> 2.1.0' +# Export Ruby Regex to Javascript +gem 'js_regex', '~> 2.2.1' + # User agent parsing gem 'device_detector' @@ -214,9 +219,6 @@ gem 'jira-ruby', '~> 1.4' # Flowdock integration gem 'gitlab-flowdock-git-hook', '~> 1.0.1' -# Gemnasium integration -gem 'gemnasium-gitlab-service', '~> 0.2' - # Slack integration gem 'slack-notifier', '~> 1.5.1' @@ -363,12 +365,11 @@ group :development, :test do gem 'scss_lint', '~> 0.56.0', require: false gem 'haml_lint', '~> 0.26.0', require: false gem 'simplecov', '~> 0.14.0', require: false - gem 'flay', '~> 2.10.0', require: false gem 'bundler-audit', '~> 0.5.0', require: false gem 'benchmark-ips', '~> 2.3.0', require: false - gem 'license_finder', '~> 3.1', require: false + gem 'license_finder', '~> 5.4', require: false gem 'knapsack', '~> 1.16' gem 'activerecord_sane_schema_dumper', gem_versions['activerecord_sane_schema_dumper'] @@ -390,6 +391,7 @@ group :test do gem 'sham_rack', '~> 1.3.6' gem 'concurrent-ruby', '~> 1.0.5' gem 'test-prof', '~> 0.2.5' + gem 'rspec_junit_formatter' end gem 'octokit', '~> 4.9' @@ -423,7 +425,7 @@ group :ed25519 do end # Gitaly GRPC client -gem 'gitaly-proto', '~> 0.113.0', require: 'gitaly' +gem 'gitaly-proto', '~> 0.117.0', require: 'gitaly' gem 'grpc', '~> 1.11.0' # Locked until https://github.com/google/protobuf/issues/4210 is closed diff --git a/Gemfile.lock b/Gemfile.lock index acb2cc95bb..e41719ec79 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,12 +86,11 @@ GEM bindata (2.4.3) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - blankslate (2.1.2.4) bootsnap (1.3.1) msgpack (~> 1.0) bootstrap_form (2.7.0) brakeman (4.2.1) - browser (2.2.0) + browser (2.5.3) builder (3.2.3) bullet (5.5.1) activesupport (>= 3.0.0) @@ -123,10 +122,10 @@ GEM numerizer (~> 0.1.1) chunky_png (1.3.5) citrus (3.0.2) - coderay (1.1.1) + coderay (1.1.2) coercible (1.0.0) descendants_tracker (~> 0.0.1) - commonmarker (0.17.8) + commonmarker (0.17.13) ruby-enum (~> 0.5) concord (0.1.5) adamantium (~> 0.2.0) @@ -209,12 +208,7 @@ GEM fast_blank (1.0.0) fast_gettext (1.6.0) ffaker (2.4.0) - ffi (1.9.18) - flay (2.10.0) - erubis (~> 2.7.0) - path_expander (~> 1.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) + ffi (1.9.25) flipper (0.13.0) flipper-active_record (0.13.0) activerecord (>= 3.2, < 6) @@ -239,11 +233,11 @@ GEM builder excon (~> 0.58) formatador (~> 0.2) - fog-google (1.3.3) + fog-google (1.7.1) fog-core fog-json fog-xml - google-api-client (~> 0.19.1) + google-api-client (~> 0.23.0) fog-json (1.0.2) fog-core (~> 1.0) multi_json (~> 1.10) @@ -269,8 +263,6 @@ GEM fuubar (2.2.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) - gemnasium-gitlab-service (0.2.6) - rugged (~> 0.21) gemojione (3.3.0) json get_process_mem (0.2.0) @@ -284,7 +276,7 @@ GEM gettext_i18n_rails (>= 0.7.1) po_to_json (>= 1.0.0) rails (>= 3.2.0) - gitaly-proto (0.113.0) + gitaly-proto (0.117.0) google-protobuf (~> 3.1) grpc (~> 1.10) github-linguist (5.3.3) @@ -331,7 +323,7 @@ GEM actionpack (>= 3.0) multi_json request_store (>= 1.0) - google-api-client (0.19.8) + google-api-client (0.23.4) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.5, < 0.7.0) httpclient (>= 2.8.1, < 3.0) @@ -430,6 +422,8 @@ GEM multipart-post oauth (~> 0.5, >= 0.5.0) jquery-atwho-rails (1.3.2) + js_regex (2.2.1) + regexp_parser (>= 0.4.11, <= 0.5.0) json (1.8.6) json-jwt (1.9.4) activesupport @@ -465,13 +459,12 @@ GEM actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) - license_finder (3.1.1) + license_finder (5.4.0) bundler - httparty rubyzip thor - toml (= 0.1.2) - with_env (> 1.0) + toml (= 0.2.0) + with_env (= 1.1.0) xml-simple licensee (8.9.2) rugged (~> 0.24) @@ -494,7 +487,7 @@ GEM memoist (0.16.0) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) - method_source (0.8.2) + method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) @@ -589,9 +582,7 @@ GEM parallel (1.12.1) parser (2.5.1.0) ast (~> 2.4.0) - parslet (1.5.0) - blankslate (~> 2.0) - path_expander (1.0.2) + parslet (1.8.2) peek (1.0.1) concurrent-ruby (>= 0.9.0) concurrent-ruby-ext (>= 0.9.0) @@ -636,12 +627,11 @@ GEM unparser procto (0.0.3) prometheus-client-mmap (0.9.4) - pry (0.10.4) + pry (0.11.3) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.2) - byebug (~> 9.0) + method_source (~> 0.9.0) + pry-byebug (3.4.3) + byebug (>= 9.0, < 9.1) pry (~> 0.10) pry-rails (0.3.5) pry (>= 0.9.10) @@ -692,8 +682,7 @@ GEM activesupport (= 4.2.10) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rainbow (2.2.2) - rake + rainbow (3.0.0) raindrops (0.18.0) rake (12.3.1) rb-fsevent (0.10.2) @@ -730,6 +719,7 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.4.1) redis (>= 2.2, < 5) + regexp_parser (0.5.0) representable (3.0.4) declarative (< 0.1.0) declarative-option (< 0.2.0) @@ -742,7 +732,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - retriable (3.1.1) + retriable (3.1.2) rinku (2.0.0) rotp (2.1.2) rouge (3.2.1) @@ -780,6 +770,9 @@ GEM rspec-core rspec-set (0.1.3) rspec-support (3.7.1) + rspec_junit_formatter (0.2.3) + builder (< 4) + rspec-core (>= 2, < 4, != 2.12.0) rspec_profiling (0.0.5) activerecord pg @@ -808,7 +801,7 @@ GEM sexp_processor (~> 4.1) rubyntlm (0.6.2) rubypants (0.2.0) - rubyzip (1.2.1) + rubyzip (1.2.2) rufus-scheduler (3.4.0) et-orbi (~> 1.0) rugged (0.27.4) @@ -872,7 +865,6 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slack-notifier (1.5.1) - slop (3.6.0) spring (2.0.1) activesupport (>= 4.2) spring-commands-rspec (1.0.4) @@ -912,8 +904,8 @@ GEM tilt (2.0.8) timecop (0.8.1) timfel-krb5-auth (0.8.3) - toml (0.1.2) - parslet (~> 1.5.0) + toml (0.2.0) + parslet (~> 1.8.0) toml-rb (1.0.0) citrus (~> 3.0, > 3.0) trollop (2.1.3) @@ -999,12 +991,12 @@ DEPENDENCIES bootsnap (~> 1.3) bootstrap_form (~> 2.7.0) brakeman (~> 4.2) - browser (~> 2.2) + browser (~> 2.5) bullet (~> 5.5.0) bundler-audit (~> 0.5.0) capybara (~> 2.15) capybara-screenshot (~> 1.0.0) - carrierwave (~> 1.2) + carrierwave (= 1.2.3) charlock_holmes (~> 0.7.5) chronic (~> 0.10.2) chronic_duration (~> 0.10.6) @@ -1029,26 +1021,24 @@ DEPENDENCIES faraday (~> 0.12) fast_blank ffaker (~> 2.4) - flay (~> 2.10.0) flipper (~> 0.13.0) flipper-active_record (~> 0.13.0) flipper-active_support_cache_store (~> 0.13.0) fog-aliyun (~> 0.2.0) fog-aws (~> 2.0.1) fog-core (~> 1.44) - fog-google (~> 1.3.3) + fog-google (~> 1.7.1) fog-local (~> 0.3) fog-openstack (~> 0.1) fog-rackspace (~> 0.1.1) font-awesome-rails (~> 4.7) foreman (~> 0.84.0) fuubar (~> 2.2.0) - gemnasium-gitlab-service (~> 0.2) gemojione (~> 3.3) gettext (~> 3.2.2) gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails_js (~> 1.3) - gitaly-proto (~> 0.113.0) + gitaly-proto (~> 0.117.0) github-linguist (~> 5.3.3) gitlab-flowdock-git-hook (~> 1.0.1) gitlab-gollum-lib (~> 4.2) @@ -1057,7 +1047,7 @@ DEPENDENCIES gitlab-styles (~> 2.4) gitlab_omniauth-ldap (~> 2.0.4) gon (~> 6.2) - google-api-client (~> 0.19.8) + google-api-client (~> 0.23) google-protobuf (= 3.5.1) gpgme grape (~> 1.0) @@ -1080,13 +1070,14 @@ DEPENDENCIES influxdb (~> 0.2) jira-ruby (~> 1.4) jquery-atwho-rails (~> 1.3.2) + js_regex (~> 2.2.1) json-schema (~> 2.8.0) jwt (~> 1.5.6) kaminari (~> 1.0) knapsack (~> 1.16) kubeclient (~> 3.1.0) letter_opener_web (~> 1.3.0) - license_finder (~> 3.1) + license_finder (~> 5.4) licensee (~> 8.9) lograge (~> 0.5) loofah (~> 2.2) @@ -1136,7 +1127,7 @@ DEPENDENCIES rails (= 4.2.10) rails-deprecated_sanitizer (~> 1.0.3) rails-i18n (~> 4.0.9) - rainbow (~> 2.2) + rainbow (~> 3.0) raindrops (~> 0.18) rblineprof (~> 0.3.6) rbtrace (~> 0.4) @@ -1155,6 +1146,7 @@ DEPENDENCIES rspec-rails (~> 3.7.0) rspec-retry (~> 0.4.5) rspec-set (~> 0.1.3) + rspec_junit_formatter rspec_profiling (~> 0.0.5) rubocop (~> 0.54.0) rubocop-rspec (~> 1.22.1) @@ -1207,4 +1199,4 @@ DEPENDENCIES wikicloth (= 0.8.1) BUNDLED WITH - 1.16.2 + 1.16.4 diff --git a/Gemfile.rails5.lock b/Gemfile.rails5.lock index dff3a436a0..e1295e1ff9 100644 --- a/Gemfile.rails5.lock +++ b/Gemfile.rails5.lock @@ -89,12 +89,11 @@ GEM bindata (2.4.3) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - blankslate (2.1.2.4) bootsnap (1.3.1) msgpack (~> 1.0) bootstrap_form (2.7.0) brakeman (4.2.1) - browser (2.2.0) + browser (2.5.3) builder (3.2.3) bullet (5.5.1) activesupport (>= 3.0.0) @@ -126,7 +125,7 @@ GEM numerizer (~> 0.1.1) chunky_png (1.3.5) citrus (3.0.2) - coderay (1.1.1) + coderay (1.1.2) coercible (1.0.0) descendants_tracker (~> 0.0.1) commonmarker (0.17.8) @@ -212,12 +211,7 @@ GEM fast_blank (1.0.0) fast_gettext (1.6.0) ffaker (2.4.0) - ffi (1.9.18) - flay (2.10.0) - erubis (~> 2.7.0) - path_expander (~> 1.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) + ffi (1.9.25) flipper (0.13.0) flipper-active_record (0.13.0) activerecord (>= 3.2, < 6) @@ -242,11 +236,11 @@ GEM builder excon (~> 0.58) formatador (~> 0.2) - fog-google (1.3.3) + fog-google (1.7.1) fog-core fog-json fog-xml - google-api-client (~> 0.19.1) + google-api-client (~> 0.23.0) fog-json (1.0.2) fog-core (~> 1.0) multi_json (~> 1.10) @@ -272,8 +266,6 @@ GEM fuubar (2.2.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) - gemnasium-gitlab-service (0.2.6) - rugged (~> 0.21) gemojione (3.3.0) json get_process_mem (0.2.0) @@ -287,7 +279,7 @@ GEM gettext_i18n_rails (>= 0.7.1) po_to_json (>= 1.0.0) rails (>= 3.2.0) - gitaly-proto (0.113.0) + gitaly-proto (0.117.0) google-protobuf (~> 3.1) grpc (~> 1.10) github-linguist (5.3.3) @@ -334,7 +326,7 @@ GEM actionpack (>= 3.0) multi_json request_store (>= 1.0) - google-api-client (0.19.8) + google-api-client (0.23.4) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.5, < 0.7.0) httpclient (>= 2.8.1, < 3.0) @@ -433,6 +425,8 @@ GEM multipart-post oauth (~> 0.5, >= 0.5.0) jquery-atwho-rails (1.3.2) + js_regex (2.2.1) + regexp_parser (>= 0.4.11, <= 0.5.0) json (1.8.6) json-jwt (1.9.4) activesupport @@ -468,13 +462,12 @@ GEM actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) - license_finder (3.1.1) + license_finder (5.4.0) bundler - httparty rubyzip thor - toml (= 0.1.2) - with_env (> 1.0) + toml (= 0.2.0) + with_env (= 1.1.0) xml-simple licensee (8.9.2) rugged (~> 0.24) @@ -497,7 +490,7 @@ GEM memoist (0.16.0) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) - method_source (0.8.2) + method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) @@ -593,9 +586,7 @@ GEM parallel (1.12.1) parser (2.5.1.0) ast (~> 2.4.0) - parslet (1.5.0) - blankslate (~> 2.0) - path_expander (1.0.2) + parslet (1.8.2) peek (1.0.1) concurrent-ruby (>= 0.9.0) concurrent-ruby-ext (>= 0.9.0) @@ -640,12 +631,11 @@ GEM unparser procto (0.0.3) prometheus-client-mmap (0.9.4) - pry (0.10.4) + pry (0.11.3) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.2) - byebug (~> 9.0) + method_source (~> 0.9.0) + pry-byebug (3.4.3) + byebug (>= 9.0, < 9.1) pry (~> 0.10) pry-rails (0.3.5) pry (>= 0.9.10) @@ -701,8 +691,7 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rainbow (2.2.2) - rake + rainbow (3.0.0) raindrops (0.18.0) rake (12.3.1) rb-fsevent (0.10.2) @@ -739,6 +728,7 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.4.1) redis (>= 2.2, < 5) + regexp_parser (0.5.0) representable (3.0.4) declarative (< 0.1.0) declarative-option (< 0.2.0) @@ -751,10 +741,10 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - retriable (3.1.1) + retriable (3.1.2) rinku (2.0.0) rotp (2.1.2) - rouge (3.2.0) + rouge (3.2.1) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) @@ -789,6 +779,8 @@ GEM rspec-core rspec-set (0.1.3) rspec-support (3.7.1) + rspec_junit_formatter (0.4.1) + rspec-core (>= 2, < 4, != 2.12.0) rspec_profiling (0.0.5) activerecord pg @@ -817,10 +809,10 @@ GEM sexp_processor (~> 4.1) rubyntlm (0.6.2) rubypants (0.2.0) - rubyzip (1.2.1) + rubyzip (1.2.2) rufus-scheduler (3.4.0) et-orbi (~> 1.0) - rugged (0.27.2) + rugged (0.27.4) safe_yaml (1.0.4) sanitize (4.6.6) crass (~> 1.0.2) @@ -881,7 +873,6 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slack-notifier (1.5.1) - slop (3.6.0) spring (2.0.1) activesupport (>= 4.2) spring-commands-rspec (1.0.4) @@ -919,8 +910,8 @@ GEM tilt (2.0.8) timecop (0.8.1) timfel-krb5-auth (0.8.3) - toml (0.1.2) - parslet (~> 1.5.0) + toml (0.2.0) + parslet (~> 1.8.0) toml-rb (1.0.0) citrus (~> 3.0, > 3.0) trollop (2.1.3) @@ -1009,12 +1000,12 @@ DEPENDENCIES bootsnap (~> 1.3) bootstrap_form (~> 2.7.0) brakeman (~> 4.2) - browser (~> 2.2) + browser (~> 2.5) bullet (~> 5.5.0) bundler-audit (~> 0.5.0) capybara (~> 2.15) capybara-screenshot (~> 1.0.0) - carrierwave (~> 1.2) + carrierwave (= 1.2.3) charlock_holmes (~> 0.7.5) chronic (~> 0.10.2) chronic_duration (~> 0.10.6) @@ -1039,26 +1030,24 @@ DEPENDENCIES faraday (~> 0.12) fast_blank ffaker (~> 2.4) - flay (~> 2.10.0) flipper (~> 0.13.0) flipper-active_record (~> 0.13.0) flipper-active_support_cache_store (~> 0.13.0) fog-aliyun (~> 0.2.0) fog-aws (~> 2.0.1) fog-core (~> 1.44) - fog-google (~> 1.3.3) + fog-google (~> 1.7.1) fog-local (~> 0.3) fog-openstack (~> 0.1) fog-rackspace (~> 0.1.1) font-awesome-rails (~> 4.7) foreman (~> 0.84.0) fuubar (~> 2.2.0) - gemnasium-gitlab-service (~> 0.2) gemojione (~> 3.3) gettext (~> 3.2.2) gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails_js (~> 1.3) - gitaly-proto (~> 0.113.0) + gitaly-proto (~> 0.117.0) github-linguist (~> 5.3.3) gitlab-flowdock-git-hook (~> 1.0.1) gitlab-gollum-lib (~> 4.2) @@ -1067,7 +1056,7 @@ DEPENDENCIES gitlab-styles (~> 2.4) gitlab_omniauth-ldap (~> 2.0.4) gon (~> 6.2) - google-api-client (~> 0.19.8) + google-api-client (~> 0.23) google-protobuf (= 3.5.1) gpgme grape (~> 1.0) @@ -1090,13 +1079,14 @@ DEPENDENCIES influxdb (~> 0.2) jira-ruby (~> 1.4) jquery-atwho-rails (~> 1.3.2) + js_regex (~> 2.2.1) json-schema (~> 2.8.0) jwt (~> 1.5.6) kaminari (~> 1.0) knapsack (~> 1.16) kubeclient (~> 3.1.0) letter_opener_web (~> 1.3.0) - license_finder (~> 3.1) + license_finder (~> 5.4) licensee (~> 8.9) lograge (~> 0.5) loofah (~> 2.2) @@ -1147,7 +1137,7 @@ DEPENDENCIES rails-controller-testing rails-deprecated_sanitizer (~> 1.0.3) rails-i18n (~> 5.1) - rainbow (~> 2.2) + rainbow (~> 3.0) raindrops (~> 0.18) rblineprof (~> 0.3.6) rbtrace (~> 0.4) @@ -1166,6 +1156,7 @@ DEPENDENCIES rspec-rails (~> 3.7.0) rspec-retry (~> 0.4.5) rspec-set (~> 0.1.3) + rspec_junit_formatter rspec_profiling (~> 0.0.5) rubocop (~> 0.54.0) rubocop-rspec (~> 1.22.1) @@ -1217,4 +1208,4 @@ DEPENDENCIES wikicloth (= 0.8.1) BUNDLED WITH - 1.16.3 + 1.16.4 diff --git a/PROCESS.md b/PROCESS.md index a06ddb68b7..583f36b820 100644 --- a/PROCESS.md +++ b/PROCESS.md @@ -15,8 +15,9 @@ - [Between the 1st and the 7th](#between-the-1st-and-the-7th) - [On the 7th](#on-the-7th) - [After the 7th](#after-the-7th) -- [Regressions](#regressions) - - [How to manage a regression](#how-to-manage-a-regression) +- [Bugs](#bugs) + - [Regressions](#regressions) + - [Managing bugs](#managing-bugs) - [Release retrospective and kickoff](#release-retrospective-and-kickoff) - [Retrospective](#retrospective) - [Kickoff](#kickoff) @@ -115,6 +116,11 @@ target. However, if one does and falls into either of the above categories, it's the reviewer's responsibility to manage the above communication and assignment on behalf of the community member. +Every new feature or change should be shipped with its corresponding documentation +in accordance with the +[documentation process](https://docs.gitlab.com/ee/development/documentation/workflow.html) +and [structure](https://docs.gitlab.com/ee/development/documentation/structure.html). + #### What happens if these deadlines are missed? If a small or large feature is _not_ with a maintainer or reviewer by the @@ -140,14 +146,9 @@ and to prevent any last minute surprises. ### On the 7th -Merge requests should still be complete, following the -[definition of done][done]. The single exception is documentation, and this can -only be left until after the freeze if: +Merge requests should still be complete, following the [definition of done][done]. -* There is a follow-up issue to add documentation. -* It is assigned to the person writing documentation for this feature, and they - are aware of it. -* It is in the correct milestone, with the ~Deliverable label. +#### Feature merge requests If a merge request is not ready, but the developers and Product Manager responsible for the feature think it is essential that it is in the release, @@ -163,15 +164,32 @@ information, see [Automatic CE->EE merge][automatic_ce_ee_merge] and [Guidelines for implementing Enterprise Edition features][ee_features]. +#### Documentation merge requests + +Documentation is part of the product and must be shipped with the feature. + +The single exception for the feature freeze is documentation, and it can +be left to be **merged up to the 14th** if: + +* There is a follow-up issue to add documentation. +* It is assigned to the developer writing documentation for this feature, and they + are aware of it. +* It is in the correct milestone, with the labels ~Documentation, ~Deliverable, +~missed-deliverable, and "pick into X.Y" applied. +* It must be reviewed and approved by a technical writer. + +For more information read the process for +[documentation shipped late](https://docs.gitlab.com/ee/development/documentation/workflow.html#documentation-shipped-late). + ### After the 7th Once the stable branch is frozen, the only MRs that can be cherry-picked into the stable branch are: -* Fixes for [regressions](#regressions) +* Fixes for [regressions](#regressions) where the affected version `xx.x` in `regression:xx.x` is the current release. See [Managing bugs](#managing-bugs) section. * Fixes for security issues * Fixes or improvements to automated QA scenarios -* Documentation updates for changes in the same release +* [Documentation updates](https://docs.gitlab.com/ee/development/documentation/workflow.html#documentation-shipped-late) for changes in the same release * New or updated translations (as long as they do not touch application code) During the feature freeze all merge requests that are meant to go into the @@ -201,48 +219,59 @@ you can ask for an exception to be made. Check [this guide](https://gitlab.com/gitlab-org/release/docs/blob/master/general/exception-request/process.md) about how to open an exception request before opening one. -## Regressions +## Bugs -A regression for a particular monthly release is a bug that exists in that -release, but wasn't present in the release before. This includes bugs in -features that were only added in that monthly release. Every regression **must** -have the milestone of the release it was introduced in - if a regression doesn't -have a milestone, it might be 'just' a bug! +A ~bug is a defect, error, failure which causes the system to behave incorrectly or prevents it from fulfilling the product requirements. -For instance, if 10.5.0 adds a feature, and that feature doesn't work correctly, -then this is a regression in 10.5. If 10.5.1 then fixes that, but 10.5.3 somehow -reintroduces the bug, then this bug is still a regression in 10.5. +The level of impact of a ~bug can vary from blocking a whole functionality +or a feature usability bug. A bug should always be linked to a severity level. +Refer to our [severity levels](../CONTRIBUTING.md#severity-labels) -Because GitLab.com runs release candidates of new releases, a regression can be -reported in a release before its 'official' release date on the 22nd of the -month. When we say 'the most recent monthly release', this can refer to either -the version currently running on GitLab.com, or the most recent version -available in the package repositories. +Whether the bug is also a regression or not, the triage process should start as soon as possible. +Ensure that the Engineering Manager and/or the Product Manager for the relative area is involved to prioritize the work as needed. -### How to manage a regression +### Regressions -Regressions are very important, and they should be considered high priority -issues that should be solved as soon as possible, especially if they affect -users. Despite that, ~regression label itself does not imply when the issue -will be scheduled. +A ~regression implies that a previously **verified working functionality** no longer works. +Regressions are a subset of bugs. We use the ~regression label to imply that the defect caused the functionality to regress. +The label tells us that something worked before and it needs extra attention from Engineering and Product Managers to schedule/reschedule. -When a regression is found: -1. Create an issue describing the problem in the most detailed way possible -1. If possible, provide links to real examples and how to reproduce the problem +The regression label does not apply to ~bugs for new features for which functionality was **never verified as working**. +These, by definition, are not regressions. + +A regression should always have the `regression:xx.x` label on it to designate when it was introduced. + +Regressions should be considered high priority issues that should be solved as soon as possible, especially if they have severe impact on users. + +### Managing bugs + +**Prioritization:** We give higher priority to regressions on features that worked in the last recent monthly release and the current release candidates. +The two scenarios below can [bypass the exception request in the release process](https://gitlab.com/gitlab-org/release/docs/blob/master/general/exception-request/process.md#after-the-7th), where the affected regression version matches the current monthly release version. +* A regression which worked in the **Last monthly release** + * **Example:** In 11.0 we released a new `feature X` that is verified as working. Then in release 11.1 the feature no longer works, this is regression for 11.1. The issue should have the `regression:11.1` label. + * *Note:* When we say `the last recent monthly release`, this can refer to either the version currently running on GitLab.com, or the most recent version available in the package repositories. +* A regression which worked in the **Current release candidates** + * **Example:** In 11.1-RC3 we shipped a new feature which has been verified as working. Then in 11.1-RC5 the feature no longer works, this is regression for 11.1. The issue should have the `regression:11.1` label. + * *Note:* Because GitLab.com runs release candidates of new releases, a regression can be reported in a release before its 'official' release date on the 22nd of the month. + +When a bug is found: +1. Create an issue describing the problem in the most detailed way possible. +1. If possible, provide links to real examples and how to reproduce the problem. 1. Label the issue properly, using the [team label](../CONTRIBUTING.md#team-labels), the [subject label](../CONTRIBUTING.md#subject-labels) and any other label that may apply in the specific case -1. Add the ~bug and ~regression labels -1. Notify the respective Engineering Manager to evaluate the Severity of the regression and add a [Severity label](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#bug-severity-labels). The counterpart Product Manager is included to weigh-in on prioritization as needed to set the [Priority label](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#bug-priority-labels). -1. If the regression is either an ~S1, ~S2 or ~S3 severity, label the regression with the current milestone as it should be fixed in the current milestone. - 1. If the regression was introduced in an RC of the current release, label with ~Deliverable - 1. If the regression was introduced in the previous release, label with ~"Next Patch Release" -1. If the regression is an ~S4 severity, the regression may be scheduled for later milestones at the discretion of Engineering Manager and Product Manager. - -When a new issue is found, the fix should start as soon as possible. You can -ping the Engineering Manager or the Product Manager for the relative area to -make them aware of the issue earlier. They will analyze the priority and change -it if needed. +1. Notify the respective Engineering Manager to evaluate and apply the [Severity label](../CONTRIBUTING.md#bug-severity-labels) and [Priority label](../CONTRIBUTING.md#bug-priority-labels). +The counterpart Product Manager is included to weigh-in on prioritization as needed. +1. If the ~bug is **NOT** a regression: + 1. The Engineering Manager decides which milestone the bug will be fixed. The appropriate milestone is applied. +1. If the bug is a ~regression: + 1. Determine the release that the regression affects and add the corresponding `regression:xx.x` label. + 1. If the affected release version can't be determined, add the generic ~regression label for the time being. + 1. If the affected version `xx.x` in `regression:xx.x` is the **current release**, it's recommended to schedule the fix for the current milestone. + 1. This falls under regressions which worked in the last release and the current RCs. More detailed explanations in the **Prioritization** section above. + 1. If the affected version `xx.x` in `regression:xx.x` is older than the **current release** + 1. If the regression is an ~S1 severity, it's recommended to schedule the fix for the current milestone. We would like to fix the highest severity regression as soon as we can. + 1. If the regression is an ~S2, ~S3 or ~S4 severity, the regression may be scheduled for later milestones at the discretion of the Engineering Manager and Product Manager. ## Release retrospective and kickoff diff --git a/README.md b/README.md index b6e1cc9a43..335736e53f 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ You can access a new installation with the login **`root`** and password **`5ive ## Contributing -GitLab is an open source project and we are very happy to accept community contributions. Please refer to [CONTRIBUTING.md](/CONTRIBUTING.md) for details. +GitLab is an open source project and we are very happy to accept community contributions. Please refer to [Contributing to GitLab page](https://about.gitlab.com/contributing/) for more details. ## Licensing @@ -66,7 +66,7 @@ GitLab Community Edition (CE) is available freely under the MIT Expat license. All third party components incorporated into the GitLab Software are licensed under the original license provided by the owner of the applicable component. -All Documentation content that resides under the doc/ directory of this repository is licensed under Creative Commons: CC BY-SA 4.0. +All Documentation content that resides under the `doc/` directory of this repository is licensed under Creative Commons: CC BY-SA 4.0. ## Install a development environment diff --git a/VERSION b/VERSION index c52c4031ab..fa4d9ded4c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.2.8 +11.3.10 diff --git a/app/assets/images/auth_buttons/auth0_64.png b/app/assets/images/auth_buttons/auth0_64.png new file mode 100644 index 0000000000..5ad5965938 Binary files /dev/null and b/app/assets/images/auth_buttons/auth0_64.png differ diff --git a/app/assets/images/auth_buttons/azure_64.png b/app/assets/images/auth_buttons/azure_64.png index 85de779344..168a9c8139 100644 Binary files a/app/assets/images/auth_buttons/azure_64.png and b/app/assets/images/auth_buttons/azure_64.png differ diff --git a/app/assets/images/auth_buttons/bitbucket_64.png b/app/assets/images/auth_buttons/bitbucket_64.png index b3d022a5a7..0edf7f52a1 100644 Binary files a/app/assets/images/auth_buttons/bitbucket_64.png and b/app/assets/images/auth_buttons/bitbucket_64.png differ diff --git a/app/assets/images/auth_buttons/google_64.png b/app/assets/images/auth_buttons/google_64.png index 720824230a..389c1cd54c 100644 Binary files a/app/assets/images/auth_buttons/google_64.png and b/app/assets/images/auth_buttons/google_64.png differ diff --git a/app/assets/images/auth_buttons/jwt_64.png b/app/assets/images/auth_buttons/jwt_64.png new file mode 100644 index 0000000000..ca97ae4700 Binary files /dev/null and b/app/assets/images/auth_buttons/jwt_64.png differ diff --git a/app/assets/images/auth_buttons/shibboleth_64.png b/app/assets/images/auth_buttons/shibboleth_64.png new file mode 100644 index 0000000000..d4c752f940 Binary files /dev/null and b/app/assets/images/auth_buttons/shibboleth_64.png differ diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 25fe2ae553..cd800d75f7 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -15,6 +15,7 @@ const Api = { mergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes', mergeRequestVersionsPath: '/api/:version/projects/:id/merge_requests/:mrid/versions', groupLabelsPath: '/groups/:namespace_path/-/labels', + templatesPath: '/api/:version/templates/:key', licensePath: '/api/:version/templates/licenses/:key', gitignorePath: '/api/:version/templates/gitignores/:key', gitlabCiYmlPath: '/api/:version/templates/gitlab_ci_ymls/:key', @@ -265,6 +266,12 @@ const Api = { }); }, + templates(key, params = {}) { + const url = Api.buildUrl(this.templatesPath).replace(':key', key); + + return axios.get(url, { params }); + }, + buildUrl(url) { let urlRoot = ''; if (gon.relative_url_root != null) { diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index e34db89398..5b0c428533 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -109,8 +109,6 @@ export class AwardsHandler { } const $menu = $(`.${this.menuClass}`); - const $thumbsBtn = $menu.find('[data-name="thumbsup"], [data-name="thumbsdown"]').parent(); - const $userAuthored = this.isUserAuthored($addBtn); if ($menu.length) { if ($menu.is('.is-visible')) { $addBtn.removeClass('is-active'); @@ -134,9 +132,6 @@ export class AwardsHandler { }, 200); }); } - - $thumbsBtn.toggleClass('disabled', $userAuthored); - $thumbsBtn.prop('disabled', $userAuthored); } // Create the emoji menu with the first category of emojis. @@ -364,10 +359,6 @@ export class AwardsHandler { return $emojiButton.hasClass('active'); } - isUserAuthored($button) { - return $button.hasClass('js-user-authored'); - } - decrementCounter($emojiButton, emoji) { const counter = $('.js-counter', $emojiButton); const counterNumber = parseInt(counter.text(), 10); @@ -474,20 +465,16 @@ export class AwardsHandler { } postEmoji($emojiButton, awardUrl, emoji, callback) { - if (this.isUserAuthored($emojiButton)) { - this.userAuthored($emojiButton); - } else { - axios - .post(awardUrl, { - name: emoji, - }) - .then(({ data }) => { - if (data.ok) { - callback(); - } - }) - .catch(() => flash(__('Something went wrong on our end.'))); - } + axios + .post(awardUrl, { + name: emoji, + }) + .then(({ data }) => { + if (data.ok) { + callback(); + } + }) + .catch(() => flash(__('Something went wrong on our end.'))); } findEmojiIcon(votesBlock, emoji) { diff --git a/app/assets/javascripts/badges/components/badge_form.vue b/app/assets/javascripts/badges/components/badge_form.vue index 7a13f74c57..b3f25da87c 100644 --- a/app/assets/javascripts/badges/components/badge_form.vue +++ b/app/assets/javascripts/badges/components/badge_form.vue @@ -23,6 +23,11 @@ export default { required: true, }, }, + data() { + return { + wasValidated: false, + }; + }, computed: { ...mapState([ 'badgeInAddForm', @@ -39,16 +44,6 @@ export default { return this.badgeInAddForm; }, - canSubmit() { - return ( - this.badge !== null && - this.badge.imageUrl && - this.badge.imageUrl.trim() !== '' && - this.badge.linkUrl && - this.badge.linkUrl.trim() !== '' && - !this.isSaving - ); - }, helpText() { const placeholders = ['project_path', 'project_id', 'default_branch', 'commit_sha'] .map(placeholder => `%{${placeholder}}`) @@ -93,11 +88,18 @@ export default { }); }, }, - submitButtonLabel() { - if (this.isEditing) { - return s__('Badges|Save changes'); - } - return s__('Badges|Add badge'); + badgeImageUrlExample() { + const exampleUrl = + 'https://example.gitlab.com/%{project_path}/badges/%{default_branch}/badge.svg'; + return sprintf(s__('Badges|e.g. %{exampleUrl}'), { + exampleUrl, + }); + }, + badgeLinkUrlExample() { + const exampleUrl = 'https://example.gitlab.com/%{project_path}'; + return sprintf(s__('Badges|e.g. %{exampleUrl}'), { + exampleUrl, + }); }, }, methods: { @@ -109,7 +111,9 @@ export default { this.stopEditing(); }, onSubmit() { - if (!this.canSubmit) { + const form = this.$el; + if (!form.checkValidity()) { + this.wasValidated = true; return Promise.resolve(); } @@ -117,6 +121,7 @@ export default { return this.saveBadge() .then(() => { createFlash(s__('Badges|The badge was saved.'), 'notice'); + this.wasValidated = false; }) .catch(error => { createFlash( @@ -129,6 +134,7 @@ export default { return this.addBadge() .then(() => { createFlash(s__('Badges|A new badge was added.'), 'notice'); + this.wasValidated = false; }) .catch(error => { createFlash( @@ -138,47 +144,58 @@ export default { }); }, }, - badgeImageUrlPlaceholder: - 'https://example.gitlab.com/%{project_path}/badges/%{default_branch}/.svg', - badgeLinkUrlPlaceholder: 'https://example.gitlab.com/%{project_path}', }; diff --git a/app/assets/javascripts/badges/components/badge_list.vue b/app/assets/javascripts/badges/components/badge_list.vue index 268968b63b..d2ec0fbb2c 100644 --- a/app/assets/javascripts/badges/components/badge_list.vue +++ b/app/assets/javascripts/badges/components/badge_list.vue @@ -28,7 +28,7 @@ export default { {{ s__('Badges|Your badges') }} {{ badges.length }} - {{ badge.linkUrl }} -
- {{ badgeKindText }} + {{ badge.linkUrl }} +
+ {{ badgeKindText }}
- +import { mapActions } from 'vuex'; import $ from 'jquery'; -import { mapGetters } from 'vuex'; import DiffTableCell from './diff_table_cell.vue'; import { NEW_LINE_TYPE, @@ -10,8 +10,7 @@ import { OLD_NO_NEW_LINE_TYPE, PARALLEL_DIFF_VIEW_TYPE, NEW_NO_NEW_LINE_TYPE, - LINE_POSITION_LEFT, - LINE_POSITION_RIGHT, + EMPTY_CELL_TYPE, } from '../constants'; export default { @@ -36,16 +35,6 @@ export default { required: false, default: false, }, - leftDiscussions: { - type: Array, - required: false, - default: () => [], - }, - rightDiscussions: { - type: Array, - required: false, - default: () => [], - }, }, data() { return { @@ -54,32 +43,33 @@ export default { }; }, computed: { - ...mapGetters('diffs', ['isParallelView']), isContextLine() { - return this.line.left.type === CONTEXT_LINE_TYPE; + return this.line.left && this.line.left.type === CONTEXT_LINE_TYPE; }, classNameMap() { return { [CONTEXT_LINE_CLASS_NAME]: this.isContextLine, - [PARALLEL_DIFF_VIEW_TYPE]: this.isParallelView, + [PARALLEL_DIFF_VIEW_TYPE]: true, }; }, parallelViewLeftLineType() { - if (this.line.right.type === NEW_NO_NEW_LINE_TYPE) { + if (this.line.right && this.line.right.type === NEW_NO_NEW_LINE_TYPE) { return OLD_NO_NEW_LINE_TYPE; } - return this.line.left.type; + return this.line.left ? this.line.left.type : EMPTY_CELL_TYPE; }, }, created() { this.newLineType = NEW_LINE_TYPE; this.oldLineType = OLD_LINE_TYPE; - this.linePositionLeft = LINE_POSITION_LEFT; - this.linePositionRight = LINE_POSITION_RIGHT; this.parallelDiffViewType = PARALLEL_DIFF_VIEW_TYPE; }, + mounted() { + this.scrollToLineIfNeededParallel(this.line); + }, methods: { + ...mapActions('diffs', ['scrollToLineIfNeededParallel']), handleMouseMove(e) { const isHover = e.type === 'mouseover'; const hoveringCell = e.target.closest('td'); @@ -116,47 +106,57 @@ export default { @mouseover="handleMouseMove" @mouseout="handleMouseMove" > - - - - - - + + + + diff --git a/app/assets/javascripts/diffs/components/parallel_diff_view.vue b/app/assets/javascripts/diffs/components/parallel_diff_view.vue index 24ceb52a04..501bd4450d 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_view.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_view.vue @@ -2,8 +2,6 @@ import { mapState, mapGetters } from 'vuex'; import parallelDiffTableRow from './parallel_diff_table_row.vue'; import parallelDiffCommentRow from './parallel_diff_comment_row.vue'; -import { EMPTY_CELL_TYPE } from '../constants'; -import { trimFirstCharOfLineContent } from '../store/utils'; export default { components: { @@ -21,46 +19,17 @@ export default { }, }, computed: { - ...mapGetters('diffs', [ - 'commitId', - 'singleDiscussionByLineCode', - 'shouldRenderParallelCommentRow', - ]), + ...mapGetters('diffs', ['commitId', 'shouldRenderParallelCommentRow']), ...mapState({ diffLineCommentForms: state => state.diffs.diffLineCommentForms, }), - parallelDiffLines() { - return this.diffLines.map(line => { - const parallelLine = Object.assign({}, line); - - if (line.left) { - parallelLine.left = trimFirstCharOfLineContent(line.left); - } else { - parallelLine.left = { type: EMPTY_CELL_TYPE }; - } - - if (line.right) { - parallelLine.right = trimFirstCharOfLineContent(line.right); - } else { - parallelLine.right = { type: EMPTY_CELL_TYPE }; - } - - return parallelLine; - }); - }, diffLinesLength() { - return this.parallelDiffLines.length; + return this.diffLines.length; }, userColorScheme() { return window.gon.user_color_scheme; }, }, - methods: { - discussionsByLine(line, leftOrRight) { - return line[leftOrRight] && line[leftOrRight].lineCode !== undefined ? - this.singleDiscussionByLineCode(line[leftOrRight].lineCode) : []; - }, - }, }; @@ -73,7 +42,7 @@ export default { diff --git a/app/assets/javascripts/diffs/constants.js b/app/assets/javascripts/diffs/constants.js index 2fa8367f52..f68afa4483 100644 --- a/app/assets/javascripts/diffs/constants.js +++ b/app/assets/javascripts/diffs/constants.js @@ -25,3 +25,6 @@ export const CONTEXT_LINE_CLASS_NAME = 'diff-expanded'; export const UNFOLD_COUNT = 20; export const COUNT_OF_AVATARS_IN_GUTTER = 3; export const LENGTH_OF_AVATAR_TOOLTIP = 17; + +export const LINES_TO_BE_RENDERED_DIRECTLY = 100; +export const MAX_LINES_TO_BE_RENDERED = 2000; diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index 2700114225..e60bb9dd7e 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -2,7 +2,8 @@ import Vue from 'vue'; import axios from '~/lib/utils/axios_utils'; import Cookies from 'js-cookie'; import { handleLocationHash, historyPushState } from '~/lib/utils/common_utils'; -import { mergeUrlParams } from '~/lib/utils/url_utility'; +import { mergeUrlParams, getLocationHash } from '~/lib/utils/url_utility'; +import { getDiffPositionByLineCode } from './utils'; import * as types from './mutation_types'; import { PARALLEL_DIFF_VIEW_TYPE, @@ -29,6 +30,55 @@ export const fetchDiffFiles = ({ state, commit }) => { .then(handleLocationHash); }; +// This is adding line discussions to the actual lines in the diff tree +// once for parallel and once for inline mode +export const assignDiscussionsToDiff = ({ state, commit }, allLineDiscussions) => { + const diffPositionByLineCode = getDiffPositionByLineCode(state.diffFiles); + + Object.values(allLineDiscussions).forEach(discussions => { + if (discussions.length > 0) { + const { fileHash } = discussions[0]; + commit(types.SET_LINE_DISCUSSIONS_FOR_FILE, { + fileHash, + discussions, + diffPositionByLineCode, + }); + } + }); +}; + +export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => { + const { fileHash, line_code } = removeDiscussion; + commit(types.REMOVE_LINE_DISCUSSIONS_FOR_FILE, { fileHash, lineCode: line_code }); +}; + +export const startRenderDiffsQueue = ({ state, commit }) => { + const checkItem = () => + new Promise(resolve => { + const nextFile = state.diffFiles.find( + file => !file.renderIt && (!file.collapsed || !file.text), + ); + + if (nextFile) { + requestAnimationFrame(() => { + commit(types.RENDER_FILE, nextFile); + }); + requestIdleCallback( + () => { + checkItem() + .then(resolve) + .catch(() => {}); + }, + { timeout: 1000 }, + ); + } else { + resolve(); + } + }); + + return checkItem(); +}; + export const setInlineDiffViewType = ({ commit }) => { commit(types.SET_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE); @@ -70,6 +120,25 @@ export const loadMoreLines = ({ commit }, options) => { }); }; +export const scrollToLineIfNeededInline = (_, line) => { + const hash = getLocationHash(); + + if (hash && line.lineCode === hash) { + handleLocationHash(); + } +}; + +export const scrollToLineIfNeededParallel = (_, line) => { + const hash = getLocationHash(); + + if ( + hash && + ((line.left && line.left.lineCode === hash) || (line.right && line.right.lineCode === hash)) + ) { + handleLocationHash(); + } +}; + export const loadCollapsedDiff = ({ commit }, file) => axios.get(file.loadCollapsedDiffUrl).then(res => { commit(types.ADD_COLLAPSED_DIFFS, { diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index 4a47646d7f..968ba3c5e1 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -17,7 +17,10 @@ export const commitId = state => (state.commit && state.commit.id ? state.commit export const diffHasAllExpandedDiscussions = (state, getters) => diff => { const discussions = getters.getDiffFileDiscussions(diff); - return (discussions.length && discussions.every(discussion => discussion.expanded)) || false; + return ( + (discussions && discussions.length && discussions.every(discussion => discussion.expanded)) || + false + ); }; /** @@ -28,7 +31,10 @@ export const diffHasAllExpandedDiscussions = (state, getters) => diff => { export const diffHasAllCollpasedDiscussions = (state, getters) => diff => { const discussions = getters.getDiffFileDiscussions(diff); - return (discussions.length && discussions.every(discussion => !discussion.expanded)) || false; + return ( + (discussions && discussions.length && discussions.every(discussion => !discussion.expanded)) || + false + ); }; /** @@ -40,7 +46,9 @@ export const diffHasExpandedDiscussions = (state, getters) => diff => { const discussions = getters.getDiffFileDiscussions(diff); return ( - (discussions.length && discussions.find(discussion => discussion.expanded) !== undefined) || + (discussions && + discussions.length && + discussions.find(discussion => discussion.expanded) !== undefined) || false ); }; @@ -64,45 +72,38 @@ export const getDiffFileDiscussions = (state, getters, rootState, rootGetters) = discussion.diff_discussion && _.isEqual(discussion.diff_file.file_hash, diff.fileHash), ) || []; -export const singleDiscussionByLineCode = (state, getters, rootState, rootGetters) => lineCode => { - if (!lineCode || lineCode === undefined) return []; - const discussions = rootGetters.discussionsByLineCode; - return discussions[lineCode] || []; -}; +export const shouldRenderParallelCommentRow = state => line => { + const hasDiscussion = + (line.left && line.left.discussions && line.left.discussions.length) || + (line.right && line.right.discussions && line.right.discussions.length); -export const shouldRenderParallelCommentRow = (state, getters) => line => { - const leftLineCode = line.left.lineCode; - const rightLineCode = line.right.lineCode; - const leftDiscussions = getters.singleDiscussionByLineCode(leftLineCode); - const rightDiscussions = getters.singleDiscussionByLineCode(rightLineCode); - const hasDiscussion = leftDiscussions.length || rightDiscussions.length; - - const hasExpandedDiscussionOnLeft = leftDiscussions.length - ? leftDiscussions.every(discussion => discussion.expanded) - : false; - const hasExpandedDiscussionOnRight = rightDiscussions.length - ? rightDiscussions.every(discussion => discussion.expanded) - : false; + const hasExpandedDiscussionOnLeft = + line.left && line.left.discussions && line.left.discussions.length + ? line.left.discussions.every(discussion => discussion.expanded) + : false; + const hasExpandedDiscussionOnRight = + line.right && line.right.discussions && line.right.discussions.length + ? line.right.discussions.every(discussion => discussion.expanded) + : false; if (hasDiscussion && (hasExpandedDiscussionOnLeft || hasExpandedDiscussionOnRight)) { return true; } - const hasCommentFormOnLeft = state.diffLineCommentForms[leftLineCode]; - const hasCommentFormOnRight = state.diffLineCommentForms[rightLineCode]; + const hasCommentFormOnLeft = line.left && state.diffLineCommentForms[line.left.lineCode]; + const hasCommentFormOnRight = line.right && state.diffLineCommentForms[line.right.lineCode]; return hasCommentFormOnLeft || hasCommentFormOnRight; }; -export const shouldRenderInlineCommentRow = (state, getters) => line => { +export const shouldRenderInlineCommentRow = state => line => { if (state.diffLineCommentForms[line.lineCode]) return true; - const lineDiscussions = getters.singleDiscussionByLineCode(line.lineCode); - if (lineDiscussions.length === 0) { + if (!line.discussions || line.discussions.length === 0) { return false; } - return lineDiscussions.every(discussion => discussion.expanded); + return line.discussions.every(discussion => discussion.expanded); }; // prevent babel-plugin-rewire from generating an invalid default during karma∂ tests diff --git a/app/assets/javascripts/diffs/store/mutation_types.js b/app/assets/javascripts/diffs/store/mutation_types.js index 2c8e1a1466..f61efbe6e1 100644 --- a/app/assets/javascripts/diffs/store/mutation_types.js +++ b/app/assets/javascripts/diffs/store/mutation_types.js @@ -8,3 +8,6 @@ export const REMOVE_COMMENT_FORM_LINE = 'REMOVE_COMMENT_FORM_LINE'; export const ADD_CONTEXT_LINES = 'ADD_CONTEXT_LINES'; export const ADD_COLLAPSED_DIFFS = 'ADD_COLLAPSED_DIFFS'; export const EXPAND_ALL_FILES = 'EXPAND_ALL_FILES'; +export const RENDER_FILE = 'RENDER_FILE'; +export const SET_LINE_DISCUSSIONS_FOR_FILE = 'SET_LINE_DISCUSSIONS_FOR_FILE'; +export const REMOVE_LINE_DISCUSSIONS_FOR_FILE = 'REMOVE_LINE_DISCUSSIONS_FOR_FILE'; diff --git a/app/assets/javascripts/diffs/store/mutations.js b/app/assets/javascripts/diffs/store/mutations.js index a98b2be89a..6dc5bf16c6 100644 --- a/app/assets/javascripts/diffs/store/mutations.js +++ b/app/assets/javascripts/diffs/store/mutations.js @@ -1,7 +1,13 @@ import Vue from 'vue'; -import _ from 'underscore'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; -import { findDiffFile, addLineReferences, removeMatchLine, addContextLines } from './utils'; +import { + findDiffFile, + addLineReferences, + removeMatchLine, + addContextLines, + prepareDiffData, + isDiscussionApplicableToLine, +} from './utils'; import * as types from './mutation_types'; export default { @@ -15,8 +21,17 @@ export default { }, [types.SET_DIFF_DATA](state, data) { + const diffData = convertObjectPropsToCamelCase(data, { deep: true }); + prepareDiffData(diffData); + Object.assign(state, { - ...convertObjectPropsToCamelCase(data, { deep: true }), + ...diffData, + }); + }, + + [types.RENDER_FILE](state, file) { + Object.assign(file, { + renderIt: true, }); }, @@ -57,19 +72,93 @@ export default { [types.ADD_COLLAPSED_DIFFS](state, { file, data }) { const normalizedData = convertObjectPropsToCamelCase(data, { deep: true }); + prepareDiffData(normalizedData); const [newFileData] = normalizedData.diffFiles.filter(f => f.fileHash === file.fileHash); - - if (newFileData) { - const index = _.findIndex(state.diffFiles, f => f.fileHash === file.fileHash); - state.diffFiles.splice(index, 1, newFileData); - } + const selectedFile = state.diffFiles.find(f => f.fileHash === file.fileHash); + Object.assign(selectedFile, { ...newFileData }); }, [types.EXPAND_ALL_FILES](state) { - // eslint-disable-next-line no-param-reassign state.diffFiles = state.diffFiles.map(file => ({ ...file, collapsed: false, })); }, + + [types.SET_LINE_DISCUSSIONS_FOR_FILE](state, { fileHash, discussions, diffPositionByLineCode }) { + const selectedFile = state.diffFiles.find(f => f.fileHash === fileHash); + const firstDiscussion = discussions[0]; + const isDiffDiscussion = firstDiscussion.diff_discussion; + const hasLineCode = firstDiscussion.line_code; + const isResolvable = firstDiscussion.resolvable; + const diffPosition = diffPositionByLineCode[firstDiscussion.line_code]; + + if ( + selectedFile && + isDiffDiscussion && + hasLineCode && + isResolvable && + diffPosition && + isDiscussionApplicableToLine(firstDiscussion, diffPosition) + ) { + const targetLine = selectedFile.parallelDiffLines.find( + line => + (line.left && line.left.lineCode === firstDiscussion.line_code) || + (line.right && line.right.lineCode === firstDiscussion.line_code), + ); + if (targetLine) { + if (targetLine.left && targetLine.left.lineCode === firstDiscussion.line_code) { + Object.assign(targetLine.left, { + discussions, + }); + } else { + Object.assign(targetLine.right, { + discussions, + }); + } + } + + if (selectedFile.highlightedDiffLines) { + const targetInlineLine = selectedFile.highlightedDiffLines.find( + line => line.lineCode === firstDiscussion.line_code, + ); + + if (targetInlineLine) { + Object.assign(targetInlineLine, { + discussions, + }); + } + } + } + }, + + [types.REMOVE_LINE_DISCUSSIONS_FOR_FILE](state, { fileHash, lineCode }) { + const selectedFile = state.diffFiles.find(f => f.fileHash === fileHash); + if (selectedFile) { + const targetLine = selectedFile.parallelDiffLines.find( + line => + (line.left && line.left.lineCode === lineCode) || + (line.right && line.right.lineCode === lineCode), + ); + if (targetLine) { + const side = targetLine.left && targetLine.left.lineCode === lineCode ? 'left' : 'right'; + + Object.assign(targetLine[side], { + discussions: [], + }); + } + + if (selectedFile.highlightedDiffLines) { + const targetInlineLine = selectedFile.highlightedDiffLines.find( + line => line.lineCode === lineCode, + ); + + if (targetInlineLine) { + Object.assign(targetInlineLine, { + discussions: [], + }); + } + } + } + }, }; diff --git a/app/assets/javascripts/diffs/store/utils.js b/app/assets/javascripts/diffs/store/utils.js index 82082ac508..186b5ef950 100644 --- a/app/assets/javascripts/diffs/store/utils.js +++ b/app/assets/javascripts/diffs/store/utils.js @@ -8,6 +8,8 @@ import { NEW_LINE_TYPE, OLD_LINE_TYPE, MATCH_LINE_TYPE, + LINES_TO_BE_RENDERED_DIRECTLY, + MAX_LINES_TO_BE_RENDERED, } from '../constants'; export function findDiffFile(files, hash) { @@ -161,6 +163,11 @@ export function addContextLines(options) { * @returns {Object} */ export function trimFirstCharOfLineContent(line = {}) { + // eslint-disable-next-line no-param-reassign + delete line.text; + // eslint-disable-next-line no-param-reassign + line.discussions = []; + const parsedLine = Object.assign({}, line); if (line.richText) { @@ -174,7 +181,44 @@ export function trimFirstCharOfLineContent(line = {}) { return parsedLine; } -export function getDiffRefsByLineCode(diffFiles) { +// This prepares and optimizes the incoming diff data from the server +// by setting up incremental rendering and removing unneeded data +export function prepareDiffData(diffData) { + const filesLength = diffData.diffFiles.length; + let showingLines = 0; + for (let i = 0; i < filesLength; i += 1) { + const file = diffData.diffFiles[i]; + + if (file.parallelDiffLines) { + const linesLength = file.parallelDiffLines.length; + for (let u = 0; u < linesLength; u += 1) { + const line = file.parallelDiffLines[u]; + if (line.left) { + line.left = trimFirstCharOfLineContent(line.left); + } + if (line.right) { + line.right = trimFirstCharOfLineContent(line.right); + } + } + } + + if (file.highlightedDiffLines) { + const linesLength = file.highlightedDiffLines.length; + for (let u = 0; u < linesLength; u += 1) { + const line = file.highlightedDiffLines[u]; + Object.assign(line, { ...trimFirstCharOfLineContent(line) }); + } + showingLines += file.parallelDiffLines.length; + } + + Object.assign(file, { + renderIt: showingLines < LINES_TO_BE_RENDERED_DIRECTLY, + collapsed: file.text && showingLines > MAX_LINES_TO_BE_RENDERED, + }); + } +} + +export function getDiffPositionByLineCode(diffFiles) { return diffFiles.reduce((acc, diffFile) => { const { baseSha, headSha, startSha } = diffFile.diffRefs; const { newPath, oldPath } = diffFile; @@ -186,7 +230,7 @@ export function getDiffRefsByLineCode(diffFiles) { const { lineCode, oldLine, newLine } = line; if (lineCode) { - acc[lineCode] = { baseSha, headSha, startSha, newPath, oldPath, oldLine, newLine }; + acc[lineCode] = { baseSha, headSha, startSha, newPath, oldPath, oldLine, newLine, positionType: 'text' }; } }); } @@ -194,3 +238,12 @@ export function getDiffRefsByLineCode(diffFiles) { return acc; }, {}); } + +// This method will check whether the discussion is still applicable +// to the diff line in question regarding different versions of the MR +export function isDiscussionApplicableToLine(discussion, diffPosition) { + const originalRefs = convertObjectPropsToCamelCase(discussion.original_position); + const refs = convertObjectPropsToCamelCase(discussion.position); + + return _.isEqual(refs, diffPosition) || _.isEqual(originalRefs, diffPosition); +} diff --git a/app/assets/javascripts/clusters/components/gcp_signup_offer.js b/app/assets/javascripts/dismissable_callout.js similarity index 83% rename from app/assets/javascripts/clusters/components/gcp_signup_offer.js rename to app/assets/javascripts/dismissable_callout.js index 8bc20a1c09..5185b01937 100644 --- a/app/assets/javascripts/clusters/components/gcp_signup_offer.js +++ b/app/assets/javascripts/dismissable_callout.js @@ -3,8 +3,8 @@ import axios from '~/lib/utils/axios_utils'; import { __ } from '~/locale'; import Flash from '~/flash'; -export default function gcpSignupOffer() { - const alertEl = document.querySelector('.gcp-signup-offer'); +export default function initDismissableCallout(alertSelector) { + const alertEl = document.querySelector(alertSelector); if (!alertEl) { return; } diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 5528ad9f38..ff969bb94a 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -7,6 +7,19 @@ import axios from './lib/utils/axios_utils'; Dropzone.autoDiscover = false; +/** + * Return the error message string from the given response. + * + * @param {String|Object} res + */ +function getErrorMessage(res) { + if (!res || _.isString(res)) { + return res; + } + + return res.message; +} + export default function dropzoneInput(form) { const divHover = '
'; const iconPaperclip = ''; @@ -18,7 +31,7 @@ export default function dropzoneInput(form) { const $uploadingErrorContainer = form.find('.uploading-error-container'); const $uploadingErrorMessage = form.find('.uploading-error-message'); const $uploadingProgressContainer = form.find('.uploading-progress-container'); - const uploadsPath = window.uploads_path || null; + const uploadsPath = form.data('uploads-path') || window.uploads_path || null; const maxFileSize = gon.max_file_size || 10; const formTextarea = form.find('.js-gfm-input'); let handlePaste; @@ -42,7 +55,7 @@ export default function dropzoneInput(form) { if (!uploadsPath) { $formDropzone.addClass('js-invalid-dropzone'); - return; + return null; } const dropzone = $formDropzone.dropzone({ @@ -84,9 +97,7 @@ export default function dropzoneInput(form) { // xhr object (xhr.responseText is error message). // On error we hide the 'Attach' and 'Cancel' buttons // and show an error. - - // If there's xhr error message, let's show it instead of dropzone's one. - const message = xhr ? xhr.responseText : errorMessage; + const message = getErrorMessage(errorMessage || xhr.responseText); $uploadingErrorContainer.removeClass('hide'); $uploadingErrorMessage.html(message); @@ -274,4 +285,6 @@ export default function dropzoneInput(form) { $(this).closest('.gfm-form').find('.div-dropzone').click(); formTextarea.focus(); }); + + return Dropzone.forElement($formDropzone.get(0)); } diff --git a/app/assets/javascripts/emoji/support/unicode_support_map.js b/app/assets/javascripts/emoji/support/unicode_support_map.js index 8c1861c56d..651169391f 100644 --- a/app/assets/javascripts/emoji/support/unicode_support_map.js +++ b/app/assets/javascripts/emoji/support/unicode_support_map.js @@ -86,7 +86,7 @@ function generateUnicodeSupportMap(testMap) { canvas.height = numTestEntries * fontSize; ctx.fillStyle = '#000000'; ctx.textBaseline = 'middle'; - ctx.font = `${fontSize}px "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`; + ctx.font = `${fontSize}px "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`; // Write each emoji to the canvas vertically let writeIndex = 0; testMapKeys.forEach(testKey => { diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js index a0af2875ab..a29de9ae89 100644 --- a/app/assets/javascripts/flash.js +++ b/app/assets/javascripts/flash.js @@ -10,6 +10,7 @@ const hideFlash = (flashEl, fadeTransition = true) => { flashEl.addEventListener('transitionend', () => { flashEl.remove(); + window.dispatchEvent(new Event('resize')); if (document.body.classList.contains('flash-shown')) document.body.classList.remove('flash-shown'); }, { once: true, diff --git a/app/assets/javascripts/fly_out_nav.js b/app/assets/javascripts/fly_out_nav.js index 8b4f3b05ee..f820f0dc3f 100644 --- a/app/assets/javascripts/fly_out_nav.js +++ b/app/assets/javascripts/fly_out_nav.js @@ -65,8 +65,8 @@ export const hideMenu = (el) => { const parentEl = el.parentNode; - el.style.display = ''; // eslint-disable-line no-param-reassign - el.style.transform = ''; // eslint-disable-line no-param-reassign + el.style.display = ''; + el.style.transform = ''; el.classList.remove(IS_ABOVE_CLASS); parentEl.classList.remove(IS_OVER_CLASS); parentEl.classList.remove(IS_SHOWING_FLY_OUT_CLASS); diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 03256ca228..a0454354fd 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -149,10 +149,16 @@ class GfmAutoComplete { // Team Members $input.atwho({ at: '@', + alias: 'users', displayTpl(value) { let tmpl = GfmAutoComplete.Loading.template; - if (value.username != null) { - tmpl = GfmAutoComplete.Members.template; + const { avatarTag, username, title } = value; + if (username != null) { + tmpl = GfmAutoComplete.Members.templateFunction({ + avatarTag, + username, + title, + }); } return tmpl; }, @@ -512,8 +518,9 @@ GfmAutoComplete.Emoji = { }; // Team Members GfmAutoComplete.Members = { - // eslint-disable-next-line no-template-curly-in-string - template: '
  • ${avatarTag} ${username} ${title}
  • ', + templateFunction({ avatarTag, username, title }) { + return `
  • ${avatarTag} ${username} ${_.escape(title)}
  • `; + }, }; GfmAutoComplete.Labels = { // eslint-disable-next-line no-template-curly-in-string diff --git a/app/assets/javascripts/groups/components/app.vue b/app/assets/javascripts/groups/components/app.vue index b0765747a3..69f192ac75 100644 --- a/app/assets/javascripts/groups/components/app.vue +++ b/app/assets/javascripts/groups/components/app.vue @@ -2,14 +2,15 @@ /* global Flash */ import $ from 'jquery'; -import { s__ } from '~/locale'; +import { s__, sprintf } from '~/locale'; import loadingIcon from '~/vue_shared/components/loading_icon.vue'; import DeprecatedModal from '~/vue_shared/components/deprecated_modal.vue'; +import { HIDDEN_CLASS } from '~/lib/utils/constants'; import { getParameterByName } from '~/lib/utils/common_utils'; import { mergeUrlParams } from '~/lib/utils/url_utility'; import eventHub from '../event_hub'; -import { COMMON_STR } from '../constants'; +import { COMMON_STR, CONTENT_LIST_CLASS } from '../constants'; import groupsComponent from './groups.vue'; export default { @@ -19,6 +20,16 @@ export default { groupsComponent, }, props: { + action: { + type: String, + required: false, + default: '', + }, + containerId: { + type: String, + required: false, + default: '', + }, store: { type: Object, required: true, @@ -56,31 +67,28 @@ export default { ? COMMON_STR.GROUP_SEARCH_EMPTY : COMMON_STR.GROUP_PROJECT_SEARCH_EMPTY; - eventHub.$on('fetchPage', this.fetchPage); - eventHub.$on('toggleChildren', this.toggleChildren); - eventHub.$on('showLeaveGroupModal', this.showLeaveGroupModal); - eventHub.$on('updatePagination', this.updatePagination); - eventHub.$on('updateGroups', this.updateGroups); + eventHub.$on(`${this.action}fetchPage`, this.fetchPage); + eventHub.$on(`${this.action}toggleChildren`, this.toggleChildren); + eventHub.$on(`${this.action}showLeaveGroupModal`, this.showLeaveGroupModal); + eventHub.$on(`${this.action}updatePagination`, this.updatePagination); + eventHub.$on(`${this.action}updateGroups`, this.updateGroups); }, mounted() { this.fetchAllGroups(); + + if (this.containerId) { + this.containerEl = document.getElementById(this.containerId); + } }, beforeDestroy() { - eventHub.$off('fetchPage', this.fetchPage); - eventHub.$off('toggleChildren', this.toggleChildren); - eventHub.$off('showLeaveGroupModal', this.showLeaveGroupModal); - eventHub.$off('updatePagination', this.updatePagination); - eventHub.$off('updateGroups', this.updateGroups); + eventHub.$off(`${this.action}fetchPage`, this.fetchPage); + eventHub.$off(`${this.action}toggleChildren`, this.toggleChildren); + eventHub.$off(`${this.action}showLeaveGroupModal`, this.showLeaveGroupModal); + eventHub.$off(`${this.action}updatePagination`, this.updatePagination); + eventHub.$off(`${this.action}updateGroups`, this.updateGroups); }, methods: { - fetchGroups({ - parentId, - page, - filterGroupsBy, - sortBy, - archived, - updatePagination, - }) { + fetchGroups({ parentId, page, filterGroupsBy, sortBy, archived, updatePagination }) { return this.service .getGroups(parentId, page, filterGroupsBy, sortBy, archived) .then(res => { @@ -165,13 +173,13 @@ export default { } }, showLeaveGroupModal(group, parentGroup) { + const { fullName } = group; this.targetGroup = group; this.targetParentGroup = parentGroup; this.showModal = true; - this.groupLeaveConfirmationMessage = s__( - `GroupsTree|Are you sure you want to leave the "${ - group.fullName - }" group?`, + this.groupLeaveConfirmationMessage = sprintf( + s__('GroupsTree|Are you sure you want to leave the "%{fullName}" group?'), + { fullName }, ); }, hideLeaveGroupModal() { @@ -197,16 +205,35 @@ export default { this.targetGroup.isBeingRemoved = false; }); }, + showEmptyState() { + const { containerEl } = this; + const contentListEl = containerEl.querySelector(CONTENT_LIST_CLASS); + const emptyStateEl = containerEl.querySelector('.empty-state'); + + if (contentListEl) { + contentListEl.remove(); + } + + if (emptyStateEl) { + emptyStateEl.classList.remove(HIDDEN_CLASS); + } + }, updatePagination(headers) { this.store.setPaginationInfo(headers); }, updateGroups(groups, fromSearch) { - this.isSearchEmpty = groups ? groups.length === 0 : false; + const hasGroups = groups && groups.length > 0; + this.isSearchEmpty = !hasGroups; + if (fromSearch) { this.store.setSearchedGroups(groups); } else { this.store.setGroups(groups); } + + if (this.action && !hasGroups && !fromSearch) { + this.showEmptyState(); + } }, }, }; @@ -226,6 +253,7 @@ export default { :search-empty="isSearchEmpty" :search-empty-message="searchEmptyMessage" :page-info="pageInfo" + :action="action" /> ([]), + default: '', }, }, computed: { @@ -37,6 +41,7 @@ export default { :key="index" :group="group" :parent-group="parentGroup" + :action="action" />
  • diff --git a/app/assets/javascripts/groups/components/groups.vue b/app/assets/javascripts/groups/components/groups.vue index adde8c8cdb..a1beb22295 100644 --- a/app/assets/javascripts/groups/components/groups.vue +++ b/app/assets/javascripts/groups/components/groups.vue @@ -1,43 +1,48 @@ diff --git a/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue b/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue index 391004dcd3..10c78a8030 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue @@ -2,6 +2,7 @@ import { mapActions } from 'vuex'; import tooltip from '~/vue_shared/directives/tooltip'; import Icon from '~/vue_shared/components/icon.vue'; +import FileIcon from '~/vue_shared/components/file_icon.vue'; import StageButton from './stage_button.vue'; import UnstageButton from './unstage_button.vue'; import { viewerTypes } from '../../constants'; @@ -12,6 +13,7 @@ export default { Icon, StageButton, UnstageButton, + FileIcon, }, directives: { tooltip, @@ -48,7 +50,7 @@ export default { return `${getCommitIconMap(this.file).icon}${suffix}`; }, iconClass() { - return `${getCommitIconMap(this.file).class} append-right-8`; + return `${getCommitIconMap(this.file).class} ml-auto mr-auto`; }, fullKey() { return `${this.keyPrefix}-${this.file.key}`; @@ -105,17 +107,24 @@ export default { @click="openFileInEditor" > - {{ file.name }} +
    +
    + +
    + +
    - diff --git a/app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue b/app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue index e6044401c9..8a1836a5c9 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue @@ -1,11 +1,15 @@ @@ -25,51 +43,50 @@ export default { diff --git a/app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue b/app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue index 9cec73ec00..86c4060207 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue @@ -25,22 +25,23 @@ export default {