@@ -401,37 +401,37 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -401,37 +401,37 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
1. With more than one attribute, all attributes should be on a new line:
1. With more than one attribute, all attributes should be on a new line:
```javascript
```javascript
// bad
// bad
<component v-if="bar"
<component v-if="bar"
param="baz" />
param="baz" />
<button class="btn">Click me</button>
<button class="btn">Click me</button>
// good
// good
<component
<component
v-if="bar"
v-if="bar"
param="baz"
param="baz"
/>
/>
<button class="btn">
<button class="btn">
Click me
Click me
</button>
</button>
```
```
1. The tag can be inline if there is only one attribute:
1. The tag can be inline if there is only one attribute:
```javascript
```javascript
// good
// good
<component bar="bar" />
<component bar="bar" />
// good
// good
<component
<component
bar="bar"
bar="bar"
/>
/>
// bad
// bad
<component
<component
bar="bar" />
bar="bar" />
```
```
#### Quotes
#### Quotes
...
@@ -439,15 +439,15 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -439,15 +439,15 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
1. Always use double quotes `"` inside templates and single quotes `'` for all other JS.
1. Always use double quotes `"` inside templates and single quotes `'` for all other JS.
```javascript
```javascript
// bad
// bad
template: `
template: `
<button :class='style'>Button</button>
<button :class='style'>Button</button>
`
`
// good
// good
template: `
template: `
<button :class="style">Button</button>
<button :class="style">Button</button>
`
`
```
```
#### Props
#### Props
...
@@ -455,37 +455,37 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -455,37 +455,37 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
1. Props should be declared as an object
1. Props should be declared as an object
```javascript
```javascript
// bad
// bad
props: ['foo']
props: ['foo']
// good
// good
props: {
props: {
foo: {
foo: {
type: String,
type: String,
required: false,
required: false,
default: 'bar'
default: 'bar'
}
}
}
}
```
```
1. Required key should always be provided when declaring a prop
1. Required key should always be provided when declaring a prop
```javascript
```javascript
// bad
// bad
props: {
props: {
foo: {
foo: {
type: String,
type: String,
}
}
}
}
// good
// good
props: {
props: {
foo: {
foo: {
type: String,
type: String,
required: false,
required: false,
default: 'bar'
default: 'bar'
}
}
}
}
```
```
1. Default key should be provided if the prop is not required.
1. Default key should be provided if the prop is not required.
...
@@ -493,30 +493,30 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -493,30 +493,30 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
On those a default key should not be provided.
On those a default key should not be provided.
```javascript
```javascript
// good
// good
props: {
props: {
foo: {
foo: {
type: String,
type: String,
required: false,
required: false,
}
}
}
}
// good
// good
props: {
props: {
foo: {
foo: {
type: String,
type: String,
required: false,
required: false,
default: 'bar'
default: 'bar'
}
}
}
}
// good
// good
props: {
props: {
foo: {
foo: {
type: String,
type: String,
required: true
required: true
}
}
}
}
```
```
#### Data
#### Data
...
@@ -524,17 +524,17 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -524,17 +524,17 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
1. `data` method should always be a function
1. `data` method should always be a function
```javascript
```javascript
// bad
// bad
data: {
data: {
foo: 'foo'
foo: 'foo'
}
}
// good
// good
data() {
data() {
return {
return {
foo: 'foo'
foo: 'foo'
};
};
}
}
```
```
#### Directives
#### Directives
...
@@ -542,31 +542,31 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -542,31 +542,31 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
1. Shorthand `@` is preferable over `v-on`
1. Shorthand `@` is preferable over `v-on`
```javascript
```javascript
// bad
// bad
<componentv-on:click="eventHandler"/>
<componentv-on:click="eventHandler"/>
// good
// good
<component @click="eventHandler"/>
<component@click="eventHandler"/>
```
```
1. Shorthand `:` is preferable over `v-bind`
1. Shorthand `:` is preferable over `v-bind`
```javascript
```javascript
// bad
// bad
<componentv-bind:class="btn"/>
<componentv-bind:class="btn"/>
// good
// good
<component :class="btn"/>
<component:class="btn"/>
```
```
1. Shorthand `#` is preferable over `v-slot`
1. Shorthand `#` is preferable over `v-slot`
```javascript
```javascript
// bad
// bad
<templatev-slot:header></template>
<templatev-slot:header></template>
// good
// good
<template #header></template>
<template#header></template>
```
```
#### Closing tags
#### Closing tags
...
@@ -574,11 +574,11 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
...
@@ -574,11 +574,11 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
1. Prefer self closing component tags
1. Prefer self closing component tags
```javascript
```javascript
// bad
// bad
<component></component>
<component></component>
// good
// good
<component />
<component/>
```
```
#### Ordering
#### Ordering
...
@@ -610,48 +610,48 @@ When using `v-for` you need to provide a *unique* `:key` attribute for each item
...
@@ -610,48 +610,48 @@ When using `v-for` you need to provide a *unique* `:key` attribute for each item
1. If the elements of the array being iterated have an unique `id` it is advised to use it:
1. If the elements of the array being iterated have an unique `id` it is advised to use it:
```html
```html
<div
<div
v-for="item in items"
v-for="item in items"
:key="item.id"
:key="item.id"
>
>
<!-- content -->
<!-- content -->
</div>
</div>
```
```
1. When the elements being iterated don't have a unique id, you can use the array index as the `:key` attribute
1. When the elements being iterated don't have a unique id, you can use the array index as the `:key` attribute
```html
```html
<div
<div
v-for="(item, index) in items"
v-for="(item, index) in items"
:key="index"
:key="index"
>
>
<!-- content -->
<!-- content -->
</div>
</div>
```
```
1. When using `v-for` with `template` and there is more than one child element, the `:key` values must be unique. It's advised to use `kebab-case` namespaces.
1. When using `v-for` with `template` and there is more than one child element, the `:key` values must be unique. It's advised to use `kebab-case` namespaces.
```html
```html
<templatev-for="(item, index) in items">
<templatev-for="(item, index) in items">
<span:key="`span-${index}`"></span>
<span:key="`span-${index}`"></span>
<button:key="`button-${index}`"></button>
<button:key="`button-${index}`"></button>
</template>
</template>
```
```
1. When dealing with nested `v-for` use the same guidelines as above.
1. When dealing with nested `v-for` use the same guidelines as above.
```html
```html
<div
<div
v-for="item in items"
v-for="item in items"
:key="item.id"
:key="item.id"
>
<span
v-for="element in array"
:key="element.id"
>
>
<span
<!-- content -->
v-for="element in array"
</span>
:key="element.id"
</div>
>
<!-- content -->
</span>
</div>
```
```
Useful links:
Useful links:
...
@@ -664,19 +664,19 @@ Useful links:
...
@@ -664,19 +664,19 @@ Useful links:
1. Tooltips: Do not rely on `has-tooltip` class name for Vue components
1. Tooltips: Do not rely on `has-tooltip` class name for Vue components
```javascript
```javascript
// bad
// bad
<span
<span
class="has-tooltip"
class="has-tooltip"
title="Some tooltip text">
title="Some tooltip text">
Text
Text
</span>
</span>
// good
// good
<span
<span
v-tooltip
v-tooltip
title="Some tooltip text">
title="Some tooltip text">
Text
Text
</span>
</span>
```
```
1. Tooltips: When using a tooltip, include the tooltip directive, `./app/assets/javascripts/vue_shared/directives/tooltip.js`
1. Tooltips: When using a tooltip, include the tooltip directive, `./app/assets/javascripts/vue_shared/directives/tooltip.js`
1. Do not call a mutation directly. Always use an action to commit a mutation. Doing so will keep consistency throughout the application. From Vuex docs:
1. Do not call a mutation directly. Always use an action to commit a mutation. Doing so will keep consistency throughout the application. From Vuex docs:
> why don't we just call store.commit('action') directly? Well, remember that mutations must be synchronous? Actions aren't. We can perform asynchronous operations inside an action.
> Why don't we just call store.commit('action') directly? Well, remember that mutations must be synchronous? Actions aren't. We can perform asynchronous operations inside an action.
> [Introduced][ee-2760] in [GitLab Premium][eep] 10.0. Brought to GitLab Core
> [Introduced][ee-2760] in [GitLab Premium][eep] 10.0. Brought to GitLab Core in 10.7.
in 10.7.
It is possible to store LFS objects in remote object storage which allows you
It is possible to store LFS objects in remote object storage which allows you
to offload local hard disk R/W operations, and free up disk space significantly.
to offload local hard disk R/W operations, and free up disk space significantly.
...
@@ -91,7 +90,7 @@ Here is a configuration example with S3.
...
@@ -91,7 +90,7 @@ Here is a configuration example with S3.
| `aws_access_key_id` | AWS credentials, or compatible | `ABC123DEF456` |
| `aws_access_key_id` | AWS credentials, or compatible | `ABC123DEF456` |
| `aws_secret_access_key` | AWS credentials, or compatible | `ABC123DEF456ABC123DEF456ABC123DEF456` |
| `aws_secret_access_key` | AWS credentials, or compatible | `ABC123DEF456ABC123DEF456ABC123DEF456` |
| `aws_signature_version` | AWS signature version to use. 2 or 4 are valid options. Digital Ocean Spaces and other providers may need 2. | 4 |
| `aws_signature_version` | AWS signature version to use. 2 or 4 are valid options. Digital Ocean Spaces and other providers may need 2. | 4 |
| `enable_signature_v4_streaming` | Set to true to enable HTTP chunked transfers with AWS v4 signatures (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html). Oracle Cloud S3 needs this to be false | true
| `enable_signature_v4_streaming` | Set to true to enable HTTP chunked transfers with [AWS v4 signatures](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html). Oracle Cloud S3 needs this to be false | true |
| `region` | AWS region | us-east-1 |
| `region` | AWS region | us-east-1 |
| `host` | S3 compatible host for when not using AWS, e.g. `localhost` or `storage.example.com` | s3.amazonaws.com |
| `host` | S3 compatible host for when not using AWS, e.g. `localhost` or `storage.example.com` | s3.amazonaws.com |
| `endpoint` | Can be used when configuring an S3 compatible service such as [Minio](https://www.minio.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) |
| `endpoint` | Can be used when configuring an S3 compatible service such as [Minio](https://www.minio.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) |
...
@@ -107,7 +106,9 @@ Here is a configuration example with GCS.
...
@@ -107,7 +106,9 @@ Here is a configuration example with GCS.
| `google_client_email` | The email address of the service account | `foo@gcp-project-12345.iam.gserviceaccount.com` |
| `google_client_email` | The email address of the service account | `foo@gcp-project-12345.iam.gserviceaccount.com` |
| `google_json_key_location` | The json key path | `/path/to/gcp-project-12345-abcde.json` |
| `google_json_key_location` | The json key path | `/path/to/gcp-project-12345-abcde.json` |
_NOTE: The service account must have permission to access the bucket. [See more](https://cloud.google.com/storage/docs/authentication)_
NOTE: **Note:**
The service account must have permission to access the bucket.
Here is a configuration example with Rackspace Cloud Files.
Here is a configuration example with Rackspace Cloud Files.
...
@@ -119,7 +120,13 @@ Here is a configuration example with Rackspace Cloud Files.
...
@@ -119,7 +120,13 @@ Here is a configuration example with Rackspace Cloud Files.
| `rackspace_region` | The Rackspace storage region to use, a three letter code from the [list of service access endpoints](https://developer.rackspace.com/docs/cloud-files/v1/general-api-info/service-access/) | `iad` |
| `rackspace_region` | The Rackspace storage region to use, a three letter code from the [list of service access endpoints](https://developer.rackspace.com/docs/cloud-files/v1/general-api-info/service-access/) | `iad` |
| `rackspace_temp_url_key` | The private key you have set in the Rackspace API for temporary URLs. Read more [here](https://developer.rackspace.com/docs/cloud-files/v1/use-cases/public-access-to-your-cloud-files-account/#tempurl) | `ABC123DEF456ABC123DEF456ABC123DE` |
| `rackspace_temp_url_key` | The private key you have set in the Rackspace API for temporary URLs. Read more [here](https://developer.rackspace.com/docs/cloud-files/v1/use-cases/public-access-to-your-cloud-files-account/#tempurl) | `ABC123DEF456ABC123DEF456ABC123DE` |
_NOTES: Regardless of whether the container has public access enabled or disabled, Fog will use the TempURL method to grant access to LFS objects. If you see errors in logs referencing instantiating storage with a temp-url-key, ensure that you have set they key properly on the Rackspace API and in gitlab.rb. You can verify the value of the key Rackspace has set by sending a GET request with token header to the service access endpoint URL and comparing the output of the returned headers._
NOTE: **Note:**
Regardless of whether the container has public access enabled or disabled, Fog will
use the TempURL method to grant access to LFS objects. If you see errors in logs referencing
instantiating storage with a temp-url-key, ensure that you have set they key properly
on the Rackspace API and in gitlab.rb. You can verify the value of the key Rackspace
has set by sending a GET request with token header to the service access endpoint URL
and comparing the output of the returned headers.
### Manual uploading to an object storage
### Manual uploading to an object storage
...
@@ -167,13 +174,13 @@ On Omnibus installations, the settings are prefixed by `lfs_object_store_`:
...
@@ -167,13 +174,13 @@ On Omnibus installations, the settings are prefixed by `lfs_object_store_`:
1. Save the file and [reconfigure GitLab]s for the changes to take effect.
1. Save the file and [reconfigure GitLab]s for the changes to take effect.
1. Migrate any existing local LFS objects to the object storage:
1. Migrate any existing local LFS objects to the object storage:
```bash
```bash
gitlab-rake gitlab:lfs:migrate
gitlab-rake gitlab:lfs:migrate
```
```
This will migrate existing LFS objects to object storage. New LFS objects
This will migrate existing LFS objects to object storage. New LFS objects
will be forwarded to object storage unless
will be forwarded to object storage unless
`gitlab_rails['lfs_object_store_background_upload']` is set to false.
`gitlab_rails['lfs_object_store_background_upload']` is set to false.
### S3 for installations from source
### S3 for installations from source
...
@@ -203,13 +210,13 @@ For source installations the settings are nested under `lfs:` and then
...
@@ -203,13 +210,13 @@ For source installations the settings are nested under `lfs:` and then
1. Save the file and [restart GitLab][] for the changes to take effect.
1. Save the file and [restart GitLab][] for the changes to take effect.
1. Migrate any existing local LFS objects to the object storage:
1. Migrate any existing local LFS objects to the object storage:
@@ -37,8 +37,7 @@ The following are some possible use cases for repository mirroring:
...
@@ -37,8 +37,7 @@ The following are some possible use cases for repository mirroring:
## Pushing to a remote repository **(CORE)**
## Pushing to a remote repository **(CORE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/249) in GitLab Enterprise
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/249) in GitLab Enterprise Edition 8.7. [Moved to GitLab Core](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18715) in 10.8.
> Edition 8.7. [Moved to GitLab Core](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18715) in 10.8.
For an existing project, you can set up push mirroring as follows:
For an existing project, you can set up push mirroring as follows:
...
@@ -67,8 +66,7 @@ section.
...
@@ -67,8 +66,7 @@ section.
### Push only protected branches **(CORE)**
### Push only protected branches **(CORE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3350) in
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3350) in [GitLab Starter](https://about.gitlab.com/pricing/) 10.3. [Moved to GitLab Core](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18715) in 10.8.
> [GitLab Starter](https://about.gitlab.com/pricing/) 10.3. [Moved to GitLab Core](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18715) in 10.8.
You can choose to only push your protected branches from GitLab to your remote repository.
You can choose to only push your protected branches from GitLab to your remote repository.
...
@@ -98,8 +96,7 @@ The repository will push soon. To force a push, click the appropriate button.
...
@@ -98,8 +96,7 @@ The repository will push soon. To force a push, click the appropriate button.
## Pulling from a remote repository **(STARTER)**
## Pulling from a remote repository **(STARTER)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/51) in GitLab Enterprise Edition 8.2.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/51) in GitLab Enterprise Edition 8.2. [Added Git LFS support](https://gitlab.com/gitlab-org/gitlab-ee/issues/10871) in [GitLab Starter](https://about.gitlab.com/pricing/) 11.11.
> [Added Git LFS support](https://gitlab.com/gitlab-org/gitlab-ee/issues/10871) in [GitLab Starter](https://about.gitlab.com/pricing/) 11.11.
NOTE: **Note:** This feature [is available for free](https://gitlab.com/gitlab-org/gitlab-ee/issues/10361) to
NOTE: **Note:** This feature [is available for free](https://gitlab.com/gitlab-org/gitlab-ee/issues/10361) to
GitLab.com users until September 22nd, 2019.
GitLab.com users until September 22nd, 2019.
...
@@ -157,8 +154,7 @@ Repository mirrors are updated as Sidekiq becomes available to process them. If
...
@@ -157,8 +154,7 @@ Repository mirrors are updated as Sidekiq becomes available to process them. If
### SSH authentication
### SSH authentication
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551) for Pull mirroring in [GitLab Starter](https://about.gitlab.com/pricing/) 9.5.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551) for Pull mirroring in [GitLab Starter](https://about.gitlab.com/pricing/) 9.5. [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22982) for Push mirroring in [GitLab Core](https://about.gitlab.com/pricing/) 11.6
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22982) for Push mirroring in [GitLab Core](https://about.gitlab.com/pricing/) 11.6
SSH authentication is mutual:
SSH authentication is mutual:
...
@@ -245,8 +241,7 @@ key to keep the mirror running.
...
@@ -245,8 +241,7 @@ key to keep the mirror running.
### Overwrite diverged branches **(STARTER)**
### Overwrite diverged branches **(STARTER)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4559) in
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4559) in [GitLab Starter](https://about.gitlab.com/pricing/) 10.6.