Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
d4aa95428e
commit
d380b256b9
|
|
@ -1,10 +1,11 @@
|
|||
<!-- Title suggestion: Upgrade `gilab-styles` to <VERSION X.Y.Z> - dry-run -->
|
||||
<!-- Title suggestion: Upgrade `gitlab-styles` to <VERSION X.Y.Z> - dry-run -->
|
||||
|
||||
## What does this MR do and why?
|
||||
|
||||
Validating upcoming release of `gitlab-styles` <VERSION X.Y.Z>. See <LINK TO RELEASE MR>.
|
||||
|
||||
This MR can be reused to upgrade `gitlab-styles` in this project after a new version of `gitlab-styles` is released.
|
||||
|
||||
### Checklist
|
||||
|
||||
- [ ] Verify upcoming release of `gitlab-styles`
|
||||
|
|
@ -13,8 +14,8 @@ This MR can be reused to upgrade `gitlab-styles` in this project after a new ver
|
|||
- [ ] Update [bundler's checksum file](https://docs.gitlab.com/ee/development/gemfile.html#updating-the-checksum-file) via `bundle exec bundler-checksum init`
|
||||
- [ ] `rubocop` job
|
||||
- [ ] Inspect any warnings/errors
|
||||
- [ ] (Optional) [Generate TODOs](https://docs.gitlab.com/ee/development/contributing/style_guides.html#resolving-rubocop-exceptions) for pending offenses
|
||||
- [ ] Put :new: cop rules (or if configuration is changed) in "grace period". See [docs](https://docs.gitlab.com/ee/development/contributing/style_guides.html#enabling-a-new-cop).
|
||||
- [ ] (Optional) [Generate TODOs](https://docs.gitlab.com/ee/development/rubocop_development_guide.html#resolving-rubocop-exceptions) for pending offenses
|
||||
- [ ] Put :new: cop rules (or if configuration is changed) in "grace period". See [docs](https://docs.gitlab.com/ee/development/rubocop_development_guide.html#enabling-a-new-cop).
|
||||
- [ ] (Optional) Remove any offenses for disabled cops
|
||||
- Use `grep --perl-regexp -o ":\d+\d+: \w: \[\S+\] ([\w/]+)" raw_job_output.log | awk '{print $4}' | sort | uniq -c` to get a list of cop rules with offenses. Where `raw_job_output.log` is the raw output of the `rubocop` job
|
||||
- [ ] Ignore offenses related to temporary changes in `Gemfile`
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
50c8cb6e62396936c9e568e859dd717595281788
|
||||
0ec4abd0c0b834dd49144c0821e056baaf8fe025
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@
|
|||
padding: 0;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
line-height: 34px;
|
||||
line-height: $gl-line-height-32;
|
||||
margin: 0;
|
||||
|
||||
a {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class Event < ApplicationRecord
|
|||
scope :recent, -> { reorder(id: :desc) }
|
||||
scope :for_wiki_page, -> { where(target_type: 'WikiPage::Meta') }
|
||||
scope :for_design, -> { where(target_type: 'DesignManagement::Design') }
|
||||
scope :for_issue, -> { where(target_type: ISSUE_TYPES) }
|
||||
scope :for_fingerprint, ->(fingerprint) do
|
||||
fingerprint.present? ? where(fingerprint: fingerprint) : none
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class MemberRole < ApplicationRecord # rubocop:disable Gitlab/NamespacedClass
|
|||
validates :base_access_level, presence: true
|
||||
validate :belongs_to_top_level_namespace
|
||||
validate :validate_namespace_locked, on: :update
|
||||
validate :attributes_locked_after_member_associated, on: :update
|
||||
|
||||
validates_associated :members
|
||||
|
||||
|
|
@ -27,4 +28,11 @@ class MemberRole < ApplicationRecord # rubocop:disable Gitlab/NamespacedClass
|
|||
|
||||
errors.add(:namespace, s_("MemberRole|can't be changed"))
|
||||
end
|
||||
|
||||
def attributes_locked_after_member_associated
|
||||
return unless members.present?
|
||||
|
||||
errors.add(:base, s_("MemberRole|cannot be changed because it is already assigned to a user. "\
|
||||
"Please create a new Member Role instead"))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,16 +3,20 @@
|
|||
module Import
|
||||
module Github
|
||||
class GistsImportService < ::BaseService
|
||||
def initialize(user, params)
|
||||
def initialize(user, client, params)
|
||||
@current_user = user
|
||||
@params = params
|
||||
@client = client
|
||||
end
|
||||
|
||||
def execute
|
||||
return error('Import already in progress', 422) if import_status.started?
|
||||
|
||||
check_user_token
|
||||
start_import
|
||||
success
|
||||
rescue Octokit::Unauthorized
|
||||
error('Access denied to the GitHub account.', 401)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
@ -29,6 +33,10 @@ module Import
|
|||
Gitlab::GithubGistsImport::StartImportWorker.perform_async(current_user.id, encrypted_token)
|
||||
import_status.start!
|
||||
end
|
||||
|
||||
def check_user_token
|
||||
@client.octokit.user.present?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
- if event.note?
|
||||
= link_to event.note_target.to_reference, event_note_target_url(event), class: 'has-tooltip', title: event.target_title
|
||||
- elsif event.target
|
||||
= link_to event.target.to_reference, [event.project, event.target], class: 'has-tooltip', title: event.target_title
|
||||
= link_to event.target.to_reference, Gitlab::UrlBuilder.build(event.target, only_path: true), class: 'has-tooltip', title: event.target_title
|
||||
|
||||
= s_('UserProfile|at')
|
||||
%strong
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: ci_minutes_additional_packs
|
|||
classes:
|
||||
- Ci::Minutes::AdditionalPack
|
||||
feature_categories:
|
||||
- utilization
|
||||
- purchase
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62393
|
||||
milestone: '14.0'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: ci_namespace_mirrors
|
|||
classes:
|
||||
- Ci::NamespaceMirror
|
||||
feature_categories:
|
||||
- sharding
|
||||
- pods
|
||||
description: Mirrors some data from the `main` database into the `ci` database so that we can join directly in a single query
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75621
|
||||
milestone: '14.6'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: ci_project_mirrors
|
|||
classes:
|
||||
- Ci::ProjectMirror
|
||||
feature_categories:
|
||||
- sharding
|
||||
- pods
|
||||
description: Mirrors some data from the `main` database into the `ci` database so that we can join directly in a single query
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75621
|
||||
milestone: '14.6'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: clusters_applications_cilium
|
|||
classes:
|
||||
- Clusters::Applications::Cilium
|
||||
feature_categories:
|
||||
- container_network_security
|
||||
- security_policy_management
|
||||
description: Information about installed instance of Cilium in the cluster
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34601
|
||||
milestone: '13.2'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: elastic_reindexing_slices
|
|||
classes:
|
||||
- Elastic::ReindexingSlice
|
||||
feature_categories:
|
||||
- memory
|
||||
- application_performance
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55681
|
||||
milestone: '13.12'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: elasticsearch_indexed_projects
|
|||
classes:
|
||||
- ElasticsearchIndexedProject
|
||||
feature_categories:
|
||||
- memory
|
||||
- application_performance
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9861
|
||||
milestone: '11.10'
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ table_name: historical_data
|
|||
classes:
|
||||
- HistoricalData
|
||||
feature_categories:
|
||||
- utilization
|
||||
- sm_provisioning
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/85c04a8aa654d1b7f898e55a113e50521bacaaf2
|
||||
introduced_by_url: https://dev.gitlab.org/gitlab/gitlab-ee/-/merge_requests/390
|
||||
milestone: '7.11'
|
||||
gitlab_schema: gitlab_main
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: loose_foreign_keys_deleted_records
|
|||
classes:
|
||||
- LooseForeignKeys::DeletedRecord
|
||||
feature_categories:
|
||||
- sharding
|
||||
- pods
|
||||
description: Used by the loose foreign keys feature as a queue of parent records whose child records (via foreign keys) need to be deleted/nullified
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70152
|
||||
milestone: '14.3'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ classes:
|
|||
- Ml::CandidateMetadata
|
||||
feature_categories:
|
||||
- mlops
|
||||
- incubation
|
||||
gitlab_schema: gitlab_main
|
||||
description: A Candidate Metadata record holds extra information about the candidate
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104267
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ classes:
|
|||
- Ml::CandidateMetric
|
||||
feature_categories:
|
||||
- mlops
|
||||
- incubation
|
||||
description: Metrics recorded for a Machine Learning model candidate
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168
|
||||
milestone: '15.4'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ classes:
|
|||
- Ml::CandidateParams
|
||||
feature_categories:
|
||||
- mlops
|
||||
- incubation
|
||||
description: Configuration parameters recorded for a Machine Learning model candidate
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168
|
||||
milestone: '15.4'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ classes:
|
|||
- Ml::Candidate
|
||||
feature_categories:
|
||||
- mlops
|
||||
- incubation
|
||||
description: A Model Candidate is a record of the results on training a model on some configuration
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168
|
||||
milestone: '15.4'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ classes:
|
|||
- Ml::ExperimentMetadata
|
||||
feature_categories:
|
||||
- mlops
|
||||
- incubation
|
||||
gitlab_schema: gitlab_main
|
||||
description: An Experiment Metadata record holds extra information about the experiment
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104267
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ classes:
|
|||
- Ml::Experiment
|
||||
feature_categories:
|
||||
- mlops
|
||||
- incubation
|
||||
description: A Machine Learning Experiments groups many Model Candidates
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168
|
||||
milestone: '15.4'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: namespace_aggregation_schedules
|
|||
classes:
|
||||
- Namespace::AggregationSchedule
|
||||
feature_categories:
|
||||
- utilization
|
||||
- subscription_cost_management
|
||||
description: Keeps update schedules for namespace_root_storage_statistics
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29570
|
||||
milestone: '12.1'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: namespace_limits
|
|||
classes:
|
||||
- NamespaceLimit
|
||||
feature_categories:
|
||||
- utilization
|
||||
- subscription_cost_management
|
||||
description: Contains limits for namespace features like storage and ci
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34746
|
||||
milestone: '13.2'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: namespace_root_storage_statistics
|
|||
classes:
|
||||
- Namespace::RootStorageStatistics
|
||||
feature_categories:
|
||||
- utilization
|
||||
- application_instrumentation
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/bde41ee866d0fe0b1bb5ece1130fb6e24d95ad17
|
||||
milestone: '12.1'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: namespace_statistics
|
|||
classes:
|
||||
- NamespaceStatistics
|
||||
feature_categories:
|
||||
- utilization
|
||||
- application_instrumentation
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/48d8bdca0493056a717cd7d9fee2e8b51d6b0502
|
||||
milestone: '9.0'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: namespaces_sync_events
|
|||
classes:
|
||||
- Namespaces::SyncEvent
|
||||
feature_categories:
|
||||
- sharding
|
||||
- pods
|
||||
description: Used as a queue of data that needs to be synchronized between the `ci` and `main` database
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75517
|
||||
milestone: '14.6'
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ classes:
|
|||
- SyntheticNote
|
||||
- WeightNote
|
||||
feature_categories:
|
||||
- code_review
|
||||
- code_review_workflow
|
||||
- portfolio_management
|
||||
- service_desk
|
||||
- snippets
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: operations_feature_flags
|
|||
classes:
|
||||
- Operations::FeatureFlag
|
||||
feature_categories:
|
||||
- release
|
||||
- feature_flags
|
||||
description: TODO
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/7433
|
||||
milestone: '11.4'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: project_statistics
|
|||
classes:
|
||||
- ProjectStatistics
|
||||
feature_categories:
|
||||
- utilization
|
||||
- application_instrumentation
|
||||
description: Records statistics about the usage of various product features
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7754
|
||||
milestone: '8.16'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: projects_sync_events
|
|||
classes:
|
||||
- Projects::SyncEvent
|
||||
feature_categories:
|
||||
- sharding
|
||||
- pods
|
||||
description: Used as a queue of data that needs to be synchronized between the `ci` and `main` database
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75517
|
||||
milestone: '14.6'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: security_orchestration_policy_configurations
|
|||
classes:
|
||||
- Security::OrchestrationPolicyConfiguration
|
||||
feature_categories:
|
||||
- security_orchestration
|
||||
- security_policy_management
|
||||
description: |
|
||||
Relates a Project/Namespace and Security Orchestration Policy Project, where Security
|
||||
Policies are stored in the repository as a YAML file.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: security_orchestration_policy_rule_schedules
|
|||
classes:
|
||||
- Security::OrchestrationPolicyRuleSchedule
|
||||
feature_categories:
|
||||
- security_orchestration
|
||||
- security_policy_management
|
||||
description: |
|
||||
Security policies scheduled to run based on cadence defined in the policy
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59842
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: uploads
|
|||
classes:
|
||||
- Upload
|
||||
feature_categories:
|
||||
- code_review
|
||||
- code_review_workflow
|
||||
- design_management
|
||||
- importers
|
||||
- portfolio_management
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ table_name: user_highest_roles
|
|||
classes:
|
||||
- UserHighestRole
|
||||
feature_categories:
|
||||
- utilization
|
||||
description: TODO
|
||||
- authentication_and_authorization
|
||||
description: Stores highest role per User they have in a Group or a Project. If a User has an open invite or pending access request or no membership the highest role will be set to nil.
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26987
|
||||
milestone: '12.9'
|
||||
gitlab_schema: gitlab_main
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: users_statistics
|
|||
classes:
|
||||
- UsersStatistics
|
||||
feature_categories:
|
||||
- utilization
|
||||
- application_instrumentation
|
||||
description: User statistics
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26261
|
||||
milestone: '12.9'
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ exceptions:
|
|||
- CSS
|
||||
- CSV
|
||||
- CTE
|
||||
- CWE
|
||||
- CVE
|
||||
- CVS
|
||||
- CVSS
|
||||
- CWE
|
||||
- DAG
|
||||
- DAST
|
||||
- DDL
|
||||
|
|
@ -148,6 +148,7 @@ exceptions:
|
|||
- NTP
|
||||
- OCI
|
||||
- OKD
|
||||
- OKR
|
||||
- ONLY
|
||||
- OSS
|
||||
- OTP
|
||||
|
|
|
|||
|
|
@ -547,8 +547,8 @@ Mattermost
|
|||
mbox
|
||||
memoization
|
||||
memoize
|
||||
memoizes
|
||||
memoized
|
||||
memoizes
|
||||
memoizing
|
||||
Memorystore
|
||||
mergeability
|
||||
|
|
@ -589,8 +589,8 @@ mutex
|
|||
nameserver
|
||||
nameservers
|
||||
namespace
|
||||
namespaced
|
||||
namespace's
|
||||
namespaced
|
||||
namespaces
|
||||
namespacing
|
||||
namespacings
|
||||
|
|
@ -620,6 +620,7 @@ offboarding
|
|||
offboards
|
||||
OIDs
|
||||
OKRs
|
||||
OKRs
|
||||
Okta
|
||||
OmniAuth
|
||||
onboarding
|
||||
|
|
@ -639,12 +640,12 @@ Packwerk
|
|||
paginator
|
||||
parallelization
|
||||
parallelizations
|
||||
parsable
|
||||
PascalCase
|
||||
PascalCased
|
||||
passthrough
|
||||
passthroughs
|
||||
passwordless
|
||||
parsable
|
||||
Patroni
|
||||
PDFs
|
||||
performant
|
||||
|
|
@ -827,8 +828,8 @@ Salesforce
|
|||
sandboxing
|
||||
sanitization
|
||||
SBOMs
|
||||
SBT
|
||||
sbt
|
||||
SBT
|
||||
scalers
|
||||
scatterplot
|
||||
scatterplots
|
||||
|
|
|
|||
|
|
@ -116,6 +116,38 @@ Returns the following status codes:
|
|||
- `400 Bad Request`: the project import cannot be canceled.
|
||||
- `404 Not Found`: the project associated with `project_id` does not exist.
|
||||
|
||||
## Import GitHub gists into GitLab snippets
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371099) in GitLab 15.8.
|
||||
|
||||
You can use the GitLab API to import personal GitHub gists (with up to 10 files) into personal GitLab snippets.
|
||||
GitHub gists with more than 10 files are skipped. You should manually migrate these GitHub gists.
|
||||
|
||||
```plaintext
|
||||
POST /import/github/gists
|
||||
```
|
||||
|
||||
| Attribute | Type | Required | Description |
|
||||
|------------|---------|----------|---------------------|
|
||||
| `personal_access_token` | string | yes | GitHub personal access token |
|
||||
|
||||
```shell
|
||||
curl --request POST \
|
||||
--url "https://gitlab.example.com/api/v4/import/github/gists" \
|
||||
--header "content-type: application/json" \
|
||||
--header "PRIVATE-TOKEN: <your_gitlab_access_token>" \
|
||||
--data '{
|
||||
"personal_access_token": "<your_github_personal_access_token>"
|
||||
}'
|
||||
```
|
||||
|
||||
Returns the following status codes:
|
||||
|
||||
- `202 Accepted`: the gists import is being started.
|
||||
- `401 Unauthorized`: user's GitHub personal access token is invalid.
|
||||
- `422 Unprocessable Entity`: the gists import is already in progress.
|
||||
- `429 Too Many Requests`: the user has exceeded GitHub's rate limit.
|
||||
|
||||
## Import repository from Bitbucket Server
|
||||
|
||||
Import your projects from Bitbucket Server to GitLab via the API.
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ You can include an array of configuration files:
|
|||
- template: Auto-DevOps.gitlab-ci.yml
|
||||
```
|
||||
|
||||
- You can define an array that combines both default and specific `include` type:
|
||||
- You can define an array that combines both default and specific `include` types:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
|
|
@ -333,52 +333,82 @@ see this [CI/CD variable demo](https://youtu.be/4XR8gw3Pkos).
|
|||
## Use `rules` with `include`
|
||||
|
||||
> - Introduced in GitLab 14.2 [with a flag](../../administration/feature_flags.md) named `ci_include_rules`. Disabled by default.
|
||||
> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) in GitLab 14.3.
|
||||
> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) GitLab 14.3.
|
||||
> - [Feature flag `ci_include_rules` removed](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) in GitLab 14.4.
|
||||
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) in GitLab 14.4.
|
||||
> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) in GitLab 14.3.
|
||||
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) in GitLab 14.4. Feature flag `ci_include_rules` removed.
|
||||
> - [Support for `exists` keyword added](https://gitlab.com/gitlab-org/gitlab/-/issues/341511) in GitLab 14.5.
|
||||
|
||||
You can use [`rules`](index.md#rules) with `include` to conditionally include other configuration files.
|
||||
|
||||
You can only use the following rules with `include` (and only with [certain variables](#use-variables-with-include)):
|
||||
You can only use `rules` with [certain variables](#use-variables-with-include), and
|
||||
these keywords:
|
||||
|
||||
- [`if` rules](index.md#rulesif). For example:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
- local: builds.yml
|
||||
rules:
|
||||
- if: $INCLUDE_BUILDS == "true"
|
||||
- local: deploys.yml
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script: exit 0
|
||||
```
|
||||
|
||||
- [`exists` rules](index.md#rulesexists). For example:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
- local: builds.yml
|
||||
rules:
|
||||
- exists:
|
||||
- file.md
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script: exit 0
|
||||
```
|
||||
|
||||
`rules` keyword `changes` is not supported.
|
||||
- [`rules:if`](index.md#rulesif).
|
||||
- [`rules:exists`](index.md#rulesexists).
|
||||
|
||||
You cannot use [`needs:`](index.md#needs) to create a job dependency that points to
|
||||
a job added with `include:local:rules`. When the configuration is checked for validity,
|
||||
GitLab returns `undefined need: <job-name>`. An [issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/345377)
|
||||
to improve this behavior.
|
||||
a job added with `include:local:rules`. When the configuration is validated,
|
||||
GitLab returns `undefined need: <job-name>`. [Issue 345377](https://gitlab.com/gitlab-org/gitlab/-/issues/345377)
|
||||
proposes improving this behavior.
|
||||
|
||||
### `include` with `rules:if`
|
||||
|
||||
Use [`rules:if`](index.md#rulesif) to conditionally include other configuration files
|
||||
based on the status of CI/CD variables. For example:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
- local: builds.yml
|
||||
rules:
|
||||
- if: $INCLUDE_BUILDS == "true"
|
||||
- local: deploys.yml
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script: exit 0
|
||||
```
|
||||
|
||||
### `include` with `rules:exists`
|
||||
|
||||
Use [`rules:exists`](index.md#rulesexists) to conditionally include other configuration files
|
||||
based on the existence of files. For example:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
- local: builds.yml
|
||||
rules:
|
||||
- exists:
|
||||
- file.md
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script: exit 0
|
||||
```
|
||||
|
||||
In this example, GitLab checks for the existence of `file.md` in the current project.
|
||||
|
||||
There is a known issue if you configure `include` with `rules:exists` to add a configuration file
|
||||
from a different project. GitLab checks for the existence of the file in the _other_ project.
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
- project: my-group/my-project-2
|
||||
ref: main
|
||||
file: test-file.yml
|
||||
rules:
|
||||
- exists:
|
||||
- file.md
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script: exit 0
|
||||
```
|
||||
|
||||
In this example, GitLab checks for the existence of `test-file.yml` in `my-group/my-project-2`,
|
||||
not the current project. Follow [issue 386040](https://gitlab.com/gitlab-org/gitlab/-/issues/386040)
|
||||
for information about work to improve this behavior.
|
||||
|
||||
## Use `include:local` with wildcard file paths
|
||||
|
||||
|
|
|
|||
|
|
@ -58,3 +58,4 @@ Align your work across teams.
|
|||
- [View health status](../user/project/issues/managing_issues.md#health-status)
|
||||
- [Roadmaps](../user/group/roadmap/index.md)
|
||||
- [Planning hierarchies](../user/group/planning_hierarchy/index.md)
|
||||
- [Objectives and key results](../user/okrs.md)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
---
|
||||
stage: Plan
|
||||
group: Product Planning
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# Objectives and key results (OKR) **(ULTIMATE)**
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103355) in GitLab 15.6 [with a flag](../administration/feature_flags.md) named `okrs_mvc`. Disabled by default.
|
||||
|
||||
WARNING:
|
||||
OKRs are in [**Alpha**](../policy/alpha-beta-support.md#alpha-features).
|
||||
For the OKR feature roadmap, see [epic 7864](https://gitlab.com/groups/gitlab-org/-/epics/7864).
|
||||
|
||||
FLAG:
|
||||
On self-managed GitLab, by default this feature is not available. To make it available,
|
||||
ask an administrator to [enable the featured flag](../administration/feature_flags.md) named `okrs_mvc`.
|
||||
The feature is not ready for production use.
|
||||
|
||||
Use objectives and key results to align your workforce towards common goals and track the progress.
|
||||
Set a big goal with an objective and use [child objectives and key results](#child-objectives-and-key-results)
|
||||
to measure the big goal's completion.
|
||||
|
||||
The objective and the key result in GitLab share many features. In the documentation, the term
|
||||
**OKR** refers to either an objective or a key result.
|
||||
|
||||
OKRs are a type of work item, a step towards [default issue types](https://gitlab.com/gitlab-org/gitlab/-/issues/323404)
|
||||
in GitLab.
|
||||
For the roadmap of migrating [issues](project/issues/index.md) and [epics](group/epics/index.md)
|
||||
to work items and adding custom work item types, see
|
||||
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or the
|
||||
[Plan direction page](https://about.gitlab.com/direction/plan/).
|
||||
|
||||
## Create an objective
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Guest role for the project.
|
||||
|
||||
To create an objective:
|
||||
|
||||
1. On the top bar, select **Main menu > Projects** and find your project.
|
||||
1. On the left sidebar, select **Issues**.
|
||||
1. In the top right corner, next to **New issue**, select the down arrow **{chevron-lg-down}** and then select **New objective**.
|
||||
1. Select **New objective** again.
|
||||
1. Enter the objective title.
|
||||
1. Select **Create objective**.
|
||||
|
||||
To create a key result, [add it as a child](#add-a-child-key-result) to an existing objective.
|
||||
|
||||
## View an objective
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Guest role for the project.
|
||||
|
||||
To view an objective:
|
||||
|
||||
1. On the top bar, select **Main menu > Projects** and find your project.
|
||||
1. On the left sidebar, select **Issues**.
|
||||
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
|
||||
for `Type = objective`.
|
||||
1. Select the title of an objective from the list.
|
||||
|
||||
## View a key result
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Guest role for the project.
|
||||
|
||||
To view a key result:
|
||||
|
||||
1. On the top bar, select **Main menu > Projects** and find your project.
|
||||
1. On the left sidebar, select **Issues**.
|
||||
1. [Filter the list of issues](project/issues/managing_issues.md#filter-the-list-of-issues)
|
||||
for `Type = key_result`.
|
||||
1. Select the title of a key result from the list.
|
||||
|
||||
Alternatively, you can access a key result from the **Child objectives and key results** section in
|
||||
its parent's objective.
|
||||
|
||||
## Edit title and description
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To edit an OKR:
|
||||
|
||||
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
|
||||
1. Optional. To edit the title, select it, make your changes, and select any area outside the title
|
||||
text box.
|
||||
1. Optional. To edit the description, select the edit icon (**{pencil}**), make your changes, and
|
||||
select **Save**.
|
||||
|
||||
## Assign users
|
||||
|
||||
To show who is responsible for an OKR, you can assign users to it.
|
||||
|
||||
Users on GitLab Free can assign one user per OKR.
|
||||
Users on GitLab Premium and higher can assign multiple users to a single OKR.
|
||||
See also [multiple assignees for issues](project/issues/multiple_assignees_for_issues.md).
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To change the assignee on an OKR:
|
||||
|
||||
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
|
||||
1. Next to **Assignees**, select **Add assignees**.
|
||||
1. From the dropdown list, select the users to add as an assignee.
|
||||
1. Select any area outside the dropdown list.
|
||||
|
||||
## Assign labels
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
Use [labels](project/labels.md) to organize OKRs among teams.
|
||||
|
||||
To add labels to an OKR:
|
||||
|
||||
1. [Open the objective](okrs.md#view-an-objective) or [key result](#view-a-key-result) that you want to edit.
|
||||
1. Next to **Labels**, select **Add labels**.
|
||||
1. From the dropdown list, select the labels to add.
|
||||
1. Select any area outside the dropdown list.
|
||||
|
||||
## Add an objective to a milestone
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367463) in GitLab 15.7.
|
||||
|
||||
You can add an objective to a [milestone](project/milestones/index.md).
|
||||
You can see the milestone title when you view an objective.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To add an objective to a milestone:
|
||||
|
||||
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
|
||||
1. Next to **Milestone**, select **Add to milestone**.
|
||||
If an objective already belongs to a milestone, the dropdown list shows the current milestone.
|
||||
1. From the dropdown list, select the milestone to be associated with the objective.
|
||||
|
||||
## Set objective progress
|
||||
|
||||
Show how much of the work needed to achieve an objective is finished.
|
||||
|
||||
You can only set progress manually on objectives, and it's not rolled up from child objectives or
|
||||
key results.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To set progress of an objective:
|
||||
|
||||
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
|
||||
1. Next to **Progress**, select the text box.
|
||||
1. Enter a number from 0 to 100.
|
||||
|
||||
## Set health status
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381899) in GitLab 15.7.
|
||||
|
||||
To better track the risk in meeting your goals, you can assign a [health status](project/issues/managing_issues.md#health-status)
|
||||
to each objective and key result.
|
||||
You can use health status to signal to others in your organization whether OKRs are progressing
|
||||
as planned or need attention to stay on schedule.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To set health status of an OKR:
|
||||
|
||||
1. [Open the key result](okrs.md#view-a-key-result) that you want to edit.
|
||||
1. Next to **Health status**, select the dropdown list and select the desired health status.
|
||||
|
||||
## Close an OKR
|
||||
|
||||
When an OKR is achieved, you can close it.
|
||||
The OKR is marked as closed but is not deleted.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To close an OKR:
|
||||
|
||||
1. [Open the objective](okrs.md#view-an-objective) that you want to edit.
|
||||
1. Next to **Status**, select **Closed**.
|
||||
|
||||
You can reopen a closed OKR the same way.
|
||||
|
||||
## Child objectives and key results
|
||||
|
||||
In GitLab, objectives are similar to key results.
|
||||
In your workflow, use key results to measure the goal described in the objective.
|
||||
|
||||
You can add child objectives to a total of 9 levels. An objective can have up to 100 child OKRs.
|
||||
Key results are children of objectives and cannot have children items themselves.
|
||||
|
||||
Child objectives and key results are available in the **Child objectives and key results** section
|
||||
below an objective's description.
|
||||
|
||||
### Add a child objective
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Guest role for the project.
|
||||
|
||||
To add a new objective to an objective:
|
||||
|
||||
1. In an objective, in the **Child objectives and key results** section, select **Add** and then
|
||||
select **New objective**.
|
||||
1. Enter a title for the new objective.
|
||||
1. Select **Create objective**.
|
||||
|
||||
To add an existing objective to an objective:
|
||||
|
||||
1. In an objective, in the **Child objectives and key results** section, select **Add** and then
|
||||
select **Existing objective**.
|
||||
1. Search for the desired objective by entering part of its title, then selecting the
|
||||
desired match.
|
||||
|
||||
To add multiple objectives, repeat this step.
|
||||
1. Select **Add objective**.
|
||||
|
||||
### Add a child key result
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Guest role for the project.
|
||||
|
||||
To add a new key result to an objective:
|
||||
|
||||
1. In an objective, in the **Child objectives and key results** section, select **Add** and then
|
||||
select **New key result**.
|
||||
1. Enter a title for the new key result.
|
||||
1. Select **Create key result**.
|
||||
|
||||
To add an existing key result to an objective:
|
||||
|
||||
1. In an objective, in the **Child objectives and key results** section, select **Add** and then
|
||||
select **Existing key result**.
|
||||
1. Search for the desired OKR by entering part of its title, then selecting the
|
||||
desired match.
|
||||
|
||||
To add multiple objectives, repeat this step.
|
||||
1. Select **Add key result**.
|
||||
|
|
@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
|||
|
||||
# Remote Development **(FREE)**
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95169) in GitLab 15.6 [with a flag](../../../administration/feature_flags.md) named `vscode_web_ide`. Disabled by default.
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95169) in GitLab 15.4 [with a flag](../../../administration/feature_flags.md) named `vscode_web_ide`. Disabled by default.
|
||||
|
||||
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 `vscode_web_ide`. On GitLab.com, this feature is available. The feature is not ready for production use.
|
||||
|
|
@ -22,7 +22,7 @@ As with all projects, the items mentioned on this page are subject to change or
|
|||
The development, release, and timing of any products, features, or functionality remain at the
|
||||
sole discretion of GitLab Inc.
|
||||
|
||||
You can use the [Web IDE](../web_ide/index.md) to commit changes to a project directly from your web browser without installing any dependencies or cloning any repositories. The Web IDE, however, lacks a native runtime environment on which you would compile code, run tests, or generate real-time feedback in the IDE. For a more complete IDE experience, you can pair the Web IDE with a Remote Development environment that has been properly configured to run as a host.
|
||||
You can use the [Web IDE](../web_ide/index.md) to commit changes to a project directly from your web browser without installing any dependencies or cloning any repositories. The Web IDE, however, lacks a native runtime environment on which you would compile code, run tests, or generate real-time feedback in the IDE. For a more complete IDE experience, you can pair the [Web IDE Beta](../web_ide_beta/index.md) with a Remote Development environment that has been properly configured to run as a host.
|
||||
|
||||
## Connect a remote machine to the Web IDE
|
||||
|
||||
|
|
@ -154,3 +154,8 @@ Alternatively, you can pass the parameters from a URL and connect directly to th
|
|||
```
|
||||
|
||||
1. Go to that URL and enter the [token you fetched](#fetch-a-token).
|
||||
|
||||
## Related topics
|
||||
|
||||
- [Web IDE](../web_ide/index.md)
|
||||
- [Web IDE Beta](../web_ide_beta/index.md)
|
||||
|
|
|
|||
|
|
@ -446,13 +446,12 @@ when:
|
|||
- You select any area outside the file editor after editing a file.
|
||||
- A file or folder is created, deleted, or renamed.
|
||||
|
||||
### Limitations
|
||||
### Known issues
|
||||
|
||||
The Web IDE has a few limitations:
|
||||
|
||||
- Interactive Terminals is in a beta phase and continues to be improved in upcoming releases. In the meantime, the user is limited to having only one
|
||||
active terminal at a time.
|
||||
|
||||
- LFS files can be rendered and displayed but they cannot be updated and committed using the Web IDE. If an LFS file is modified and pushed to the repository, the LFS pointer in the repository is overwritten with the modified LFS file content.
|
||||
|
||||
### Troubleshooting
|
||||
|
|
@ -463,3 +462,7 @@ The Web IDE has a few limitations:
|
|||
- If the terminal displays **Connection Failure**, then the terminal could not
|
||||
connect to the runner. Try to stop and restart the terminal. If the
|
||||
problem persists, double check your runner configuration.
|
||||
|
||||
## Related topics
|
||||
|
||||
- [Web IDE Beta](../web_ide_beta/index.md)
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
|||
|
||||
# Web IDE Beta **(FREE)**
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95169) in GitLab 15.4 [with a flag](../../../administration/feature_flags.md) named `vscode_web_ide`. Disabled by default.
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95169) in GitLab 15.7 [with a flag](../../../administration/feature_flags.md) named `vscode_web_ide`. Disabled by default.
|
||||
|
||||
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 `vscode_web_ide`. On GitLab.com, this feature is available.
|
||||
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 `vscode_web_ide`. On GitLab.com, this feature is available. The feature is not ready for production use.
|
||||
|
||||
As announced in [this blog post](https://about.gitlab.com/blog/2022/05/23/the-future-of-the-gitlab-web-ide/),
|
||||
the current implementation of the Web IDE is being replaced with an
|
||||
implementation inspired by Visual Studio Code.
|
||||
the current implementation of the [Web IDE](../web_ide/index.md) is being replaced
|
||||
with an implementation inspired by Visual Studio Code. This effort is still under
|
||||
development. For updates, see [this epic](https://gitlab.com/groups/gitlab-org/-/epics/7683).
|
||||
|
||||
This effort is currently under development. For updates,
|
||||
see [this epic](https://gitlab.com/groups/gitlab-org/-/epics/7683).
|
||||
To connect a remote machine to the Web IDE Beta, see [Remote Development](../remote_development/index.md).
|
||||
|
||||
## Enable the Web IDE Beta
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ To open the Web IDE Beta from anywhere in the UI:
|
|||
- Use the <kbd>.</kbd> [keyboard shortcut](../../shortcuts.md).
|
||||
|
||||
You can also open the Web IDE Beta when viewing a file, the repository file list,
|
||||
and from merge requests.
|
||||
or a merge request.
|
||||
|
||||
### Use when viewing a file or the repository file list
|
||||
|
||||
|
|
@ -59,41 +59,32 @@ To open the Web IDE Beta from a merge request:
|
|||
|
||||
To open any file by its name:
|
||||
|
||||
1. Type **Command** + **`P`** (<kbd>⌘</kbd> + <kbd>P</kbd>).
|
||||
1. Type the name of your file.
|
||||
1. Press <kbd>Command</kbd>+<kbd>P</kbd>.
|
||||
1. Enter the name of your file.
|
||||
|
||||

|
||||
|
||||
## Search across files
|
||||
|
||||
You can use VS Code to quickly search all files in the currently opened folder.
|
||||
You can use VS Code to quickly search all files in the opened folder.
|
||||
|
||||
To enter your search term:
|
||||
To search across files:
|
||||
|
||||
1. Type **Shift** + **Command** + **`F`** (<kbd>⇧</kbd> + <kbd>⌘</kbd> + <kbd>F</kbd>).
|
||||
1. Press <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>F</kbd>.
|
||||
1. Enter your search term.
|
||||
|
||||
In the Web IDE Beta, only partial results from opened files are displayed.
|
||||
Full file search is planned for a later date.
|
||||
|
||||
## View list of changed files
|
||||
## View a list of changed files
|
||||
|
||||
To view the list of files you changed in the Web IDE Beta:
|
||||
To view a list of files you changed in the Web IDE Beta,
|
||||
in the Activity Bar on the left, select **Source Control**.
|
||||
Your `CHANGES`, `STAGED CHANGES`, and `MERGE CHANGES` are displayed.
|
||||
|
||||
- On the VS Code Activity Bar, on the left, select the Source Control icon:
|
||||
For details, see the [VS Code documentation](https://code.visualstudio.com/docs/sourcecontrol/overview#_commit).
|
||||
|
||||
Your `CHANGES`, `STAGED CHANGES` and `MERGE CHANGES` are displayed.
|
||||
|
||||
For details, see [the VS Code documentation](https://code.visualstudio.com/docs/sourcecontrol/overview#_commit).
|
||||
|
||||
## Known issues
|
||||
|
||||
The [Web Terminal](../web_ide/index.md#interactive-web-terminals-for-the-web-ide)
|
||||
and [Live Preview](../web_ide/index.md#live-preview) are not available in the Web IDE Beta.
|
||||
|
||||
These features may become available at a later date.
|
||||
|
||||
### Stop using the Web IDE Beta
|
||||
## Stop using the Web IDE Beta
|
||||
|
||||
If you do not want to use the Web IDE Beta, you can change your personal preferences.
|
||||
|
||||
|
|
@ -101,3 +92,15 @@ If you do not want to use the Web IDE Beta, you can change your personal prefere
|
|||
1. Select **Preferences**.
|
||||
1. In the **Web IDE** section, select the **Opt out of the Web IDE Beta** checkbox.
|
||||
1. Select **Save changes**.
|
||||
|
||||
## Known issues
|
||||
|
||||
The [Web Terminal](../web_ide/index.md#interactive-web-terminals-for-the-web-ide)
|
||||
and [Live Preview](../web_ide/index.md#live-preview) are not available in the Web IDE Beta.
|
||||
|
||||
These features might become available at a later date.
|
||||
|
||||
## Related topics
|
||||
|
||||
- [Remote Development](../remote_development/index.md)
|
||||
- [Web IDE](../web_ide/index.md)
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ and so you can provide a more accurate issue weight and completion criteria.
|
|||
Tasks are a type of work item, a step towards [default issue types](https://gitlab.com/gitlab-org/gitlab/-/issues/323404)
|
||||
in GitLab.
|
||||
For the roadmap of migrating issues and [epics](group/epics/index.md)
|
||||
to work items and adding custom work item types, visit
|
||||
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or
|
||||
to work items and adding custom work item types, see
|
||||
[epic 6033](https://gitlab.com/groups/gitlab-org/-/epics/6033) or the
|
||||
[Plan direction page](https://about.gitlab.com/direction/plan/).
|
||||
|
||||
## View tasks
|
||||
|
|
@ -168,6 +168,10 @@ To change the assignee on a task:
|
|||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339756) in GitLab 15.5.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have at least the Reporter role for the project.
|
||||
|
||||
To add [labels](project/labels.md) to a task:
|
||||
|
||||
1. In the issue description, in the **Tasks** section, select the title of the task you want to edit. The task window opens.
|
||||
|
|
@ -225,7 +229,7 @@ To add a task to a milestone:
|
|||
1. In the issue description, in the **Tasks** section, select the title of the task you want to edit.
|
||||
The task window opens.
|
||||
1. Next to **Milestone**, select **Add to milestone**.
|
||||
If a task already belongs to a milestone, the dropdown list shows the current milestone.
|
||||
If a task already belongs to a milestone, the dropdown list shows the current milestone.
|
||||
1. From the dropdown list, select the milestone to be associated with the task.
|
||||
|
||||
## Set task weight **(PREMIUM)**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ module API
|
|||
urgency :low
|
||||
|
||||
rescue_from Octokit::Unauthorized, with: :provider_unauthorized
|
||||
rescue_from Gitlab::GithubImport::RateLimitError, with: :too_many_requests
|
||||
|
||||
helpers do
|
||||
def client
|
||||
|
|
@ -33,6 +34,10 @@ module API
|
|||
def provider_unauthorized
|
||||
error!("Access denied to your #{Gitlab::ImportSources.title(provider.to_s)} account.", 401)
|
||||
end
|
||||
|
||||
def too_many_requests
|
||||
error!('Too Many Requests', 429)
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Import a GitHub project' do
|
||||
|
|
@ -92,5 +97,30 @@ module API
|
|||
render_api_error!(result[:message], result[:http_status])
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Import User Gists' do
|
||||
detail 'This feature was introduced in GitLab 15.8'
|
||||
success code: 202
|
||||
failure [
|
||||
{ code: 401, message: 'Unauthorized' },
|
||||
{ code: 422, message: 'Unprocessable Entity' },
|
||||
{ code: 429, message: 'Too Many Requests' }
|
||||
]
|
||||
end
|
||||
params do
|
||||
requires :personal_access_token, type: String, desc: 'GitHub personal access token'
|
||||
end
|
||||
post 'import/github/gists' do
|
||||
authorize! :create_snippet
|
||||
|
||||
result = Import::Github::GistsImportService.new(current_user, client, access_params).execute
|
||||
|
||||
if result[:status] == :success
|
||||
status 202
|
||||
else
|
||||
status result[:http_status]
|
||||
{ errors: result[:message] }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class EventFilter
|
|||
when TEAM
|
||||
events.where(action: Event::TEAM_ACTIONS)
|
||||
when ISSUE
|
||||
events.where(action: Event::ISSUE_ACTIONS, target_type: Event::ISSUE_TYPES)
|
||||
events.where(action: Event::ISSUE_ACTIONS).for_issue
|
||||
when WIKI
|
||||
wiki_events(events)
|
||||
when DESIGNS
|
||||
|
|
@ -97,7 +97,7 @@ class EventFilter
|
|||
when ISSUE
|
||||
in_operator_params(
|
||||
array_data: array_data,
|
||||
scope: Event.where(target_type: Event::ISSUE_TYPES),
|
||||
scope: Event.for_issue,
|
||||
in_column: :action,
|
||||
in_values: Event.actions.values_at(*Event::ISSUE_ACTIONS)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ module Gitlab
|
|||
pipeline.stages = @command.pipeline_seed.stages
|
||||
|
||||
if stage_names.empty?
|
||||
return error('No stages / jobs for this pipeline.')
|
||||
return error('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
end
|
||||
|
||||
if pipeline.invalid?
|
||||
|
|
|
|||
|
|
@ -25763,6 +25763,9 @@ msgstr ""
|
|||
msgid "MemberRole|can't be changed"
|
||||
msgstr ""
|
||||
|
||||
msgid "MemberRole|cannot be changed because it is already assigned to a user. Please create a new Member Role instead"
|
||||
msgstr ""
|
||||
|
||||
msgid "MemberRole|must be top-level namespace"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -96,12 +96,11 @@ module QA
|
|||
capabilities['goog:chromeOptions'][:args] << 'disable-dev-shm-usage' if QA::Runtime::Env.disable_dev_shm?
|
||||
|
||||
# Set chrome default download path
|
||||
if QA::Runtime::Env.chrome_default_download_path
|
||||
capabilities['goog:chromeOptions'][:prefs] = {
|
||||
'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path),
|
||||
'download.prompt_for_download' => false
|
||||
}
|
||||
end
|
||||
|
||||
capabilities['goog:chromeOptions'][:prefs] = {
|
||||
'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path),
|
||||
'download.prompt_for_download' => false
|
||||
}
|
||||
|
||||
# Specify the user-agent to allow challenges to be bypassed
|
||||
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ module QA
|
|||
end
|
||||
|
||||
def chrome_default_download_path
|
||||
ENV['DEFAULT_CHROME_DOWNLOAD_PATH']
|
||||
ENV['DEFAULT_CHROME_DOWNLOAD_PATH'] || Dir.tmpdir
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ download_jh_path() {
|
|||
|
||||
echoinfo "Downloading ${path}"
|
||||
|
||||
curl --location -o "${output}" -H "Private-Token: ${ADD_JH_FILES_TOKEN}" "https://gitlab.com/api/v4/projects/${GITLAB_JH_MIRROR_PROJECT}/repository/archive?sha=${JH_BRANCH}&path=${path}"
|
||||
curl --location --output "${output}" --header "Private-Token: ${ADD_JH_FILES_TOKEN}" --get --data-urlencode "sha=${JH_BRANCH}" --data-urlencode "path=${path}" "https://gitlab.com/api/v4/projects/${GITLAB_JH_MIRROR_PROJECT}/repository/archive"
|
||||
|
||||
tar -zxf "${output}"
|
||||
rm "${output}"
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class FindJhBranch
|
|||
def gitlab
|
||||
@gitlab ||= Gitlab.client(
|
||||
endpoint: API::DEFAULT_OPTIONS[:endpoint],
|
||||
private_token: API::DEFAULT_OPTIONS[:api_token] || ''
|
||||
private_token: ENV['ADD_JH_FILES_TOKEN'] || ''
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::Ci::Pipeline::Chain::Populate do
|
||||
RSpec.describe Gitlab::Ci::Pipeline::Chain::Populate, feature_category: :continuous_integration do
|
||||
let_it_be(:project) { create(:project, :repository) }
|
||||
let_it_be(:user) { create(:user) }
|
||||
|
||||
|
|
@ -90,7 +90,8 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Populate do
|
|||
|
||||
it 'appends an error about missing stages' do
|
||||
expect(pipeline.errors.to_a)
|
||||
.to include 'No stages / jobs for this pipeline.'
|
||||
.to include 'Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'
|
||||
end
|
||||
|
||||
it 'wastes pipeline iid' do
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::Ci::Status::Bridge::Factory do
|
||||
RSpec.describe Gitlab::Ci::Status::Bridge::Factory, feature_category: :continuous_integration do
|
||||
let(:user) { create(:user) }
|
||||
let(:project) { bridge.project }
|
||||
let(:status) { factory.fabricate! }
|
||||
|
|
@ -59,13 +59,15 @@ RSpec.describe Gitlab::Ci::Status::Bridge::Factory do
|
|||
|
||||
context 'failed with downstream_pipeline_creation_failed' do
|
||||
before do
|
||||
bridge.options = { downstream_errors: ['No stages / jobs for this pipeline.', 'other error'] }
|
||||
bridge.options = { downstream_errors: ['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.', 'other error'] }
|
||||
bridge.failure_reason = 'downstream_pipeline_creation_failed'
|
||||
end
|
||||
|
||||
it 'fabricates correct status_tooltip' do
|
||||
expect(status.status_tooltip).to eq(
|
||||
"#{s_('CiStatusText|failed')} - (downstream pipeline can not be created, No stages / jobs for this pipeline., other error)"
|
||||
"#{s_('CiStatusText|failed')} - (downstream pipeline can not be created, Pipeline will not run for the selected trigger. " \
|
||||
"The rules configuration prevented any jobs from being added to the pipeline., other error)"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
|
||||
RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Code-Quality') }
|
||||
|
||||
describe 'the created pipeline' do
|
||||
|
|
@ -63,7 +63,8 @@ RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
|
|||
context 'on master' do
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -72,7 +73,8 @@ RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -81,7 +83,8 @@ RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Jobs/SAST-IaC.gitlab-ci.yml' do
|
||||
RSpec.describe 'Jobs/SAST-IaC.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/SAST-IaC') }
|
||||
|
||||
describe 'the created pipeline' do
|
||||
|
|
@ -50,7 +50,8 @@ RSpec.describe 'Jobs/SAST-IaC.gitlab-ci.yml' do
|
|||
context 'on default branch' do
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -59,7 +60,8 @@ RSpec.describe 'Jobs/SAST-IaC.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml' do
|
||||
RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/SAST-IaC.latest') }
|
||||
|
||||
describe 'the created pipeline' do
|
||||
|
|
@ -51,7 +51,8 @@ RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml' do
|
|||
context 'on default branch' do
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -60,7 +61,8 @@ RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
|
||||
RSpec.describe 'Jobs/Test.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Test') }
|
||||
|
||||
describe 'the created pipeline' do
|
||||
|
|
@ -63,7 +63,8 @@ RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
|
|||
context 'on master' do
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -72,7 +73,8 @@ RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -81,7 +83,8 @@ RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'npm.gitlab-ci.yml' do
|
||||
RSpec.describe 'npm.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('npm') }
|
||||
|
||||
describe 'the created pipeline' do
|
||||
|
|
@ -43,7 +43,8 @@ RSpec.describe 'npm.gitlab-ci.yml' do
|
|||
shared_examples 'no pipeline created' do
|
||||
it 'does not create a pipeline because the only job (publish) is not created' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Terraform.latest.gitlab-ci.yml' do
|
||||
RSpec.describe 'Terraform.latest.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
before do
|
||||
allow(Gitlab::Template::GitlabCiYmlTemplate).to receive(:excluded_patterns).and_return([])
|
||||
end
|
||||
|
|
@ -66,7 +66,12 @@ RSpec.describe 'Terraform.latest.gitlab-ci.yml' do
|
|||
|
||||
it 'does not create a branch pipeline', :aggregate_failures do
|
||||
expect(branch_build_names).to be_empty
|
||||
expect(branch_pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(branch_pipeline.errors.full_messages).to match_array(
|
||||
[
|
||||
'Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'
|
||||
]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'ThemeKit.gitlab-ci.yml' do
|
||||
RSpec.describe 'ThemeKit.gitlab-ci.yml', feature_category: :continuous_integration do
|
||||
before do
|
||||
allow(Gitlab::Template::GitlabCiYmlTemplate).to receive(:excluded_patterns).and_return([])
|
||||
end
|
||||
|
|
@ -52,7 +52,8 @@ RSpec.describe 'ThemeKit.gitlab-ci.yml' do
|
|||
|
||||
it 'has no jobs' do
|
||||
expect(build_names).to be_empty
|
||||
expect(pipeline.errors.full_messages).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(pipeline.errors.full_messages).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -102,7 +102,20 @@ RSpec.describe Event, feature_category: :users do
|
|||
end
|
||||
|
||||
describe 'scopes' do
|
||||
describe 'created_at' do
|
||||
describe '.for_issue' do
|
||||
let(:issue_event) { create(:event, :for_issue, project: project) }
|
||||
let(:work_item_event) { create(:event, :for_work_item, project: project) }
|
||||
|
||||
before do
|
||||
create(:event, :for_design, project: project)
|
||||
end
|
||||
|
||||
it 'returns events for Issue and WorkItem target_type' do
|
||||
expect(described_class.for_issue).to contain_exactly(issue_event, work_item_event)
|
||||
end
|
||||
end
|
||||
|
||||
describe '.created_at' do
|
||||
it 'can find the right event' do
|
||||
time = 1.day.ago
|
||||
event = create(:event, created_at: time, project: project)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe MemberRole do
|
||||
RSpec.describe MemberRole, feature_category: :authentication_and_authorization do
|
||||
describe 'associations' do
|
||||
it { is_expected.to belong_to(:namespace) }
|
||||
it { is_expected.to have_many(:members) }
|
||||
|
|
@ -14,6 +14,27 @@ RSpec.describe MemberRole do
|
|||
it { is_expected.to validate_presence_of(:namespace) }
|
||||
it { is_expected.to validate_presence_of(:base_access_level) }
|
||||
|
||||
context 'for attributes_locked_after_member_associated' do
|
||||
context 'when assigned to member' do
|
||||
it 'cannot be changed' do
|
||||
member_role.save!
|
||||
member_role.members << create(:project_member)
|
||||
|
||||
expect(member_role).not_to be_valid
|
||||
expect(member_role.errors.messages[:base]).to include(
|
||||
s_("MemberRole|cannot be changed because it is already assigned to a user. "\
|
||||
"Please create a new Member Role instead")
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when not assigned to member' do
|
||||
it 'can be changed' do
|
||||
expect(member_role).to be_valid
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when for namespace' do
|
||||
let_it_be(:root_group) { create(:group) }
|
||||
|
||||
|
|
|
|||
|
|
@ -6,33 +6,35 @@ RSpec.describe API::ImportGithub, feature_category: :importers do
|
|||
let(:token) { "asdasd12345" }
|
||||
let(:provider) { :github }
|
||||
let(:access_params) { { github_access_token: token } }
|
||||
let(:provider_username) { user.username }
|
||||
let(:provider_user) { double('provider', login: provider_username).as_null_object }
|
||||
let(:provider_repo) do
|
||||
{
|
||||
name: 'vim',
|
||||
full_name: "#{provider_username}/vim",
|
||||
owner: double('provider', login: provider_username),
|
||||
description: 'provider',
|
||||
private: false,
|
||||
clone_url: 'https://fake.url/vim.git',
|
||||
has_wiki: true
|
||||
}
|
||||
end
|
||||
|
||||
let(:client) { double('client', user: provider_user, repository: provider_repo) }
|
||||
|
||||
before do
|
||||
Grape::Endpoint.before_each do |endpoint|
|
||||
allow(endpoint).to receive(:client).and_return(client)
|
||||
end
|
||||
end
|
||||
|
||||
after do
|
||||
Grape::Endpoint.before_each nil
|
||||
end
|
||||
|
||||
describe "POST /import/github" do
|
||||
let(:user) { create(:user) }
|
||||
let(:project) { create(:project) }
|
||||
let(:provider_username) { user.username }
|
||||
let(:provider_user) { double('provider', login: provider_username) }
|
||||
let(:provider_repo) do
|
||||
{
|
||||
name: 'vim',
|
||||
full_name: "#{provider_username}/vim",
|
||||
owner: double('provider', login: provider_username),
|
||||
description: 'provider',
|
||||
private: false,
|
||||
clone_url: 'https://fake.url/vim.git',
|
||||
has_wiki: true
|
||||
}
|
||||
end
|
||||
|
||||
before do
|
||||
Grape::Endpoint.before_each do |endpoint|
|
||||
allow(endpoint).to receive(:client).and_return(double('client', user: provider_user, repository: provider_repo).as_null_object)
|
||||
end
|
||||
end
|
||||
|
||||
after do
|
||||
Grape::Endpoint.before_each nil
|
||||
end
|
||||
let_it_be(:user) { create(:user) }
|
||||
let_it_be(:project) { create(:project) }
|
||||
|
||||
it 'rejects requests when Github Importer is disabled' do
|
||||
stub_application_setting(import_sources: nil)
|
||||
|
|
@ -150,4 +152,60 @@ RSpec.describe API::ImportGithub, feature_category: :importers do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /import/github/gists' do
|
||||
let_it_be(:user) { create(:user) }
|
||||
let(:params) { { personal_access_token: token } }
|
||||
|
||||
context 'when gists import was started' do
|
||||
before do
|
||||
allow(Import::Github::GistsImportService)
|
||||
.to receive(:new).with(user, client, access_params)
|
||||
.and_return(double(execute: { status: :success }))
|
||||
end
|
||||
|
||||
it 'returns 202' do
|
||||
post api('/import/github/gists', user), params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:accepted)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when gists import is in progress' do
|
||||
before do
|
||||
allow(Import::Github::GistsImportService)
|
||||
.to receive(:new).with(user, client, access_params)
|
||||
.and_return(double(execute: { status: :error, message: 'Import already in progress', http_status: :unprocessable_entity }))
|
||||
end
|
||||
|
||||
it 'returns 422 error' do
|
||||
post api('/import/github/gists', user), params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:unprocessable_entity)
|
||||
expect(json_response['errors']).to eq('Import already in progress')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when unauthenticated user' do
|
||||
it 'returns 403 error' do
|
||||
post api('/import/github/gists'), params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:unauthorized)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when rate limit reached' do
|
||||
before do
|
||||
allow(Import::Github::GistsImportService)
|
||||
.to receive(:new).with(user, client, access_params)
|
||||
.and_raise(Gitlab::GithubImport::RateLimitError)
|
||||
end
|
||||
|
||||
it 'returns 429 error' do
|
||||
post api('/import/github/gists', user), params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:too_many_requests)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -464,6 +464,18 @@ RSpec.describe UsersController, feature_category: :user_management do
|
|||
expect(response.body).not_to be_empty
|
||||
end
|
||||
|
||||
it 'renders the correct url for issues and work items' do
|
||||
work_item = create(:work_item, :task, project: project)
|
||||
issue = create(:issue, project: project)
|
||||
EventCreateService.new.open_issue(work_item, public_user)
|
||||
EventCreateService.new.open_issue(issue, public_user)
|
||||
|
||||
get user_calendar_activities_url public_user.username
|
||||
|
||||
expect(response.body).to include(project_work_items_path(project, work_item.iid, iid_path: true))
|
||||
expect(response.body).to include(project_issue_path(project, issue))
|
||||
end
|
||||
|
||||
it 'avoids N+1 queries', :request_store do
|
||||
get user_calendar_activities_url public_user.username
|
||||
|
||||
|
|
|
|||
|
|
@ -825,11 +825,13 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute', feature_category
|
|||
it 'does not create a pipeline and drops the bridge' do
|
||||
expect { subject }.not_to change(downstream_project.ci_pipelines, :count)
|
||||
expect(subject).to be_error
|
||||
expect(subject.message).to match_array(["No stages / jobs for this pipeline."])
|
||||
expect(subject.message).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
|
||||
expect(bridge.reload).to be_failed
|
||||
expect(bridge.failure_reason).to eq('downstream_pipeline_creation_failed')
|
||||
expect(bridge.options[:downstream_errors]).to eq(['No stages / jobs for this pipeline.'])
|
||||
expect(bridge.options[:downstream_errors]).to match_array(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectness do
|
||||
RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectness, feature_category: :pipeline_authoring do
|
||||
let(:project) { create(:project, :repository) }
|
||||
let(:user) { project.first_owner }
|
||||
let(:ref) { 'refs/heads/master' }
|
||||
|
|
@ -1166,7 +1166,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
let(:ref) { 'refs/heads/master' }
|
||||
|
||||
it 'invalidates the pipeline with an empty jobs error' do
|
||||
expect(pipeline.errors[:base]).to include('No stages / jobs for this pipeline.')
|
||||
expect(pipeline.errors[:base]).to include('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectness, :clean_gitlab_redis_cache do
|
||||
RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectness, :clean_gitlab_redis_cache, feature_category: :continuous_integration do
|
||||
include ProjectForksHelper
|
||||
|
||||
let_it_be_with_refind(:project) { create(:project, :repository) }
|
||||
|
|
@ -684,7 +684,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
result = execute_service
|
||||
|
||||
expect(result).to be_error
|
||||
expect(result.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(result.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(result.payload).not_to be_persisted
|
||||
expect(Ci::Build.all).to be_empty
|
||||
expect(Ci::Pipeline.count).to eq(0)
|
||||
|
|
@ -1423,9 +1424,11 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
|
||||
it 'does not create a detached merge request pipeline', :aggregate_failures do
|
||||
expect(response).to be_error
|
||||
expect(response.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(response.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
expect(pipeline.errors[:base]).to eq(['No stages / jobs for this pipeline.'])
|
||||
expect(pipeline.errors[:base]).to eq(['Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1633,7 +1636,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
|
||||
it 'does not create a detached merge request pipeline', :aggregate_failures do
|
||||
expect(response).to be_error
|
||||
expect(response.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(response.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
end
|
||||
end
|
||||
|
|
@ -1669,7 +1673,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
|
||||
it 'does not create a detached merge request pipeline', :aggregate_failures do
|
||||
expect(response).to be_error
|
||||
expect(response.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(response.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
end
|
||||
end
|
||||
|
|
@ -1697,7 +1702,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
|
||||
it 'does not create a detached merge request pipeline', :aggregate_failures do
|
||||
expect(response).to be_error
|
||||
expect(response.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(response.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
end
|
||||
end
|
||||
|
|
@ -1727,7 +1733,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
|
||||
it 'does not create a detached merge request pipeline', :aggregate_failures do
|
||||
expect(response).to be_error
|
||||
expect(response.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(response.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
end
|
||||
end
|
||||
|
|
@ -1755,7 +1762,8 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
|
|||
|
||||
it 'does not create a detached merge request pipeline', :aggregate_failures do
|
||||
expect(response).to be_error
|
||||
expect(response.message).to eq('No stages / jobs for this pipeline.')
|
||||
expect(response.message).to eq('Pipeline will not run for the selected trigger. ' \
|
||||
'The rules configuration prevented any jobs from being added to the pipeline.')
|
||||
expect(pipeline).not_to be_persisted
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,15 +3,18 @@
|
|||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Import::Github::GistsImportService, feature_category: :importer do
|
||||
subject(:import) { described_class.new(user, params) }
|
||||
subject(:import) { described_class.new(user, client, params) }
|
||||
|
||||
let_it_be(:user) { create(:user) }
|
||||
let(:params) { { github_access_token: 'token' } }
|
||||
let(:import_status) { instance_double('Gitlab::GithubGistsImport::Status') }
|
||||
let(:client) { Gitlab::GithubImport::Client.new(params[:github_access_token]) }
|
||||
let(:octokit_user) { { login: 'user_login' } }
|
||||
|
||||
describe '#execute', :aggregate_failures do
|
||||
before do
|
||||
allow(Gitlab::GithubGistsImport::Status).to receive(:new).and_return(import_status)
|
||||
allow(client.octokit).to receive(:user).and_return(octokit_user)
|
||||
end
|
||||
|
||||
context 'when import in progress' do
|
||||
|
|
@ -43,5 +46,24 @@ RSpec.describe Import::Github::GistsImportService, feature_category: :importer d
|
|||
expect(import.execute).to eq({ status: :success })
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user token is invalid' do
|
||||
before do
|
||||
allow(client.octokit).to receive(:user).and_raise(Octokit::Unauthorized)
|
||||
allow(import_status).to receive(:started?).and_return(false)
|
||||
end
|
||||
|
||||
let(:expected_result) do
|
||||
{
|
||||
http_status: 401,
|
||||
message: 'Access denied to the GitHub account.',
|
||||
status: :error
|
||||
}
|
||||
end
|
||||
|
||||
it 'returns 401 error' do
|
||||
expect(import.execute).to eq(expected_result)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue