Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
77e7754605
commit
458eb9c347
8 changed files with 60 additions and 44 deletions
|
@ -18,9 +18,13 @@
|
|||
variables:
|
||||
RSPEC_TESTS_MAPPING_ENABLED: "true"
|
||||
|
||||
.decomposed-database-rspec:
|
||||
.decomposed-database:
|
||||
variables:
|
||||
DECOMPOSED_DB: "true"
|
||||
|
||||
.decomposed-database-rspec:
|
||||
extends: .decomposed-database
|
||||
variables:
|
||||
GITLAB_LOAD_BALANCING_REUSE_PRIMARY_ci: "main"
|
||||
GITLAB_USE_MODEL_LOAD_BALANCING: "true"
|
||||
|
||||
|
@ -370,9 +374,16 @@ db:migrate-from-previous-major-version:
|
|||
script:
|
||||
- run_timed_command "scripts/db_migrate"
|
||||
|
||||
db:check-schema:
|
||||
db:migrate-from-previous-major-version-decomposed:
|
||||
extends:
|
||||
- db:migrate-from-previous-major-version
|
||||
- .decomposed-database
|
||||
- .rails:rules:decomposed-databases
|
||||
variables:
|
||||
GITLAB_MIGRATE_MAIN_ONLY: "true"
|
||||
|
||||
.db:check-schema-base:
|
||||
extends:
|
||||
- .rails:rules:ee-mr-and-default-branch-only
|
||||
variables:
|
||||
TAG_TO_CHECKOUT: "v14.4.0"
|
||||
|
@ -381,6 +392,16 @@ db:check-schema:
|
|||
- scripts/schema_changed.sh
|
||||
- scripts/validate_migration_timestamps
|
||||
|
||||
db:check-schema:
|
||||
extends:
|
||||
- db:migrate-from-previous-major-version
|
||||
- .db:check-schema-base
|
||||
|
||||
db:check-schema-decomposed:
|
||||
extends:
|
||||
- db:migrate-from-previous-major-version-decomposed
|
||||
- .db:check-schema-base
|
||||
|
||||
db:check-migrations:
|
||||
extends:
|
||||
- .db-job-base
|
||||
|
|
|
@ -1,22 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ScheduleDeleteInvalidEpicIssues < Gitlab::Database::Migration[1.0]
|
||||
MIGRATION = 'DeleteInvalidEpicIssues'
|
||||
DELAY_INTERVAL = 2.minutes
|
||||
BATCH_SIZE = 10_000
|
||||
|
||||
disable_ddl_transaction!
|
||||
# This is a now a no-op
|
||||
# See https://gitlab.com/gitlab-org/gitlab/-/issues/348477
|
||||
|
||||
def up
|
||||
queue_background_migration_jobs_by_range_at_intervals(
|
||||
define_batchable_model('epics'),
|
||||
MIGRATION,
|
||||
DELAY_INTERVAL,
|
||||
batch_size: BATCH_SIZE,
|
||||
track_jobs: true
|
||||
)
|
||||
# no-op
|
||||
end
|
||||
|
||||
def down
|
||||
# also no-op
|
||||
end
|
||||
end
|
||||
|
|
|
@ -868,6 +868,11 @@ This example creates an artifact with `.config` and all the files in the `binari
|
|||
> - It's disabled on GitLab.com.
|
||||
> - It's recommended for production use.
|
||||
|
||||
FLAG:
|
||||
On self-managed GitLab, by default this feature is not available. To make it available,
|
||||
ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `non_public_artifacts`. On
|
||||
GitLab.com, this feature is not available.
|
||||
|
||||
Use `artifacts:public` to determine whether the job artifacts should be
|
||||
publicly available.
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ The certificate [fingerprint algorithm](../../../integration/saml.md#notes-on-co
|
|||
> - [Improved](https://gitlab.com/gitlab-org/gitlab/-/issues/211962) in GitLab 13.8 with allowing group owners to not go through SSO.
|
||||
> - [Improved](https://gitlab.com/gitlab-org/gitlab/-/issues/9152) in GitLab 13.11 with enforcing open SSO session to use Git if this setting is switched on.
|
||||
|
||||
With this option enabled, users (except owners) must go through your group's GitLab single sign-on URL if they wish to access group resources through the UI. Users can't be manually added as members.
|
||||
With this option enabled, users (except users with the Owner role) must access GitLab using your group GitLab single sign-on URL to access group resources. Users added manually as members can't access group resources.
|
||||
|
||||
SSO enforcement does not affect sign in or access to any resources outside of the group. Users can view which groups and projects they are a member of without SSO sign in.
|
||||
|
||||
|
|
|
@ -109,14 +109,26 @@ To create a group access token:
|
|||
1. Run the following commands in a [Rails console](../../../administration/operations/rails_console.md):
|
||||
|
||||
```ruby
|
||||
admin = User.find(1) # group admin
|
||||
group = Group.find(109) # the group you want to create a token for
|
||||
bot = Users::CreateService.new(admin, { name: 'group_token', username: "group_#{group.id}_bot", email: "group_#{group.id}_bot@example.com", user_type: :project_bot }).execute # create the group bot user
|
||||
# for further group access tokens, the username should be group_#{group.id}_bot#{bot_count}, e.g. group_109_bot2, and their email should be group_109_bot2@example.com
|
||||
bot.confirm # confirm the bot
|
||||
group.add_user(bot, :maintainer) # add the bot to the group at the desired access level
|
||||
token = bot.personal_access_tokens.create(scopes:[:api, :write_repository], name: 'group_token') # give it a PAT
|
||||
gtoken = token.token # get the token value
|
||||
# Set the GitLab administration user to use. If user ID 1 is not available or is not an adinistrator, use 'admin = User.admins.first' instead to select an admininistrator.
|
||||
admin = User.find(1)
|
||||
|
||||
# Set the group group you want to create a token for. For example, group with ID 109.
|
||||
group = Group.find(109)
|
||||
|
||||
# Create the group bot user. For further group access tokens, the username should be group_#{group.id}_bot#{bot_count}. For example, group_109_bot2 and email address group_109_bot2@example.com.
|
||||
bot = Users::CreateService.new(admin, { name: 'group_token', username: "group_#{group.id}_bot", email: "group_#{group.id}_bot@example.com", user_type: :project_bot }).execute
|
||||
|
||||
# Confirm the group bot.
|
||||
bot.confirm
|
||||
|
||||
# Add the bot to the group with the required role.
|
||||
group.add_user(bot, :maintainer)
|
||||
|
||||
# Give the bot a personal access token.
|
||||
token = bot.personal_access_tokens.create(scopes:[:api, :write_repository], name: 'group_token')
|
||||
|
||||
# Get the token value.
|
||||
gtoken = token.token
|
||||
```
|
||||
|
||||
1. Test if the generated group access token works:
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module BackgroundMigration
|
||||
# rubocop: disable Style/Documentation
|
||||
class DeleteInvalidEpicIssues
|
||||
def perform(start_id, stop_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Gitlab::BackgroundMigration::DeleteInvalidEpicIssues.prepend_mod_with('Gitlab::BackgroundMigration::DeleteInvalidEpicIssues')
|
|
@ -4,7 +4,7 @@ module QA
|
|||
# run only base UI validation on staging because test requires top level group creation which is problematic
|
||||
# on staging environment
|
||||
RSpec.describe 'Manage', :requires_admin, except: { subdomain: :staging } do
|
||||
describe 'Bulk group import' do
|
||||
describe 'Gitlab migration' do
|
||||
let(:import_wait_duration) { { max_duration: 300, sleep_interval: 2 } }
|
||||
let(:admin_api_client) { Runtime::API::Client.as_admin }
|
||||
let(:user) do
|
||||
|
@ -46,7 +46,11 @@ module QA
|
|||
sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER)
|
||||
end
|
||||
|
||||
after do
|
||||
after do |example|
|
||||
# Checking for failures in the test currently makes test very flaky due to catching unrelated failures
|
||||
# Just log in case of failure until cause of network errors is found
|
||||
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/346500
|
||||
Runtime::Logger.warn(import_failures) if example.exception && !import_failures.empty?
|
||||
user.remove_via_api!
|
||||
end
|
||||
|
||||
|
@ -94,8 +98,6 @@ module QA
|
|||
|
||||
expect(imported_subgroup.reload!).to eq(subgroup)
|
||||
expect(imported_subgroup.labels).to include(*subgroup.labels)
|
||||
|
||||
expect(import_failures).to be_empty, "Expected no errors, received: #{import_failures}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -135,8 +137,6 @@ module QA
|
|||
expect(imported_milestone.updated_at).to eq(source_milestone.updated_at)
|
||||
|
||||
expect(imported_group.badges).to eq(source_group.badges)
|
||||
|
||||
expect(import_failures).to be_empty, "Expected no errors, received: #{import_failures}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -171,7 +171,6 @@ module QA
|
|||
aggregate_failures do
|
||||
expect(imported_member).not_to be_nil
|
||||
expect(imported_member.access_level).to eq(Resource::Members::AccessLevel::DEVELOPER)
|
||||
expect(import_failures).to be_empty, "Expected no errors, received: #{import_failures}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
root_path="$(cd "$(dirname "$0")/.." || exit ; pwd -P)"
|
||||
|
||||
if [[ -d "${root_path}/ee/" ]]; then
|
||||
if [[ -d "${root_path}/ee/" || "${GITLAB_MIGRATE_MAIN_ONLY}" == "true" ]]; then
|
||||
task="db:migrate:main"
|
||||
else
|
||||
task="db:migrate"
|
||||
|
|
Loading…
Reference in a new issue