Commit a3326387 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'msj-id-docs' into 'master'

Lint for uppercase ID in docs and GraphQL API

See merge request gitlab-org/gitlab!39687
parents 8f910d12 eb3d795b
......@@ -71,6 +71,7 @@
"Gzip",
"Helm",
"HipChat",
"ID",
"Ingress",
"jasmine-jquery",
"JavaScript",
......
......@@ -116,11 +116,11 @@ class GitlabSchema < GraphQL::Schema
expected_type = ctx[:expected_type]
gid = GlobalID.parse(global_id)
raise Gitlab::Graphql::Errors::ArgumentError, "#{global_id} is not a valid GitLab id." unless gid
raise Gitlab::Graphql::Errors::ArgumentError, "#{global_id} is not a valid GitLab ID." unless gid
if expected_type && !gid.model_class.ancestors.include?(expected_type)
vars = { global_id: global_id, expected_type: expected_type }
msg = _('%{global_id} is not a valid id for %{expected_type}.') % vars
msg = _('%{global_id} is not a valid ID for %{expected_type}.') % vars
raise Gitlab::Graphql::Errors::ArgumentError, msg
end
......
......@@ -12,7 +12,7 @@ module Mutations
argument :id,
GraphQL::ID_TYPE,
required: true,
description: 'The global id of the annotation to delete'
description: 'The global ID of the annotation to delete'
def resolve(id:)
annotation = authorized_find!(id: id)
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'JiraUser'
field :jira_account_id, GraphQL::STRING_TYPE, null: false,
description: 'Account id of the Jira user'
description: 'Account ID of the Jira user'
field :jira_display_name, GraphQL::STRING_TYPE, null: false,
description: 'Display name of the Jira user'
field :jira_email, GraphQL::STRING_TYPE, null: true,
......
......@@ -37,7 +37,7 @@ The following steps enable AWS Cognito as an authentication provider:
1. Save changes for the app client settings.
1. Under **Domain name** include the AWS domain name for your AWS Cognito application.
1. Under **App Clients**, find your **App client id** and **App client secret**. These values correspond to the OAuth2 Client ID and Client Secret. Save these values.
1. Under **App Clients**, find your app client ID and app client secret. These values correspond to the OAuth2 Client ID and Client Secret. Save these values.
## Configure GitLab
......
......@@ -38,7 +38,7 @@ value that was randomly generated by GitLab for the request.
See the following example:
![Firefox's network monitor showing an request id header](img/network_monitor_xid.png)
![Firefox's network monitor showing an request ID header](img/network_monitor_xid.png)
### Getting the correlation ID from your logs
......
......@@ -212,11 +212,11 @@ PUT /projects/:id/feature_flags/:feature_flag_name
| `active` | boolean | no | The active state of the flag. [Supported](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38350) in GitLab 13.3 and later. |
| `name` | string | no | The new name of the feature flag. [Supported](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38350) in GitLab 13.3 and later. |
| `strategies` | JSON | no | The feature flag [strategies](../operations/feature_flags.md#feature-flag-strategies). |
| `strategies:id` | JSON | no | The feature flag strategy id. |
| `strategies:id` | JSON | no | The feature flag strategy ID. |
| `strategies:name` | JSON | no | The strategy name. |
| `strategies:parameters` | JSON | no | The strategy parameters. |
| `strategies:scopes` | JSON | no | The scopes for the strategy. |
| `strategies:scopes:id` | JSON | no | The scopes id. |
| `strategies:scopes:id` | JSON | no | The scopes ID. |
| `strategies:scopes:environment_scope` | string | no | The environment spec for the scope. |
```shell
......
......@@ -192,7 +192,7 @@ When you see the result `id` of the note you created - take a note of it. Now le
```graphql
mutation {
updateNote(input: { id: "gid://gitlab/Note/<note id>",
updateNote(input: { id: "gid://gitlab/Note/<note ID>",
body: "*SIPS TEA*"
}) {
note {
......@@ -210,7 +210,7 @@ Let's delete the comment, since our tea is all gone.
```graphql
mutation {
destroyNote(input: { id: "gid://gitlab/Note/<note id>" }) {
destroyNote(input: { id: "gid://gitlab/Note/<note ID>" }) {
note {
id
body
......
......@@ -3131,7 +3131,7 @@ input DeleteAnnotationInput {
clientMutationId: String
"""
The global id of the annotation to delete
The global ID of the annotation to delete
"""
id: ID!
}
......@@ -8176,7 +8176,7 @@ type JiraUser {
gitlabUsername: String
"""
Account id of the Jira user
Account ID of the Jira user
"""
jiraAccountId: String!
......
......@@ -8464,7 +8464,7 @@
"inputFields": [
{
"name": "id",
"description": "The global id of the annotation to delete",
"description": "The global ID of the annotation to delete",
"type": {
"kind": "NON_NULL",
"name": null,
......@@ -22659,7 +22659,7 @@
},
{
"name": "jiraAccountId",
"description": "Account id of the Jira user",
"description": "Account ID of the Jira user",
"args": [
],
......@@ -1254,7 +1254,7 @@ Autogenerated return type of JiraImportUsers
| `gitlabId` | Int | ID of the matched GitLab user |
| `gitlabName` | String | Name of the matched GitLab user |
| `gitlabUsername` | String | Username of the matched GitLab user |
| `jiraAccountId` | String! | Account id of the Jira user |
| `jiraAccountId` | String! | Account ID of the Jira user |
| `jiraDisplayName` | String! | Display name of the Jira user |
| `jiraEmail` | String | Email of the Jira user, returned only for users with public emails |
......
......@@ -807,7 +807,7 @@ Parameters:
| `username` | string | yes | The username of the user created to be used with GitLab/Jira. |
| `password` | string | yes | The password of the user created to be used with GitLab/Jira. |
| `active` | boolean | no | Activates or deactivates the service. Defaults to false (deactivated). |
| `jira_issue_transition_id` | string | no | The ID of a transition that moves issues to a closed state. You can find this number under the Jira workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the **Transitions (id)** column. By default, this ID is set to `2`. |
| `jira_issue_transition_id` | string | no | The ID of a transition that moves issues to a closed state. You can find this number under the Jira workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the transitions ID column. By default, this ID is set to `2`. |
| `commit_events` | boolean | false | Enable notifications for commit events |
| `merge_requests_events` | boolean | false | Enable notifications for merge request events |
| `comment_on_event_enabled` | boolean | false | Enable comments inside Jira issues on each GitLab event (commit / merge request) |
......
......@@ -106,5 +106,5 @@ can opt to disable it for your instance:
# Instance-wide
Feature.disable(:dag_pipeline_tab)
# or by project
Feature.disable(:dag_pipeline_tab, Project.find(<project id>))
Feature.disable(:dag_pipeline_tab, Project.find(<project ID>))
```
......@@ -75,7 +75,7 @@ To enable it:
# Instance-wide
Feature.enable(:<feature flag>)
# or by project
Feature.enable(:<feature flag>, Project.find(<project id>))
Feature.enable(:<feature flag>, Project.find(<project ID>))
```
To disable it:
......@@ -84,7 +84,7 @@ To disable it:
# Instance-wide
Feature.disable(:<feature flag>)
# or by project
Feature.disable(:<feature flag>, Project.find(<project id>))
Feature.disable(:<feature flag>, Project.find(<project ID>))
```
````
......
......@@ -229,7 +229,7 @@ be used both locally in development and on any deployed GitLab instance to
diagnose poor search performance. This will show the exact queries being made,
which is useful to diagnose why a search might be slow.
### Correlation ID and X-Opaque-Id
### Correlation ID and `X-Opaque-Id`
Our [correlation
ID](./distributed_tracing.md#developer-guidelines-for-working-with-correlation-ids)
......
......@@ -128,7 +128,7 @@ When this is set in place, it's easy to access the replicator through
the model:
```ruby
package_file = Packages::PackageFile.find(4) # just a random id as example
package_file = Packages::PackageFile.find(4) # just a random ID as example
replicator = package_file.replicator
```
......
......@@ -21,7 +21,7 @@ To get the credentials (a pair of Client ID and Client Secret), you must [create
1. Select **API (Enable OAuth Settings)** and click on **Enable OAuth Settings**.
1. Fill in the application details into the following fields:
- **Callback URL**: The callback URL of your GitLab installation. For example, `https://gitlab.example.com/users/auth/salesforce/callback`.
- **Selected OAuth Scopes**: Move **Access your basic information (id, profile, email, address, phone)** and **Allow access to your unique identifier (OpenID)** to the right column.
- **Selected OAuth Scopes**: Move `Access your basic information (id, profile, email, address, phone)` and `Allow access to your unique identifier (openid)` to the right column.
![Salesforce OAuth App Details](img/salesforce_oauth_app_details.png)
......
......@@ -332,8 +332,8 @@ unleash = Unleash::Client.new({
})
unleash_context = Unleash::Context.new
# Replace "123" with the id of an authenticated user.
# Note that the context's user id must be a string:
# Replace "123" with the ID of an authenticated user.
# Note that the context's user ID must be a string:
# https://unleash.github.io/docs/unleash_context
unleash_context.user_id = "123"
......
......@@ -33,7 +33,7 @@ To enable it:
# Instance-wide
Feature.enable(:product_analytics)
# or by project
Feature.enable(:product_analytics, Project.find(<project id>))
Feature.enable(:product_analytics, Project.find(<project ID>))
```
To disable it:
......@@ -42,7 +42,7 @@ To disable it:
# Instance-wide
Feature.disable(:product_analytics)
# or by project
Feature.disable(:product_analytics, Project.find(<project id>))
Feature.disable(:product_analytics, Project.find(<project ID>))
```
## Access Product Analytics
......
......@@ -678,7 +678,7 @@ To enable On-demand Scans:
# Instance-wide
Feature.enable(:security_on_demand_scans_feature_flag)
# or by project
Feature.enable(:security_on_demand_scans_feature_flag, Project.find(<project id>))
Feature.enable(:security_on_demand_scans_feature_flag, Project.find(<project ID>))
```
#### Enable or disable site profiles
......@@ -703,7 +703,7 @@ To enable Site Profiles:
# Instance-wide
Feature.enable(:security_on_demand_scans_site_profiles_feature_flag)
# or by project
Feature.enable(:security_on_demand_scans_site_profiles_feature_flag, Project.find(<project id>))
Feature.enable(:security_on_demand_scans_site_profiles_feature_flag, Project.find(<project ID>))
```
## Reports
......
......@@ -76,7 +76,7 @@ To enable it:
# Instance-wide
Feature.enable(:group_iterations)
# or by group
Feature.enable(:group_iterations, Group.find(<group id>))
Feature.enable(:group_iterations, Group.find(<group ID>))
```
To disable it:
......@@ -85,7 +85,7 @@ To disable it:
# Instance-wide
Feature.disable(:group_iterations)
# or by group
Feature.disable(:group_iterations, Group.find(<group id>))
Feature.disable(:group_iterations, Group.find(<group ID>))
```
<!-- ## Troubleshooting
......
......@@ -133,7 +133,7 @@ To enable it:
# Instance-wide
Feature.enable(:squash_options)
# or by project
Feature.enable(:squash_options, Project.find(<project id>))
Feature.enable(:squash_options, Project.find(<project ID>))
```
To disable it:
......@@ -142,7 +142,7 @@ To disable it:
# Instance-wide
Feature.disable(:squash_options)
# or by project
Feature.disable(:squash_options, Project.find(<project id>))
Feature.disable(:squash_options, Project.find(<project ID>))
```
<!-- ## Troubleshooting
......
......@@ -422,7 +422,7 @@ msgstr ""
msgid "%{firstMilestoneName} + %{numberOfOtherMilestones} more"
msgstr ""
msgid "%{global_id} is not a valid id for %{expected_type}."
msgid "%{global_id} is not a valid ID for %{expected_type}."
msgstr ""
msgid "%{group_docs_link_start}Groups%{group_docs_link_end} allow you to manage and collaborate across multiple projects. Members of a group have access to all of its projects."
......
......@@ -51,7 +51,7 @@ RSpec.describe Mutations::Discussions::ToggleResolve do
it 'raises an error' do
expect { subject }.to raise_error(
Gitlab::Graphql::Errors::ArgumentError,
"#{discussion.to_global_id} is not a valid id for Discussion."
"#{discussion.to_global_id} is not a valid ID for Discussion."
)
end
end
......
......@@ -101,7 +101,7 @@ RSpec.describe Mutations::Metrics::Dashboard::Annotations::Create do
graphql_mutation(:create_annotation, variables)
end
it_behaves_like 'a mutation that returns top-level errors', errors: ['invalid_id is not a valid GitLab id.']
it_behaves_like 'a mutation that returns top-level errors', errors: ['invalid_id is not a valid GitLab ID.']
end
end
end
......@@ -188,7 +188,7 @@ RSpec.describe Mutations::Metrics::Dashboard::Annotations::Create do
graphql_mutation(:create_annotation, variables)
end
it_behaves_like 'a mutation that returns top-level errors', errors: ['invalid_id is not a valid GitLab id.']
it_behaves_like 'a mutation that returns top-level errors', errors: ['invalid_id is not a valid GitLab ID.']
end
end
......
......@@ -45,7 +45,7 @@ RSpec.describe Mutations::Metrics::Dashboard::Annotations::Delete do
graphql_mutation(:delete_annotation, variables)
end
it_behaves_like 'a mutation that returns top-level errors', errors: ['invalid_id is not a valid GitLab id.']
it_behaves_like 'a mutation that returns top-level errors', errors: ['invalid_id is not a valid GitLab ID.']
end
context 'when the delete fails' do
......
......@@ -80,7 +80,7 @@ RSpec.describe 'Marking todos done' do
context 'when using an invalid gid' do
let(:input) { { id: 'invalid_gid' } }
let(:invalid_gid_error) { 'invalid_gid is not a valid GitLab id.' }
let(:invalid_gid_error) { 'invalid_gid is not a valid GitLab ID.' }
it 'contains the expected error' do
post_graphql_mutation(mutation, current_user: current_user)
......
......@@ -80,7 +80,7 @@ RSpec.describe 'Restoring Todos' do
context 'when using an invalid gid' do
let(:input) { { id: 'invalid_gid' } }
let(:invalid_gid_error) { 'invalid_gid is not a valid GitLab id.' }
let(:invalid_gid_error) { 'invalid_gid is not a valid GitLab ID.' }
it 'contains the expected error' do
post_graphql_mutation(mutation, current_user: current_user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment