Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-01-22 09:08:28 +00:00
parent 65d7736ff1
commit 56865fdf95
33 changed files with 307 additions and 116 deletions

View File

@ -34,6 +34,7 @@ PATH
specs:
gitlab-housekeeper (0.1.0)
activesupport
awesome_print
httparty
rubocop

View File

@ -294,7 +294,7 @@ export class AwardsHandler {
}
const normalizedEmoji = this.emoji.normalizeEmojiName(emoji);
const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).parent();
const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).closest('button');
this.postEmoji($emojiButton, awardUrl, normalizedEmoji, () => {
this.addAwardToEmojiBar(votesBlock, normalizedEmoji, checkMutuality);
@ -312,7 +312,7 @@ export class AwardsHandler {
}
this.addEmojiToFrequentlyUsedList(emoji);
const normalizedEmoji = this.emoji.normalizeEmojiName(emoji);
const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).parent();
const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).closest('button');
if ($emojiButton.length > 0) {
if (this.isActive($emojiButton)) {
this.decrementCounter($emojiButton, normalizedEmoji);
@ -355,7 +355,7 @@ export class AwardsHandler {
const awardUrl = this.getAwardUrl();
if (emoji === 'thumbsup' || emoji === 'thumbsdown') {
const mutualVote = emoji === 'thumbsup' ? 'thumbsdown' : 'thumbsup';
const $emojiButton = votesBlock.find(`[data-name="${mutualVote}"]`).parent();
const $emojiButton = votesBlock.find(`[data-name="${mutualVote}"]`).closest('button');
const isAlreadyVoted = $emojiButton.hasClass('active');
if (isAlreadyVoted) {
this.addAward(votesBlock, awardUrl, mutualVote, false);
@ -430,7 +430,7 @@ export class AwardsHandler {
}
addYouToUserList(votesBlock, emoji) {
const awardBlock = this.findEmojiIcon(votesBlock, emoji).parent();
const awardBlock = this.findEmojiIcon(votesBlock, emoji).closest('button');
const origTitle = this.getAwardTooltip(awardBlock);
let users = [];
if (origTitle) {

View File

@ -1,5 +1,5 @@
<script>
import { GlSorting, GlSortingItem, GlFilteredSearch } from '@gitlab/ui';
import { GlSorting, GlFilteredSearch } from '@gitlab/ui';
import { SORT_DIRECTION_UI } from '~/search/sort/constants';
import { FILTERED_SEARCH_TERM } from '~/vue_shared/components/filtered_search_bar/constants';
@ -9,7 +9,6 @@ const DESCENDING_ORDER = 'desc';
export default {
components: {
GlSorting,
GlSortingItem,
GlFilteredSearch,
},
props: {
@ -56,6 +55,9 @@ export default {
sortDirectionData() {
return this.isSortAscending ? SORT_DIRECTION_UI.asc : SORT_DIRECTION_UI.desc;
},
sortOptions() {
return this.sortableFields.map(({ orderBy, label }) => ({ text: label, value: orderBy }));
},
},
methods: {
generateQueryData({ sorting = {}, filter = [] } = {}) {
@ -138,16 +140,10 @@ export default {
:text="sortText"
:is-ascending="isSortAscending"
:sort-direction-tool-tip="sortDirectionData.tooltip"
:sort-options="sortOptions"
:sort-by="sorting.orderBy"
@sortDirectionChange="onDirectionChange"
>
<gl-sorting-item
v-for="item in sortableFields"
ref="packageListSortItem"
:key="item.orderBy"
@click="onSortItemClick(item.orderBy)"
>
{{ item.label }}
</gl-sorting-item>
</gl-sorting>
@sortByChange="onSortItemClick"
/>
</div>
</template>

View File

@ -11,6 +11,7 @@
# sort: string
# search: string
# include_subgroups: boolean
# include_archived: boolean
# ids: int[]
# with_issues_enabled: boolean
# with_merge_requests_enabled: boolean
@ -45,6 +46,7 @@ module Namespaces
def filter_projects(collection)
collection = by_ids(collection)
collection = by_archived(collection)
collection = by_similarity(collection)
by_feature_availability(collection)
end
@ -55,6 +57,12 @@ module Namespaces
items.id_in(params[:ids])
end
def by_archived(items)
return items if Gitlab::Utils.to_boolean(params[:include_archived], default: true)
items.non_archived
end
def by_similarity(items)
return items unless params[:search].present?

View File

@ -27,7 +27,7 @@ module Types
description: 'Project associated with the note.'
field :author, Types::UserType,
null: false,
null: true,
description: 'User who wrote this note.'
field :system, GraphQL::Types::Boolean,

View File

@ -9,19 +9,15 @@
- grouped_emojis = awardable.grouped_awards(with_thumbs: inline)
.awards.js-awards-block{ class: ("hidden" if !inline && grouped_emojis.empty?), data: { award_url: toggle_award_url(awardable) } }
- awards_sort(grouped_emojis).each do |emoji, awards|
%button.gl-button.btn.btn-default.award-control.js-emoji-btn.has-tooltip{ type: "button",
class: [award_state_class(awardable, awards, current_user)],
data: { title: award_user_list(awards, current_user) } }
= render Pajamas::ButtonComponent.new(button_options: { class: (award_state_class(awardable, awards, current_user) + ' award-control js-emoji-btn has-tooltip'), data: { title: award_user_list(awards, current_user) } }) do
= emoji_icon(emoji)
%span.award-control-text.js-counter
= awards.count
- if can?(current_user, :award_emoji, awardable)
.award-menu-holder.js-award-holder
%button.gl-button.btn.btn-default.award-control.has-tooltip.js-add-award{ type: 'button',
'aria-label': _('Add reaction'),
data: { title: _('Add reaction') } }
%span{ class: "award-control-icon award-control-icon-neutral gl-icon" }= sprite_icon('slight-smile')
%span{ class: "award-control-icon award-control-icon-positive gl-icon" }= sprite_icon('smiley')
%span{ class: "award-control-icon award-control-icon-super-positive gl-icon" }= sprite_icon('smile')
= render Pajamas::ButtonComponent.new(button_options: { class: 'award-control has-tooltip js-add-award btn-icon gl-relative', data: { title: _('Add reaction') }, aria: { label: _('Add reaction') } }) do
= sprite_icon('slight-smile', css_class: 'award-control-icon-neutral gl-button-icon gl-icon')
= sprite_icon('smiley', css_class: 'award-control-icon-positive gl-button-icon gl-icon gl-left-3!')
= sprite_icon('smile', css_class: 'award-control-icon-super-positive gl-button-icon gl-icon gl-left-3!')
= yield

View File

@ -1,11 +1,10 @@
- page_title _("Unsubscribe"), _("Admin Notifications")
%h1.page-title.gl-font-size-h-display Unsubscribe from Admin notifications
%hr
= form_tag unsubscribe_path(Base64.urlsafe_encode64(@email)) do
%p
Yes, I want to unsubscribe
%strong= @email
from any further admin emails.
.form-actions
= submit_tag 'Unsubscribe', class: 'gl-button btn btn-confirm'
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm) do
= _('Unsubscribe')

View File

@ -0,0 +1,20 @@
- title: "Dependency Scanning incorrect SBOM metadata properties"
removal_milestone: "17.0"
announcement_milestone: "16.9"
breaking_change: true
reporter: gonzoyumo
stage: Secure
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/438779
body: | # (required) Don't change this line.
GitLab 17.0 removes support for the following metadata properties in CycloneDX SBOM reports:
- `gitlab:dependency_scanning:input_file`
- `gitlab:dependency_scanning:package_manager`
These were added in GitLab 15.7 to the SBOM produced by Dependency Scanning. However, these properties were incorrect and didn't align with the [GitLab CycloneDX property taxonomy](https://docs.gitlab.com/ee/development/sec/cyclonedx_property_taxonomy.html).
The following correct properties were added in GitLab 15.11 to address this:
- `gitlab:dependency_scanning:input_file:path`
- `gitlab:dependency_scanning:package_manager:name`
The incorrect properties were kept for backward compatibility. They are now deprecated and will be removed in 17.0.

View File

@ -0,0 +1,24 @@
- title: "Support for self-hosted Sentry versions 21.4.1 and earlier"
# The milestones for the deprecation announcement, and the removal.
removal_milestone: "17.0"
announcement_milestone: "16.9"
# Change breaking_change to false if needed.
breaking_change: true
# The stage and GitLab username of the person reporting the change,
# and a link to the deprecation issue
reporter: sguyon
stage: manage
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/435791
body: | # (required) Don't change this line.
Support for self-hosted Sentry versions 21.4.1 and earlier is deprecated and will be removed in GitLab 17.0.
If your self-hosted Sentry version is 21.4.1 or earlier, you may not be able to collect errors from your GitLab instance after upgrading to GitLab 17.0 or later.
To continue sending errors from your GitLab instance to your Sentry instance, upgrade Sentry to version 21.5.0 or later. For more information,
see [Sentry documentation](https://develop.sentry.dev/self-hosted/releases/).
NOTE:
The deprecated support is for
[GitLab instance error tracking features](https://docs.gitlab.com/omnibus/settings/configuration.html#error-reporting-and-logging-with-sentry)
for administrators. The deprecated support does not relate to
[GitLab error tracking](https://docs.gitlab.com/ee/operations/error_tracking.html#sentry-error-tracking) for
developers' own deployed applications.

View File

@ -4,7 +4,10 @@ classes:
- Ci::BuildReportResult
feature_categories:
- code_testing
description: Stores data related to the build that finished, including junit test data.
description: Stores data related to the build that finished, including junit test
data.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32991
milestone: '13.1'
gitlab_schema: gitlab_ci
sharding_key:
project_id: projects

View File

@ -4,7 +4,10 @@ classes:
- Ci::DailyBuildGroupReportResult
feature_categories:
- code_testing
description: Stores daily aggregated data related to the build group, including code coverage data.
description: Stores daily aggregated data related to the build group, including code
coverage data.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30387
milestone: '13.0'
gitlab_schema: gitlab_ci
sharding_key:
project_id: projects

View File

@ -8,3 +8,5 @@ description: Stores unit test data produced from builds.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56137
milestone: '13.11'
gitlab_schema: gitlab_ci
sharding_key:
project_id: projects

View File

@ -4,7 +4,16 @@ classes:
- Projects::CiFeatureUsage
feature_categories:
- code_testing
description: Project CI feature usage information used to access CI data from the main database.
description: Project CI feature usage information used to access CI data from the
main database.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68186
milestone: '14.2'
gitlab_schema: gitlab_main
gitlab_schema: gitlab_main_cell
allow_cross_joins:
- gitlab_main_clusterwide
allow_cross_transactions:
- gitlab_main_clusterwide
allow_cross_foreign_keys:
- gitlab_main_clusterwide
sharding_key:
project_id: projects

View File

@ -23401,7 +23401,7 @@ Represents the network policy.
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="noteauthor"></a>`author` | [`UserCore!`](#usercore) | User who wrote this note. |
| <a id="noteauthor"></a>`author` | [`UserCore`](#usercore) | User who wrote this note. |
| <a id="noteauthoriscontributor"></a>`authorIsContributor` | [`Boolean`](#boolean) | Indicates whether the note author is a contributor. |
| <a id="noteawardemoji"></a>`awardEmoji` | [`AwardEmojiConnection`](#awardemojiconnection) | List of emoji reactions associated with the note. (see [Connections](#connections)) |
| <a id="notebody"></a>`body` | [`String!`](#string) | Content of the note. |

View File

@ -2203,9 +2203,9 @@ Example response:
Pre-requisite:
- You must be an administrator.
- You must be an administrator to view the activity of users with private profiles.
Get the last activity date for all users, sorted from oldest to newest.
Get the last activity date for users with public profiles, sorted from oldest to newest.
The activities that update the user event timestamps (`last_activity_on` and `current_sign_in_at`) are:
@ -2215,7 +2215,7 @@ The activities that update the user event timestamps (`last_activity_on` and `cu
- User using the API
- User using the GraphQL API
By default, it shows the activity for all users in the last 6 months, but this can be
By default, it shows the activity for users with public profiles in the last 6 months, but this can be
amended by using the `from` parameter.
```plaintext

View File

@ -224,7 +224,7 @@ POST /vulnerabilities/:id/revert
| `id` | integer or string | yes | The ID of a vulnerability to revert to detected state |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/vulnerabilities/5/dismiss"
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/vulnerabilities/5/revert"
```
Example response:

View File

@ -4,15 +4,15 @@ group: Pipeline Authoring
info: Any user with at least the Maintainer role can merge updates to this content. For details, see https://docs.gitlab.com/ee/development/development_processes.html#development-guidelines-review.
---
# Development guide for GitLab CI/CD components
# Development guide for GitLab official CI/CD components
This document explains how to develop [CI/CD components](../../ci/components/index.md) that are maintained by GitLab.
This document explains how to develop [CI/CD components](../../ci/components/index.md) that are maintained by GitLab, either the official public ones or those for internal use.
The official location for all GitLab-maintained component projects is the [`gitlab.com/components`](https://gitlab.com/components) group.
The location for all official GitLab component projects is the [`gitlab.com/components`](https://gitlab.com/components) group.
This group contains all components that are designed to be generic, served to all GitLab users, and maintained by GitLab.
For example: SAST, Secret Detection and Code Quality components.
A component project can initially be created under a different group (for example `gitlab-org`)
but they need to be moved into the `components` group before the first version gets published to the catalog.
but it needs to be moved into the `components` group before the first version gets published to the catalog.
Components that are for GitLab internal use only, for example specific to `gitlab-org/gitlab` project, should be
implemented under `gitlab-org` group.
@ -23,7 +23,7 @@ experience with it.
## Define ownership
GitLab-maintained components are trusted by the community and require a high degree of quality and timely maintenance.
Official GitLab components are trusted by the community and require a high degree of quality and timely maintenance.
Components must be kept up to date, monitored for security vulnerabilities, and bugs fixed.
Each component project must have a set of owners and maintainers that are also domain experts.
@ -40,7 +40,7 @@ they can be contacted by the wider community if needed.
NOTE:
If a set of project owners cannot be guaranteed or the components cannot be dogfooded, we strongly recommend
not creating a GitLab-maintained component project and instead let the wider community fulfill the demand
not creating an official GitLab component project and instead let the wider community fulfill the demand
in the catalog.
## Development process
@ -50,7 +50,6 @@ in the catalog.
1. Follow the [standard guide for creating components](../../ci/components/index.md).
1. Add a concise project description that clearly describes the capabilities offered by the component project.
1. Ensure that the [best practices](../../ci/components/index.md#best-practices) are followed.
1. Use [semantic versioning](https://semver.org) in the form `MAJOR.MINOR` or `MAJOR.MINOR.PATCH`.
1. Add a `LICENSE.md` file with the MIT license.
1. The project must have a `.gitlab-ci.yml` file that:
- Validates all the components in the project correctly.
@ -63,9 +62,9 @@ in the catalog.
- **Variables** (when applicable): The variable names, possible values, and descriptions.
- **Contribute**: Notes and how to get in touch with the maintainers.
Usually the contribution process should follow the [official guide](../../ci/components/index.md).
1. Upload the [official avatar image](img/avatar_component_project.png) to the component project.
1. For official component projects, upload the [official avatar image](img/avatar_component_project.png) to the component project.
## Review and contribution process
## Review and contribution process for official components
It's possible that components in the project have a related [CI/CD template](templates.md) in the GitLab codebase.
In that case we need to cross link the component project and CI/CD template:
@ -76,5 +75,28 @@ In that case we need to cross link the component project and CI/CD template:
When changes are applied to these components, check whether we can integrate the changes in the CI/CD template too.
This might not be possible due to the rigidity of versioning in CI/CD templates.
Ping [`@gitlab-org/maintainers/ci-components`](https://gitlab.com/groups/gitlab-org/maintainers/ci-components/-/group_members?with_inherited_permissions=exclude)
Ping any of the [maintainers](#default-maintainers-of-gitlab-official-components)
for reviews to ensure that the components are written in consistent style and follow the best practices.
## Default maintainers of GitLab official components
Each component project under [`gitlab.com/components`](https://gitlab.com/components) group should
have specific DRIs and maintainers, however the [`@gitlab-org/maintainers/ci-components`](https://gitlab.com/groups/gitlab-org/maintainers/ci-components/-/group_members?with_inherited_permissions=exclude)
group of maintainers is responsible for managing the `components` group in general.
The responsibilities for this group of maintainers:
- Manage any development and helper resources, such as toolkit components and project templates, to provide the best development experience.
- Manage any component projects that is missing a clear DRI, or is in the process of being developed, and work to find the right owners long term.
- Guide and mentor the maintainers of individual component projects, including during code reviews and when troubleshooting issues.
- Ensure best practices are applied and improved over time.
Requirements for becoming a maintainer:
- Have a an in-depth understanding of the [CI/CD YAML syntax](../../ci/yaml/index.md) and features.
- Understand how CI components work and demonstrate experience developing them.
- Have a solid understanding of the components [best practices](../../ci/components/index.md#best-practices).
How to join the `gitlab-components` group of general maintainers:
- Review the [process for becoming a `gitlab-components` maintainer](https://handbook.gitlab.com/handbook/engineering/workflow/code-review/#project-maintainer-process-for-gitlab-components).

View File

@ -402,6 +402,31 @@ To help avoid being impacted by this breaking change, create new access tokens w
<div class="deprecation breaking-change" data-milestone="17.0">
### Dependency Scanning incorrect SBOM metadata properties
<div class="deprecation-notes">
- Announced in GitLab <span class="milestone">16.9</span>
- Removal in GitLab <span class="milestone">17.0</span> ([breaking change](https://docs.gitlab.com/ee/update/terminology.html#breaking-change))
- To discuss this change or learn more, see the [deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/438779).
</div>
GitLab 17.0 removes support for the following metadata properties in CycloneDX SBOM reports:
- `gitlab:dependency_scanning:input_file`
- `gitlab:dependency_scanning:package_manager`
These were added in GitLab 15.7 to the SBOM produced by Dependency Scanning. However, these properties were incorrect and didn't align with the [GitLab CycloneDX property taxonomy](https://docs.gitlab.com/ee/development/sec/cyclonedx_property_taxonomy.html).
The following correct properties were added in GitLab 15.11 to address this:
- `gitlab:dependency_scanning:input_file:path`
- `gitlab:dependency_scanning:package_manager:name`
The incorrect properties were kept for backward compatibility. They are now deprecated and will be removed in 17.0.
</div>
<div class="deprecation breaking-change" data-milestone="17.0">
### Dependency Scanning support for sbt 1.0.X
<div class="deprecation-notes">
@ -1273,6 +1298,31 @@ automatically from GitLab 16.0 onwards.
<div class="deprecation breaking-change" data-milestone="17.0">
### Support for self-hosted Sentry versions 21.4.1 and earlier
<div class="deprecation-notes">
- Announced in GitLab <span class="milestone">16.9</span>
- Removal in GitLab <span class="milestone">17.0</span> ([breaking change](https://docs.gitlab.com/ee/update/terminology.html#breaking-change))
- To discuss this change or learn more, see the [deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/435791).
</div>
Support for self-hosted Sentry versions 21.4.1 and earlier is deprecated and will be removed in GitLab 17.0.
If your self-hosted Sentry version is 21.4.1 or earlier, you may not be able to collect errors from your GitLab instance after upgrading to GitLab 17.0 or later.
To continue sending errors from your GitLab instance to your Sentry instance, upgrade Sentry to version 21.5.0 or later. For more information,
see [Sentry documentation](https://develop.sentry.dev/self-hosted/releases/).
NOTE:
The deprecated support is for
[GitLab instance error tracking features](https://docs.gitlab.com/omnibus/settings/configuration.html#error-reporting-and-logging-with-sentry)
for administrators. The deprecated support does not relate to
[GitLab error tracking](https://docs.gitlab.com/ee/operations/error_tracking.html#sentry-error-tracking) for
developers' own deployed applications.
</div>
<div class="deprecation breaking-change" data-milestone="17.0">
### Support for setting custom schema for backup is deprecated
<div class="deprecation-notes">

View File

@ -53,6 +53,16 @@ container_scanning:
- kube-system
```
For every target namespace, all images in the following workload resources are scanned:
- Pod
- ReplicaSet
- ReplicationController
- StatefulSet
- DaemonSet
- CronJob
- Job
### Enable via scan execution policies
To enable scanning of all images within your Kubernetes cluster via scan execution policies, we can use the

View File

@ -11,6 +11,7 @@ PATH
specs:
gitlab-housekeeper (0.1.0)
activesupport
awesome_print
httparty
rubocop
@ -30,6 +31,7 @@ GEM
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
awesome_print (1.9.2)
coderay (1.1.3)
concurrent-ruby (1.2.2)
crack (0.4.3)

View File

@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'activesupport'
spec.add_runtime_dependency 'httparty'
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'awesome_print'
spec.add_development_dependency 'gitlab-styles'
spec.add_development_dependency 'rspec-rails'

View File

@ -49,11 +49,6 @@ module Gitlab
#{change.title}
#{change.description}
This commit was generated by
[gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139492).
Changelog: other
MSG
Shell.execute("git", "commit", "-m", commit_message)

View File

@ -4,6 +4,7 @@ require 'active_support/core_ext/string'
require 'gitlab/housekeeper/keep'
require 'gitlab/housekeeper/gitlab_client'
require 'gitlab/housekeeper/git'
require 'awesome_print'
require 'digest'
module Gitlab
@ -32,6 +33,7 @@ module Gitlab
keep = keep_class.new
keep.each_change do |change|
branch_name = git.commit_in_branch(change)
add_standard_change_data(change)
if @dry_run
dry_run(change, branch_name)
@ -49,6 +51,19 @@ module Gitlab
puts "Housekeeper created #{created} MRs"
end
def add_standard_change_data(change)
change.labels ||= []
change.labels << 'automation:gitlab-housekeeper-authored'
change.description += <<~MARKDOWN
This change was generated by
[gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper)
Changelog: other
MARKDOWN
end
def git
@git ||= ::Gitlab::Housekeeper::Git.new(logger: @logger)
end
@ -60,7 +75,15 @@ module Gitlab
end
def dry_run(change, branch_name)
puts "=> #{change.identifiers.join(': ')}"
puts "=> #{change.identifiers.join(': ')}".purple
puts '=> Title:'.purple
puts change.title.purple
puts
puts '=> Description:'
puts change.description
puts
if change.labels.present?
puts '=> Attributes:'
@ -68,14 +91,6 @@ module Gitlab
puts
end
puts '=> Title:'
puts change.title
puts
puts '=> Description:'
puts change.description
puts
puts '=> Diff:'
puts Shell.execute('git', '--no-pager', 'diff', '--color=always', 'master', branch_name, '--',
*change.changed_files)

View File

@ -92,11 +92,6 @@ RSpec.describe ::Gitlab::Housekeeper::Git do
split over multiple lines!
This commit was generated by
[gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139492).
Changelog: other
diff --git a/files/test_file2.txt b/files/test_file2.txt
new file mode 100644
index 0000000..ff205e0

View File

@ -100,8 +100,8 @@ RSpec.describe ::Gitlab::Housekeeper::Runner do
.with(
source_project_id: '123',
title: 'The title of MR1',
description: 'The description of the MR',
labels: ['example-label'],
description: /The description of the MR/,
labels: %w[example-label automation:gitlab-housekeeper-authored],
source_branch: 'the-identifier-for-the-first-change',
target_branch: 'master',
target_project_id: '456',
@ -113,8 +113,8 @@ RSpec.describe ::Gitlab::Housekeeper::Runner do
.with(
source_project_id: '123',
title: 'The title of MR2',
description: 'The description of the MR',
labels: ['example-label'],
description: /The description of the MR/,
labels: %w[example-label automation:gitlab-housekeeper-authored],
source_branch: 'the-identifier-for-the-second-change',
target_branch: 'master',
target_project_id: '456',
@ -157,8 +157,8 @@ RSpec.describe ::Gitlab::Housekeeper::Runner do
.with(
source_project_id: '123',
title: 'The title of MR1',
description: 'The description of the MR',
labels: ['example-label'],
description: /The description of the MR/,
labels: %w[example-label automation:gitlab-housekeeper-authored],
source_branch: 'the-identifier-for-the-first-change',
target_branch: 'master',
target_project_id: '456',
@ -170,8 +170,8 @@ RSpec.describe ::Gitlab::Housekeeper::Runner do
.with(
source_project_id: '123',
title: 'The title of MR2',
description: 'The description of the MR',
labels: ['example-label'],
description: /The description of the MR/,
labels: %w[example-label automation:gitlab-housekeeper-authored],
source_branch: 'the-identifier-for-the-second-change',
target_branch: 'master',
target_project_id: '456',

View File

@ -66,10 +66,6 @@ module Keeps
[required stop](https://docs.gitlab.com/ee/development/database/required_stops.html)
to process the migration. Therefore we can finalize any batched background migration that was added before the
last required stop.
This merge request was created using the
[gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139492)
gem.
MARKDOWN
# rubocop:enable Gitlab/DocUrl

View File

@ -1347,12 +1347,12 @@ module API
end
# rubocop: disable CodeReuse/ActiveRecord
get "activities", feature_category: :user_profile do
authenticated_as_admin!
activities = User
.where(User.arel_table[:last_activity_on].gteq(params[:from]))
.reorder(last_activity_on: :asc)
activities = activities.with_public_profile unless current_user.can_read_all_resources?
present paginate(activities), with: Entities::UserActivity
end
# rubocop: enable CodeReuse/ActiveRecord

View File

@ -106,7 +106,10 @@ module QA
end
it 'hook is auto-disabled',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/389595' do
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/389595', quarantine: {
type: :flaky,
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/431976'
} do
Resource::ProjectWebHook.setup(fail_mock, session: session, issues: true) do |webhook, smocker|
hook_trigger_times.times do
create(:issue, project: webhook.project)

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Namespaces::ProjectsFinder do
RSpec.describe Namespaces::ProjectsFinder, feature_category: :groups_and_projects do
let_it_be(:current_user) { create(:user) }
let_it_be(:namespace) { create(:group, :public) }
let_it_be(:subgroup) { create(:group, parent: namespace) }
@ -12,6 +12,7 @@ RSpec.describe Namespaces::ProjectsFinder do
let_it_be(:project_4) { create(:project, :public, :merge_requests_disabled, path: 'test-project-2', group: namespace, name: 'Test Project 2') }
let_it_be(:project_5) { create(:project, group: subgroup, marked_for_deletion_at: 1.day.ago, pending_delete: true) }
let_it_be(:project_6) { create(:project, group: namespace, marked_for_deletion_at: 1.day.ago, pending_delete: true) }
let_it_be(:project_7) { create(:project, :archived, group: namespace) }
let(:params) { {} }
@ -30,14 +31,14 @@ RSpec.describe Namespaces::ProjectsFinder do
context 'with a namespace' do
it 'returns the project for the namespace' do
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6)
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6, project_7)
end
context 'when not_aimed_for_deletion is provided' do
let(:params) { { not_aimed_for_deletion: true } }
it 'returns all projects not aimed for deletion for the namespace' do
expect(projects).to contain_exactly(project_1, project_2, project_4)
expect(projects).to contain_exactly(project_1, project_2, project_4, project_7)
end
end
@ -45,7 +46,7 @@ RSpec.describe Namespaces::ProjectsFinder do
let(:params) { { include_subgroups: true } }
it 'returns all projects for the namespace' do
expect(projects).to contain_exactly(project_1, project_2, project_3, project_4, project_5, project_6)
expect(projects).to contain_exactly(project_1, project_2, project_3, project_4, project_5, project_6, project_7)
end
context 'when ids are provided' do
@ -60,7 +61,33 @@ RSpec.describe Namespaces::ProjectsFinder do
let(:params) { { not_aimed_for_deletion: true, include_subgroups: true } }
it 'returns all projects not aimed for deletion for the namespace' do
expect(projects).to contain_exactly(project_1, project_2, project_3, project_4)
expect(projects).to contain_exactly(project_1, project_2, project_3, project_4, project_7)
end
end
end
context 'for include_archived parameter' do
context 'when include_archived is not provided' do
let(:params) { {} }
it 'returns archived and non-archived projects' do
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6, project_7)
end
end
context 'when include_archived is true' do
let(:params) { { include_archived: true } }
it 'returns archived and non-archived projects' do
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6, project_7)
end
end
context 'when include_archived is false' do
let(:params) { { include_archived: false } }
it 'returns ONLY non-archived projects' do
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6)
end
end
end
@ -77,7 +104,7 @@ RSpec.describe Namespaces::ProjectsFinder do
let(:params) { { with_issues_enabled: true, include_subgroups: true } }
it 'returns the projects that have issues enabled' do
expect(projects).to contain_exactly(project_1, project_2, project_4, project_5, project_6)
expect(projects).to contain_exactly(project_1, project_2, project_4, project_5, project_6, project_7)
end
end
@ -85,7 +112,7 @@ RSpec.describe Namespaces::ProjectsFinder do
let(:params) { { with_merge_requests_enabled: true } }
it 'returns the projects that have merge requests enabled' do
expect(projects).to contain_exactly(project_1, project_2, project_6)
expect(projects).to contain_exactly(project_1, project_2, project_6, project_7)
end
end
@ -101,7 +128,7 @@ RSpec.describe Namespaces::ProjectsFinder do
let(:params) { { sort: :similarity } }
it 'returns all projects' do
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6)
expect(projects).to contain_exactly(project_1, project_2, project_4, project_6, project_7)
end
end
@ -124,7 +151,7 @@ RSpec.describe Namespaces::ProjectsFinder do
end
it 'returns projects sorted by latest activity' do
expect(projects).to eq([project_4, project_1, project_2, project_6])
expect(projects).to eq([project_4, project_1, project_2, project_6, project_7])
end
end
end

View File

@ -200,8 +200,8 @@ describe('AwardsHandler', () => {
it('should handle :+1: and :-1: mutuality', () => {
const awardUrl = awardsHandler.getAwardUrl();
const $votesBlock = $('.js-awards-block').eq(0);
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').parent();
const $thumbsDownEmoji = $votesBlock.find('[data-name=thumbsdown]').parent();
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').closest('button');
const $thumbsDownEmoji = $votesBlock.find('[data-name=thumbsdown]').closest('button');
awardsHandler.addAward($votesBlock, awardUrl, 'thumbsup', false);
expect($thumbsUpEmoji.hasClass('active')).toBe(true);
@ -230,7 +230,7 @@ describe('AwardsHandler', () => {
it('should prepend "You" to the award tooltip', () => {
const awardUrl = awardsHandler.getAwardUrl();
const $votesBlock = $('.js-awards-block').eq(0);
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').parent();
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').closest('button');
$thumbsUpEmoji.attr('data-title', 'sam, jerry, max, and andy');
awardsHandler.addAward($votesBlock, awardUrl, 'thumbsup', false);
@ -240,7 +240,7 @@ describe('AwardsHandler', () => {
it('handles the special case where "You" is not cleanly comma separated', () => {
const awardUrl = awardsHandler.getAwardUrl();
const $votesBlock = $('.js-awards-block').eq(0);
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').parent();
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').closest('button');
$thumbsUpEmoji.attr('data-title', 'sam');
awardsHandler.addAward($votesBlock, awardUrl, 'thumbsup', false);
@ -252,7 +252,7 @@ describe('AwardsHandler', () => {
it('removes "You" from the front of the tooltip', () => {
const awardUrl = awardsHandler.getAwardUrl();
const $votesBlock = $('.js-awards-block').eq(0);
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').parent();
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').closest('button');
$thumbsUpEmoji.attr('data-title', 'You, sam, jerry, max, and andy');
$thumbsUpEmoji.addClass('active');
awardsHandler.addAward($votesBlock, awardUrl, 'thumbsup', false);
@ -263,7 +263,7 @@ describe('AwardsHandler', () => {
it('handles the special case where "You" is not cleanly comma separated', () => {
const awardUrl = awardsHandler.getAwardUrl();
const $votesBlock = $('.js-awards-block').eq(0);
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').parent();
const $thumbsUpEmoji = $votesBlock.find('[data-name=thumbsup]').closest('button');
$thumbsUpEmoji.attr('data-title', 'You and sam');
$thumbsUpEmoji.addClass('active');
awardsHandler.addAward($votesBlock, awardUrl, 'thumbsup', false);

View File

@ -1,4 +1,4 @@
import { GlSorting, GlSortingItem, GlFilteredSearch } from '@gitlab/ui';
import { GlSorting, GlFilteredSearch } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import { FILTERED_SEARCH_TERM } from '~/vue_shared/components/filtered_search_bar/constants';
import component from '~/vue_shared/components/registry/registry_search.vue';
@ -7,7 +7,6 @@ describe('Registry Search', () => {
let wrapper;
const findPackageListSorting = () => wrapper.findComponent(GlSorting);
const findSortingItems = () => wrapper.findAllComponents(GlSortingItem);
const findFilteredSearch = () => wrapper.findComponent(GlFilteredSearch);
const defaultProps = {
@ -32,9 +31,6 @@ describe('Registry Search', () => {
const mountComponent = (propsData = defaultProps) => {
wrapper = shallowMount(component, {
propsData,
stubs: {
GlSortingItem,
},
});
};
@ -92,7 +88,10 @@ describe('Registry Search', () => {
it('has all the sortable items', () => {
mountComponent();
expect(findSortingItems()).toHaveLength(defaultProps.sortableFields.length);
expect(findPackageListSorting().props().sortOptions).toMatchObject([
{ text: 'name', value: 'name' },
{ text: 'baz', value: 'bar' },
]);
});
it('on sort change emits sorting:changed event', () => {
@ -108,7 +107,7 @@ describe('Registry Search', () => {
it('on sort item click emits sorting:changed event', () => {
mountComponent();
findSortingItems().at(1).vm.$emit('click');
findPackageListSorting().vm.$emit('sortByChange', 'bar');
expect(wrapper.emitted('sorting:changed')).toEqual([
[{ orderBy: defaultProps.sortableFields[1].orderBy }],

View File

@ -4384,21 +4384,20 @@ RSpec.describe API::Users, :aggregate_failures, feature_category: :user_profile
context "user activities", :clean_gitlab_redis_shared_state do
let_it_be(:old_active_user) { create(:user, last_activity_on: Time.utc(2000, 1, 1)) }
let_it_be(:newly_active_user) { create(:user, last_activity_on: 2.days.ago.midday) }
let_it_be(:newly_active_private_user) { create(:user, last_activity_on: 1.day.ago.midday, private_profile: true) }
let(:path) { '/user/activities' }
it_behaves_like 'GET request permissions for admin mode'
context 'for an anonymous user' do
it 'returns 401' do
get api(path)
context 'last activity as normal user' do
it 'has no permission' do
get api(path, user)
expect(response).to have_gitlab_http_status(:forbidden)
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
context 'as admin' do
context 'as a logged in user' do
it 'returns the activities from the last 6 months' do
get api(path, admin, admin_mode: true)
get api(path, user)
expect(response).to include_pagination_headers
expect(json_response.size).to eq(1)
@ -4412,7 +4411,7 @@ RSpec.describe API::Users, :aggregate_failures, feature_category: :user_profile
context 'passing a :from parameter' do
it 'returns the activities from the given date' do
get api("#{path}?from=2000-1-1", admin, admin_mode: true)
get api("#{path}?from=2000-1-1", user)
expect(response).to include_pagination_headers
expect(json_response.size).to eq(2)
@ -4424,6 +4423,22 @@ RSpec.describe API::Users, :aggregate_failures, feature_category: :user_profile
expect(activity['last_activity_at']).to eq(Time.utc(2000, 1, 1).to_date.to_s)
end
end
it 'does not include users with private profiles' do
get api(path, user)
expect(json_response.map { |user| user['username'] })
.not_to include(newly_active_private_user.username)
end
end
context 'as admin' do
it 'includes users with private profiles' do
get api(path, admin, admin_mode: true)
expect(json_response.map { |user| user['username'] })
.to include(newly_active_private_user.username)
end
end
end

View File

@ -166,8 +166,8 @@ def click_sort_option(option, ascending)
find('[data-testid="registry-sort-dropdown"]').click
page.within('[data-testid="registry-sort-dropdown"] .dropdown-menu') do
click_button option
page.within('[data-testid="registry-sort-dropdown"] [data-testid="base-dropdown-menu"]') do
find('.gl-new-dropdown-item', text: option).click
end
if ascending