diff --git a/.rubocop.yml b/.rubocop.yml index 7a4b53b5aa5..a4a74aa4100 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,8 +7,10 @@ require: - rubocop-rspec inherit_from: - - .rubocop_manual_todo.yml - - .rubocop_todo.yml + <% unless ENV['REVEAL_RUBOCOP_TODO'] == '1' %> + - '.rubocop_manual_todo.yml' + - '.rubocop_todo.yml' + <% end %> - ./rubocop/rubocop-migrations.yml - ./rubocop/rubocop-usage-data.yml - ./rubocop/rubocop-code_reuse.yml diff --git a/app/assets/javascripts/profile/profile.js b/app/assets/javascripts/profile/profile.js index a7332b81b9f..dad2c18fb18 100644 --- a/app/assets/javascripts/profile/profile.js +++ b/app/assets/javascripts/profile/profile.js @@ -95,6 +95,7 @@ export default class Profile { updateHeaderAvatar() { $('.header-user-avatar').attr('src', this.avatarGlCrop.dataURL); + $('.js-sidebar-user-avatar').attr('src', this.avatarGlCrop.dataURL); } setRepoRadio() { diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml index a66110f28e8..4ae81d69c16 100644 --- a/app/views/layouts/nav/sidebar/_profile.html.haml +++ b/app/views/layouts/nav/sidebar/_profile.html.haml @@ -3,7 +3,7 @@ .context-header = link_to profile_path, title: _('Profile Settings') do .avatar-container.s40.settings-avatar - = image_tag avatar_icon_for_user(current_user, 40), class: "avatar s40 avatar-tile", alt: current_user.name + = image_tag avatar_icon_for_user(current_user, 40), class: "avatar s40 avatar-tile js-sidebar-user-avatar", alt: current_user.name, data: { testid: 'sidebar-user-avatar' } .sidebar-context-title= _('User Settings') %ul.sidebar-top-level-items = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do diff --git a/changelogs/unreleased/sidebar-user-avatar.yml b/changelogs/unreleased/sidebar-user-avatar.yml new file mode 100644 index 00000000000..ea5aa910a46 --- /dev/null +++ b/changelogs/unreleased/sidebar-user-avatar.yml @@ -0,0 +1,5 @@ +--- +title: Update user avatar in sidebar realtime +merge_request: 54135 +author: Yogi (@yo) +type: changed diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index 76037d9aa86..88d1d2555f1 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -57,6 +57,7 @@ backtracing badging Bamboo Bazel +Bhyve Bitbucket blockquote blockquoted @@ -90,6 +91,7 @@ Certbot changeset changesets chai +ChaosKube chatbot chatbots ChatOps @@ -125,6 +127,8 @@ CrowdIn CSV cybersecurity Dangerfile +datasource +datasources datetime Debian Decompressor @@ -410,6 +414,7 @@ Poedit polyfill polyfills pooler +postfixed postgres.ai PostgreSQL precompile @@ -550,6 +555,7 @@ Sidekiq Silverlight Sisense Sitespeed +skippable Slack Slackbot Slony @@ -575,6 +581,8 @@ strikethrough strikethroughs stunnel stylelint +subchart +subcharts subfolder subfolders subgraph @@ -634,6 +642,7 @@ todos tokenizer Tokenizers tokenizing +tolerations toolchain toolchains toolkit @@ -740,6 +749,7 @@ unstash unstashed unstashing unsynced +unsynchronized untarred untracked untrusted diff --git a/doc/administration/auth/ldap/index.md b/doc/administration/auth/ldap/index.md index 466ae8e108c..4180c57e3c7 100644 --- a/doc/administration/auth/ldap/index.md +++ b/doc/administration/auth/ldap/index.md @@ -180,9 +180,16 @@ production: | `allow_username_or_email_login` | If enabled, GitLab ignores everything after the first `@` in the LDAP username submitted by the user on sign-in. If you are using `uid: 'userPrincipalName'` on ActiveDirectory you need to disable this setting, because the userPrincipalName contains an `@`. | no | boolean | | `block_auto_created_users` | To maintain tight control over the number of billable users on your GitLab installation, enable this setting to keep new users blocked until they have been cleared by an administrator (default: false). | no | boolean | | `base` | Base where we can search for users. | yes | `'ou=people,dc=gitlab,dc=example'` or `'DC=mydomain,DC=com'` | -| `user_filter` | Filter LDAP users. Format: [RFC 4515](https://tools.ietf.org/search/rfc4515) Note: GitLab does not support `omniauth-ldap`'s custom filter syntax. | no | `'(employeeType=developer)'` or `'(&(objectclass=user)(|(samaccountname=momo)(samaccountname=toto)))'` | +| `user_filter` | Filter LDAP users. Format: [RFC 4515](https://tools.ietf.org/search/rfc4515) Note: GitLab does not support `omniauth-ldap`'s custom filter syntax. | no | For examples, read [Examples of user filters](#examples-of-user-filters). | | `lowercase_usernames` | If lowercase_usernames is enabled, GitLab converts the name to lower case. | no | boolean | +#### Examples of user filters + +Some examples of the `user_filter` field syntax: + +- `'(employeeType=developer)'` +- `'(&(objectclass=user)(|(samaccountname=momo)(samaccountname=toto)))'` + ### SSL Configuration Settings **(FREE SELF)** | Setting | Description | Required | Examples | diff --git a/doc/api/invitations.md b/doc/api/invitations.md index 7259dddec8c..e9b09ba9708 100644 --- a/doc/api/invitations.md +++ b/doc/api/invitations.md @@ -38,7 +38,7 @@ POST /projects/:id/invitations | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | -| `email` | integer/string | yes | The email of the new member or multiple emails separated by commas | +| `email` | string | yes | The email of the new member or multiple emails separated by commas | | `access_level` | integer | yes | A valid access level | | `expires_at` | string | no | A date string in the format YEAR-MONTH-DAY | diff --git a/doc/api/project_templates.md b/doc/api/project_templates.md index ccaefbdcc96..459bd8baff2 100644 --- a/doc/api/project_templates.md +++ b/doc/api/project_templates.md @@ -34,7 +34,7 @@ GET /projects/:id/templates/:type | Attribute | Type | Required | Description | | ---------- | ------ | -------- | ----------- | | `id` | integer / string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -| `type` | string | yes | The type `(dockerfiles|gitignores|gitlab_ci_ymls|licenses|issues|merge_requests)` of the template | +| `type` | string | yes | The type of the template. Accepted values are: `dockerfiles`, `gitignores`, `gitlab_ci_ymls`, `licenses`, `issues`, `merge_requests` | Example response (licenses): diff --git a/doc/ci/unit_test_reports.md b/doc/ci/unit_test_reports.md index ee060f33d01..c1720675d6a 100644 --- a/doc/ci/unit_test_reports.md +++ b/doc/ci/unit_test_reports.md @@ -197,7 +197,7 @@ There are a few tools that can produce JUnit report format XML files in C/C++. #### GoogleTest In the following example, `gtest` is used to generate the test reports. -If there are multiple gtest executables created for different architectures (`x86`, `x64` or `arm`), +If there are multiple `gtest` executables created for different architectures (`x86`, `x64` or `arm`), you will be required to run each test providing a unique filename. The results will then be aggregated together. diff --git a/doc/development/contributing/style_guides.md b/doc/development/contributing/style_guides.md index cd59f171d1f..f54886469f2 100644 --- a/doc/development/contributing/style_guides.md +++ b/doc/development/contributing/style_guides.md @@ -154,6 +154,13 @@ resolved and place it in the `.rubocop_manual_todo.yml`. In this scenario, do no changes to the `.rubocop_todo.yml` as an `exclude limit` that is higher than 15 will make the `.rubocop_todo.yml` hard to parse. +### Reveal existing RuboCop exceptions + +To reveal existing RuboCop exceptions in the code that have been excluded via `.rubocop_todo.yml` and +`.rubocop_manual_todo.yml`, set the environment variable `REVEAL_RUBOCOP_TODO` to `1`. + +This allows you to reveal existing RuboCop exceptions during your daily work cycle and fix them along the way. + ## Database migrations See the dedicated [Database Migrations Style Guide](../migration_style_guide.md). diff --git a/doc/development/feature_flags/controls.md b/doc/development/feature_flags/controls.md index 21ac152c469..df98996158e 100644 --- a/doc/development/feature_flags/controls.md +++ b/doc/development/feature_flags/controls.md @@ -276,17 +276,19 @@ and reduces confidence in our testing suite covering all possible combinations. Additionally, a feature flag overwritten in some of the environments can result in undefined and untested system behavior. -To remove a feature flag: +To remove a feature flag, open **one merge request** to make the changes. In the MR: -1. Open a new merge request with the ~"feature flag" label so - release managers are aware the changes are hidden behind a feature flag. +1. Add the ~"feature flag" label so release managers are aware the changes are hidden behind a feature flag. 1. If the merge request has to be picked into a stable branch, add the appropriate `~"Pick into X.Y"` label, for example `~"Pick into 13.0"`. See [the feature flag process](process.md#including-a-feature-behind-feature-flag-in-the-final-release) for further details. -1. Remove all references to the feature flag from the codebase. +1. Remove all references to the feature flag from the codebase, including tests. 1. Remove the YAML definition for the feature from the repository. -1. Clean up the feature flag from all environments with `/chatops run feature delete some_feature`. + +Once the above MR has been merged, you should: + +1. [Clean up the feature flag from all environments](#cleanup-chatops) with `/chatops run feature delete some_feature`. 1. Close the rollout issue for the feature flag after the feature flag is removed from the codebase. ### Cleanup ChatOps diff --git a/doc/ssh/README.md b/doc/ssh/README.md index 35bc3223659..7814b1dbda1 100644 --- a/doc/ssh/README.md +++ b/doc/ssh/README.md @@ -141,7 +141,7 @@ configure your SSH client to point to the directory where the private key is sto IdentityFile ~/.ssh/example_com_rsa ``` - For more information on these settings, see the [`man ssh_config` (SSH config manual)](https://man.openbsd.org/ssh_config) page. + For more information on these settings, see the [`man ssh_config`](https://man.openbsd.org/ssh_config) page in the SSH configuration manual. Public SSH keys must be unique to GitLab because they bind to your account. Your SSH key is the only identifier you have when you push code with SSH. diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb index 1ebd04900e4..7ab5ffdf014 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb @@ -44,7 +44,7 @@ module QA end it 'user transfers a project between groups', - testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/406' do + testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1703' do # Retry is needed here as the target group is not avaliable for transfer right away. QA::Support::Retrier.retry_on_exception(reload_page: page) do Page::File::Show.perform(&:go_to_general_settings) diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb index d2ba97400e6..8d12042bd85 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb @@ -9,7 +9,7 @@ module QA end end - it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/928' do + it 'can merge feature branch fork to mainline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1701' do Flow::Login.while_signed_in do merge_request.visit! diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb index cf14017b7f1..0857ae05167 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Git push over HTTP', :ldap_no_tls do - it 'user pushes code to the repository', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/426' do + it 'user pushes code to the repository', :smoke, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1702' do Flow::Login.sign_in Resource::Repository::ProjectPush.fabricate! do |push| diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb index b74f27389a0..ddbc98c4a1a 100644 --- a/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/snippet/create_personal_snippet_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create', :smoke do describe 'Personal snippet creation' do - it 'user creates a personal snippet', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/840' do + it 'user creates a personal snippet', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1704' do Flow::Login.sign_in Page::Main::Menu.perform do |menu| diff --git a/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb b/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb index 31e29810c65..900cd72c17f 100644 --- a/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb +++ b/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'User uploads avatar to profile' do expect(user.reload.avatar.file).to exist end - it 'their new avatar is immediately visible in the header', :js do + it 'their new avatar is immediately visible in the header and setting sidebar', :js do find('.js-user-avatar-input', visible: false).set(avatar_file_path) click_button 'Set new profile picture' @@ -33,5 +33,6 @@ RSpec.describe 'User uploads avatar to profile' do data_uri = find('.avatar-image .avatar')['src'] expect(page.find('.header-user-avatar')['src']).to eq data_uri + expect(page.find('[data-testid="sidebar-user-avatar"]')['src']).to eq data_uri end end diff --git a/spec/frontend/__helpers__/vue_test_utils_helper.js b/spec/frontend/__helpers__/vue_test_utils_helper.js index ffccfb249c2..d6132ef84ac 100644 --- a/spec/frontend/__helpers__/vue_test_utils_helper.js +++ b/spec/frontend/__helpers__/vue_test_utils_helper.js @@ -45,9 +45,16 @@ export const extendedWrapper = (wrapper) => { return wrapper; } - return Object.defineProperty(wrapper, 'findByTestId', { - value(id) { - return this.find(`[data-testid="${id}"]`); + return Object.defineProperties(wrapper, { + findByTestId: { + value(id) { + return this.find(`[data-testid="${id}"]`); + }, + }, + findAllByTestId: { + value(id) { + return this.findAll(`[data-testid="${id}"]`); + }, }, }); }; diff --git a/spec/frontend/__helpers__/vue_test_utils_helper_spec.js b/spec/frontend/__helpers__/vue_test_utils_helper_spec.js index 31c4ccd5dbb..d4f8e36c169 100644 --- a/spec/frontend/__helpers__/vue_test_utils_helper_spec.js +++ b/spec/frontend/__helpers__/vue_test_utils_helper_spec.js @@ -88,5 +88,22 @@ describe('Vue test utils helpers', () => { expect(mockComponent.findByTestId(testId).exists()).toBe(true); }); }); + + describe('findAllByTestId', () => { + const testId = 'a-component'; + let mockComponent; + + beforeEach(() => { + mockComponent = extendedWrapper( + shallowMount({ + template: `
`, + }), + ); + }); + + it('should find all components by test id', () => { + expect(mockComponent.findAllByTestId(testId)).toHaveLength(2); + }); + }); }); }); diff --git a/spec/services/namespaces/in_product_marketing_emails_service_spec.rb b/spec/services/namespaces/in_product_marketing_emails_service_spec.rb index 7346a5b95ae..cb2e8aff8a1 100644 --- a/spec/services/namespaces/in_product_marketing_emails_service_spec.rb +++ b/spec/services/namespaces/in_product_marketing_emails_service_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Namespaces::InProductMarketingEmailsService, '#execute' do end end - context 'for each track and series with the right conditions' do + context 'for each track and series with the right conditions', :quarantine do # https://gitlab.com/gitlab-org/gitlab/-/issues/322092 using RSpec::Parameterized::TableSyntax where(:track, :interval, :actions_completed) do