diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-14 21:06:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-14 21:06:15 +0300 |
commit | 921d16124a626ad94e14bacb734033b0293ba431 (patch) | |
tree | 11be086bbc2b27701c3f8d885dd552af85b100c4 | |
parent | d88843f370acfcbbd3e2b9d6d662d62132647d86 (diff) |
Add latest changes from gitlab-org/gitlab@master
19 files changed, 794 insertions, 37 deletions
diff --git a/app/assets/javascripts/blob/file_template_mediator.js b/app/assets/javascripts/blob/file_template_mediator.js index b371f6be268..aedd8004ea5 100644 --- a/app/assets/javascripts/blob/file_template_mediator.js +++ b/app/assets/javascripts/blob/file_template_mediator.js @@ -118,8 +118,6 @@ export default class FileTemplateMediator { } }); - this.setFilename(item.name); - if (this.editor.getValue() !== '') { this.setTypeSelectorToggleText(item.name); } @@ -133,14 +131,16 @@ export default class FileTemplateMediator { selectTemplateFile(selector, query, data) { const self = this; + const { name } = selector.config; selector.renderLoading(); this.fetchFileTemplate(selector.config.type, query, data) .then(file => { this.setEditorContent(file); + this.setFilename(name); selector.renderLoaded(); - this.typeSelector.setToggleText(selector.config.name); + this.typeSelector.setToggleText(name); toast(__(`${query} template applied`), { action: { text: __('Undo'), diff --git a/changelogs/unreleased/31843-contextual-documentation-to-help-users-download-npm-packages.yml b/changelogs/unreleased/31843-contextual-documentation-to-help-users-download-npm-packages.yml new file mode 100644 index 00000000000..d301f6fed5b --- /dev/null +++ b/changelogs/unreleased/31843-contextual-documentation-to-help-users-download-npm-packages.yml @@ -0,0 +1,5 @@ +--- +title: Added installation commands for npm and yarn packages to package detail page +merge_request: 18999 +author: +type: added diff --git a/changelogs/unreleased/34443-fix-template-bug.yml b/changelogs/unreleased/34443-fix-template-bug.yml new file mode 100644 index 00000000000..57881debcad --- /dev/null +++ b/changelogs/unreleased/34443-fix-template-bug.yml @@ -0,0 +1,5 @@ +--- +title: Fix template selector filename bug +merge_request: 19376 +author: +type: fixed diff --git a/changelogs/unreleased/remove_var_from_merge_request_tabs_spec_js.yml b/changelogs/unreleased/remove_var_from_merge_request_tabs_spec_js.yml new file mode 100644 index 00000000000..826a9da0d04 --- /dev/null +++ b/changelogs/unreleased/remove_var_from_merge_request_tabs_spec_js.yml @@ -0,0 +1,5 @@ +--- +title: Remove var from merge_request_tabs_spec.js +merge_request: 20087 +author: Lee Tickett +type: other diff --git a/changelogs/unreleased/remove_var_from_syntax_highlight_spec_js.yml b/changelogs/unreleased/remove_var_from_syntax_highlight_spec_js.yml new file mode 100644 index 00000000000..e68c9c9f1e6 --- /dev/null +++ b/changelogs/unreleased/remove_var_from_syntax_highlight_spec_js.yml @@ -0,0 +1,5 @@ +--- +title: Remove var from syntax_highlight_spec.js +merge_request: 20086 +author: Lee Tickett +type: other diff --git a/doc/api/feature_flag_specs.md b/doc/api/feature_flag_specs.md new file mode 100644 index 00000000000..6a2cd047f85 --- /dev/null +++ b/doc/api/feature_flag_specs.md @@ -0,0 +1,291 @@ +# Feature Flag Specs API **(PREMIUM)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5. + +The API for creating, updating, reading and deleting [Feature Flag Specs](../user/project/operations/feature_flags.md#define-environment-specs). +Automation engineers benefit from this API by being able to modify Feature Flag Specs without accessing user interface. +To manage the [Feature Flag](../user/project/operations/feature_flags.md) resources via public API, please refer to the [Feature Flags API](feature_flags.md) document. + +Users with Developer or higher [permissions](../user/permissions.md) can access Feature Flag Specs API. + +## List all effective feature flag specs under the specified environment + +Get all effective feature flag specs under the specified [environment](../ci/environments.md). + +For instance, there are two specs, `staging` and `production`, for a feature flag. +When you pass `production` as a parameter to this endpoint, the system returns +the `production` feature flag spec only. + +``` +GET /projects/:id/feature_flag_scopes +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `environment` | string | yes | The [environment](../ci/environments.md) name | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flag_scopes?environment=production +``` + +Example response: + +```json +[ + { + "id": 88, + "active": true, + "environment_scope": "production", + "strategies": [ + { + "name": "userWithId", + "parameters": { + "userIds": "1,2,3" + } + } + ], + "created_at": "2019-11-04T08:36:41.327Z", + "updated_at": "2019-11-04T08:36:41.327Z", + "name": "awesome_feature" + }, + { + "id": 82, + "active": true, + "environment_scope": "*", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:51.425Z", + "updated_at": "2019-11-04T08:39:45.751Z", + "name": "merge_train" + }, + { + "id": 81, + "active": false, + "environment_scope": "production", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:10.527Z", + "updated_at": "2019-11-04T08:13:10.527Z", + "name": "new_live_trace" + } +] +``` + +## List all specs of a feature flag + +Get all specs of a feature flag. + +``` +GET /projects/:id/feature_flags/:name/scopes +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes +``` + +Example response: + +```json +[ + { + "id": 79, + "active": false, + "environment_scope": "*", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:10.516Z", + "updated_at": "2019-11-04T08:13:10.516Z" + }, + { + "id": 80, + "active": true, + "environment_scope": "staging", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:10.525Z", + "updated_at": "2019-11-04T08:13:10.525Z" + }, + { + "id": 81, + "active": false, + "environment_scope": "production", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:10.527Z", + "updated_at": "2019-11-04T08:13:10.527Z" + } +] +``` + +## New feature flag spec + +Creates a new feature flag spec. + +``` +POST /projects/:id/feature_flags/:name/scopes +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | +| `environment_scope` | string | yes | The [environment spec](../ci/environments.md#scoping-environments-with-specs) of the feature flag. | +| `active` | boolean | yes | Whether the spec is active. | +| `strategies` | json | yes | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. | + +```bash +curl https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes \ + --header "PRIVATE-TOKEN: <your_access_token>" \ + --header "Content-type: application/json" \ + --data @- << EOF +{ + "environment_scope": "*", + "active": false, + "strategies": [{ "name": "default", "parameters": {} }] +} +EOF +``` + +Example response: + +```json +{ + "id": 81, + "active": false, + "environment_scope": "*", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:10.527Z", + "updated_at": "2019-11-04T08:13:10.527Z" +} +``` + +## Single feature flag spec + +Gets a single feature flag spec. + +``` +GET /projects/:id/feature_flags/:name/scopes/:environment_scope +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | +| `environment_scope` | string | yes | The URL-encoded [environment spec](../ci/environments.md#scoping-environments-with-specs) of the feature flag. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/feature_flags/new_live_trace/scopes/production +``` + +Example response: + +```json +{ + "id": 81, + "active": false, + "environment_scope": "production", + "strategies": [ + { + "name": "default", + "parameters": {} + } + ], + "created_at": "2019-11-04T08:13:10.527Z", + "updated_at": "2019-11-04T08:13:10.527Z" +} +``` + +## Edit feature flag spec + +Updates an existing feature flag spec. + +``` +PUT /projects/:id/feature_flags/:name/scopes/:environment_scope +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | +| `environment_scope` | string | yes | The URL-encoded [environment spec](../ci/environments.md#scoping-environments-with-specs) of the feature flag. | +| `active` | boolean | yes | Whether the spec is active. | +| `strategies` | json | yes | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. | + +```bash +curl https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes/production \ + --header "PRIVATE-TOKEN: <your_access_token>" \ + --header "Content-type: application/json" \ + --data @- << EOF +{ + "active": true, + "strategies": [{ "name": "userWithId", "parameters": { "userIds": "1,2,3" } }] +} +EOF +``` + +Example response: + +```json +{ + "id": 81, + "active": true, + "environment_scope": "production", + "strategies": [ + { + "name": "userWithId", + "parameters": { "userIds": "1,2,3" } + } + ], + "created_at": "2019-11-04T08:13:10.527Z", + "updated_at": "2019-11-04T08:13:10.527Z" +} +``` + +## Delete feature flag spec + +Deletes a feature flag spec. + +``` +DELETE /projects/:id/feature_flags/:name/scopes/:environment_scope +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | +| `environment_scope` | string | yes | The URL-encoded [environment spec](../ci/environments.md#scoping-environments-with-specs) of the feature flag. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes/production +``` diff --git a/doc/api/feature_flags.md b/doc/api/feature_flags.md new file mode 100644 index 00000000000..def452d36fb --- /dev/null +++ b/doc/api/feature_flags.md @@ -0,0 +1,308 @@ +# Feature Flags API **(PREMIUM)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5. + +API for accessing resources of [GitLab Feature Flags](../user/project/operations/feature_flags.md). + +Users with Developer or higher [permissions](../user/permissions.md) can access Feature Flag API. + +## Feature Flags pagination + +By default, `GET` requests return 20 results at a time because the API results +are [paginated](README.md#pagination). + +## List feature flags for a project + +Gets all feature flags of the requested project. + +``` +GET /projects/:id/feature_flags +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `scope` | string | no | The condition of feature flags, one of: `enabled`, `disabled`. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags +``` + +Example response: + +```json +[ + { + "name":"merge_train", + "description":"This feature is about merge train", + "created_at":"2019-11-04T08:13:51.423Z", + "updated_at":"2019-11-04T08:13:51.423Z", + "scopes":[ + { + "id":82, + "active":false, + "environment_scope":"*", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:51.425Z", + "updated_at":"2019-11-04T08:13:51.425Z" + }, + { + "id":83, + "active":true, + "environment_scope":"review/*", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:51.427Z", + "updated_at":"2019-11-04T08:13:51.427Z" + }, + { + "id":84, + "active":false, + "environment_scope":"production", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:51.428Z", + "updated_at":"2019-11-04T08:13:51.428Z" + } + ] + }, + { + "name":"new_live_trace", + "description":"This is a new live trace feature", + "created_at":"2019-11-04T08:13:10.507Z", + "updated_at":"2019-11-04T08:13:10.507Z", + "scopes":[ + { + "id":79, + "active":false, + "environment_scope":"*", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:10.516Z", + "updated_at":"2019-11-04T08:13:10.516Z" + }, + { + "id":80, + "active":true, + "environment_scope":"staging", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:10.525Z", + "updated_at":"2019-11-04T08:13:10.525Z" + }, + { + "id":81, + "active":false, + "environment_scope":"production", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:10.527Z", + "updated_at":"2019-11-04T08:13:10.527Z" + } + ] + } +] +``` + +## New feature flag + +Creates a new feature flag. + +``` +POST /projects/:id/feature_flags +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | +| `description` | string | no | The description of the feature flag. | +| `scopes` | JSON | no | The [feature flag specs](../user/project/operations/feature_flags.md#define-environment-specs) of the feature flag. | +| `scopes:environment_scope` | string | no | The [environment spec](../ci/environments.md#scoping-environments-with-specs). | +| `scopes:active` | boolean | no | Whether the spec is active. | +| `scopes:strategies` | JSON | no | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. | + +```bash +curl https://gitlab.example.com/api/v4/projects/1/feature_flags \ + --header "PRIVATE-TOKEN: <your_access_token>" \ + --header "Content-type: application/json" \ + --data @- << EOF +{ + "name": "awesome_feature", + "scopes": [{ "environment_scope": "*", "active": false, "strategies": [{ "name": "default", "parameters": {} }] }, + { "environment_scope": "production", "active": true, "strategies": [{ "name": "userWithId", "parameters": { "userIds": "1,2,3" } }] }] +} +EOF +``` + +Example response: + +```json +{ + "name":"awesome_feature", + "description":null, + "created_at":"2019-11-04T08:32:27.288Z", + "updated_at":"2019-11-04T08:32:27.288Z", + "scopes":[ + { + "id":85, + "active":false, + "environment_scope":"*", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:32:29.324Z", + "updated_at":"2019-11-04T08:32:29.324Z" + }, + { + "id":86, + "active":true, + "environment_scope":"production", + "strategies":[ + { + "name":"userWithId", + "parameters":{ + "userIds":"1,2,3" + } + } + ], + "created_at":"2019-11-04T08:32:29.328Z", + "updated_at":"2019-11-04T08:32:29.328Z" + } + ] +} +``` + +## Single feature flag + +Gets a single feature flag. + +``` +GET /projects/:id/feature_flags/:name +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace +``` + +Example response: + +```json +{ + "name":"new_live_trace", + "description":"This is a new live trace feature", + "created_at":"2019-11-04T08:13:10.507Z", + "updated_at":"2019-11-04T08:13:10.507Z", + "scopes":[ + { + "id":79, + "active":false, + "environment_scope":"*", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:10.516Z", + "updated_at":"2019-11-04T08:13:10.516Z" + }, + { + "id":80, + "active":true, + "environment_scope":"staging", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:10.525Z", + "updated_at":"2019-11-04T08:13:10.525Z" + }, + { + "id":81, + "active":false, + "environment_scope":"production", + "strategies":[ + { + "name":"default", + "parameters":{ + + } + } + ], + "created_at":"2019-11-04T08:13:10.527Z", + "updated_at":"2019-11-04T08:13:10.527Z" + } + ] +} +``` + +## Delete feature flag + +Deletes a feature flag. + +``` +DELETE /projects/:id/feature_flags/:name +``` + +| Attribute | Type | Required | Description | +| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `name` | string | yes | The name of the feature flag. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature +``` diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md index 05329993c64..1f43b151d5d 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -287,7 +287,7 @@ git reset HEAD~1 This leaves the changed files and folders unstaged in your local repository. CAUTION: **Warning:** -A Git commit should not usually be reverse, particularly if you already pushed it +A Git commit should not usually be reversed, particularly if you already pushed it to the remote repository. Although you can undo a commit, the best option is to avoid the situation altogether by working carefully. diff --git a/doc/user/permissions.md b/doc/user/permissions.md index 0382c33f7c6..42c38a8e34b 100644 --- a/doc/user/permissions.md +++ b/doc/user/permissions.md @@ -51,7 +51,7 @@ The following table depicts the various user permission levels in a project. | View Security reports **(ULTIMATE)** | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ | | View Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View licenses in Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | -| View [Design Management](project/issues/design_management.md) pages **(PREMIUM)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | +| View [Design Management](project/issues/design_management.md) pages **(PREMIUM)** | ✓ | ✓ | ✓ | ✓ | ✓ | | View project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | Pull project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View GitLab Pages protected by [access control](project/pages/introduction.md#gitlab-pages-access-control-core) | ✓ | ✓ | ✓ | ✓ | ✓ | @@ -103,6 +103,7 @@ The following table depicts the various user permission levels in a project. | Apply code change suggestions | | | ✓ | ✓ | ✓ | | Create and edit wiki pages | | | ✓ | ✓ | ✓ | | Rewrite/remove Git tags | | | ✓ | ✓ | ✓ | +| Manage Feature Flags **(PREMIUM)** | | | ✓ | ✓ | ✓ | | Use environment terminals | | | | ✓ | ✓ | | Run Web IDE's Interactive Web Terminals **(ULTIMATE ONLY)** | | | | ✓ | ✓ | | Add new team members | | | | ✓ | ✓ | diff --git a/doc/user/project/operations/feature_flags.md b/doc/user/project/operations/feature_flags.md index 08df92959c3..c05f8fa8bc4 100644 --- a/doc/user/project/operations/feature_flags.md +++ b/doc/user/project/operations/feature_flags.md @@ -81,7 +81,14 @@ NOTE: **NOTE** We'd highly recommend you to use the [Environment](../../../ci/environments.md) feature in order to quickly assess which flag is enabled per environment. -## Rollout strategy +## Feature Flag strategies + +GitLab Feature Flag adopts [Unleash](https://unleash.github.io) +as the feature flag engine. In unleash, there is a concept of rulesets for granular feature flag controls, +called [strategies](https://unleash.github.io/docs/activation_strategy). +Supported strategies for GitLab Feature Flags are described below. + +### Rollout strategy > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/8240) in GitLab 12.2. @@ -91,13 +98,13 @@ The status of an environment spec ultimately determines whether or not a feature For instance, a feature will always be disabled for every user if the matching environment spec has a disabled status, regardless of the chosen rollout strategy. However, a feature will be enabled for 50% of logged-in users if the matching environment spec has an enabled status along with a **Percent rollout (logged in users)** strategy set to 50%. -### All users +#### All users Enables the feature for all users. It is implemented using the Unleash [`default`](https://unleash.github.io/docs/activation_strategy#default) activation strategy. -### Percent rollout (logged in users) +#### Percent rollout (logged in users) Enables the feature for a percentage of authenticated users. It is implemented using the Unleash @@ -112,7 +119,7 @@ CAUTION: **Caution:** If this strategy is selected, then the Unleash client **must** be given a user ID for the feature to be enabled. See the [Ruby example](#ruby-application-example) below. -## Target users +### Target users strategy > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/8240) in GitLab 12.2. @@ -134,7 +141,7 @@ In order to use Feature Flags, you need to first [get the access credentials](#configuring-feature-flags) from GitLab and then prepare your application and hook it with a [client library](#client-libraries). -### Configuring Feature Flags +## Configuring Feature Flags To get the access credentials that your application will need to talk to GitLab: @@ -153,7 +160,7 @@ if **Instance ID** will be single token or multiple tokens, assigned to the **Environment**. Also, **Application name** could describe the version of application instead of the running environment. -### Client libraries +## Client libraries GitLab currently implements a single backend that is compatible with [Unleash](https://github.com/Unleash/unleash#client-implementations) clients. @@ -178,7 +185,7 @@ Community contributed clients: - [Unofficial .Net Core Unleash client](https://github.com/onybo/unleash-client-core) - [Unleash client for Python 3](https://github.com/aes/unleash-client-python) -### Golang application example +## Golang application example Here's an example of how to integrate the feature flags in a Golang application: @@ -219,7 +226,7 @@ func main() { } ``` -### Ruby application example +## Ruby application example Here's an example of how to integrate the feature flags in a Ruby application. @@ -249,3 +256,11 @@ else puts "hello, world!" end ``` + +## Feature Flags API + +You can create, update, read, and delete Feature Flags via API +to control them in an automated flow: + +- [Feature Flags API](../../../api/feature_flags.md) +- [Feature Flag Specs API](../../../api/feature_flag_specs.md) diff --git a/doc/user/project/releases/img/edit_release_page_v12_5.png b/doc/user/project/releases/img/edit_release_page_v12_5.png Binary files differnew file mode 100644 index 00000000000..8b9c502a2ef --- /dev/null +++ b/doc/user/project/releases/img/edit_release_page_v12_5.png diff --git a/doc/user/project/releases/img/new_tag.png b/doc/user/project/releases/img/new_tag_12_5.png Binary files differindex 6137ad2ee56..6137ad2ee56 100644 --- a/doc/user/project/releases/img/new_tag.png +++ b/doc/user/project/releases/img/new_tag_12_5.png diff --git a/doc/user/project/releases/img/release_edit_button_v12_5.png b/doc/user/project/releases/img/release_edit_button_v12_5.png Binary files differnew file mode 100644 index 00000000000..f60b0ecb1be --- /dev/null +++ b/doc/user/project/releases/img/release_edit_button_v12_5.png diff --git a/doc/user/project/releases/img/tags.png b/doc/user/project/releases/img/tags_12_5.png Binary files differindex 4c032f96125..4c032f96125 100644 --- a/doc/user/project/releases/img/tags.png +++ b/doc/user/project/releases/img/tags_12_5.png diff --git a/doc/user/project/releases/index.md b/doc/user/project/releases/index.md index 1ab348f57d4..d31df77f8a0 100644 --- a/doc/user/project/releases/index.md +++ b/doc/user/project/releases/index.md @@ -65,6 +65,27 @@ project. ![Releases list](img/releases.png) +## Editing a release + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26016) in GitLab 12.5. + +To edit the details of a release, navigate to **Project overview > Releases** and click +the edit button (pencil icon) in the top-right corner of the release you want to modify. + +![A release with an edit button](img/release_edit_button_v12_5.png) + +This will bring you to the **Edit Release** page, from which you can +change some of the release's details. + +![Edit release page](img/edit_release_page_v12_5.png) + +Currently, it is only possible to edit the release title and notes. +To change other release information, such as its tag, associated +milestones, or release date, use the +[Releases API](../../../api/releases/index.md#update-a-release). Editing this +information through the **Edit Release** page is planned for a future version +of GitLab. + ## Notification for Releases > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26001) in GitLab 12.4. @@ -85,17 +106,82 @@ drag and drop files to it. Release notes are stored in GitLab's database. There are several ways to add release notes: -- In the interface, when you create a new Git tag -- In the interface, by adding a note to an existing Git tag -- Using the GitLab API - -### New tag page with release notes text area - -![new_tag](img/new_tag.png) - -### Tags page with button to add or edit release notes for existing Git tag - -![tags](img/tags.png) +- In the interface, when you create a new Git tag. +- In the interface, by adding a note to an existing Git tag. +- Using the GitLab API. + +To create a new tag, navigate to your project's **Repository > Tags** and +click **New tag**. From there, you can fill the form with all the information +about the release: + +![new_tag](img/new_tag_12_5.png "Creation of a new tag.") + +You can also edit an existing tag to add release notes: + +![tags](img/tags_12_5.png "Addition of note to an existing tag") + +## Release Evidence + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26019) in GitLab 12.5. + +Each time a new release is created, specific related data is collected in +parallel. This dataset will be a snapshot this new release (including linked +milestones and issues) at moment of creation. Such collection of data will +provide a chain of custody and facilitate processes like external audits, for example. + +The gathered Evidence data is stored in the database upon creation of a new +release as a JSON object. In GitLab 12.5, a link to +the Evidence data is provided for [each Release](#releases-list). + +Here's what this object can look like: + +```json +{ + "release": { + "id": 5, + "tag": "v4.0", + "name": "New release", + "project_id": 45, + "project_name": "Project name", + "released_at": "2019-06-28 13:23:40 UTC", + "milestones": [ + { + "id": 11, + "title": "v4.0-rc1", + "state": "closed", + "due_date": "2019-05-12 12:00:00 UTC", + "created_at": "2019-04-17 15:45:12 UTC", + "issues": [ + { + "id": 82, + "title": "The top-right popup is broken", + "author_name": "John Doe", + "author_email": "john@doe.com", + "state": "closed", + "due_date": "2019-05-10 12:00:00 UTC" + }, + { + "id": 89, + "title": "The title of this page is misleading", + "author_name": "Jane Smith", + "author_email": "jane@smith.com", + "state": "closed", + "due_date": "nil" + } + ] + }, + { + "id": 12, + "title": "v4.0-rc2", + "state": "closed", + "due_date": "2019-05-30 18:30:00 UTC", + "created_at": "2019-04-17 15:45:12 UTC", + "issues": [] + } + ] + } +} +``` <!-- ## Troubleshooting diff --git a/locale/gitlab.pot b/locale/gitlab.pot index bcb56879f14..ccb4e7266b6 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11878,15 +11878,36 @@ msgstr "" msgid "Package was removed" msgstr "" +msgid "PackageRegistry|Copy npm command" +msgstr "" + +msgid "PackageRegistry|Copy npm setup command" +msgstr "" + +msgid "PackageRegistry|Copy yarn command" +msgstr "" + +msgid "PackageRegistry|Copy yarn setup command" +msgstr "" + msgid "PackageRegistry|Delete Package" msgstr "" msgid "PackageRegistry|Delete Package Version" msgstr "" +msgid "PackageRegistry|Installation" +msgstr "" + msgid "PackageRegistry|Learn how to %{noPackagesLinkStart}publish and share your packages%{noPackagesLinkEnd} with GitLab." msgstr "" +msgid "PackageRegistry|Package installation" +msgstr "" + +msgid "PackageRegistry|Registry Setup" +msgstr "" + msgid "PackageRegistry|Remove package" msgstr "" @@ -11905,6 +11926,15 @@ msgstr "" msgid "PackageRegistry|You are about to delete version %{boldStart}%{version}%{boldEnd} of %{boldStart}%{name}%{boldEnd}. Are you sure?" msgstr "" +msgid "PackageRegistry|You may also need to setup authentication using an auth token. %{linkStart}See the documentation%{linkEnd} to find out more." +msgstr "" + +msgid "PackageRegistry|npm" +msgstr "" + +msgid "PackageRegistry|yarn" +msgstr "" + msgid "Packages" msgstr "" @@ -18443,6 +18473,9 @@ msgstr "" msgid "Updated %{updated_at} by %{updated_by}" msgstr "" +msgid "Updated at" +msgstr "" + msgid "Updated to" msgstr "" diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index ef209fecac6..0a5bc64b429 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -62,6 +62,13 @@ describe 'Editing file blob', :js do expect(page).to have_content 'NextFeature' end + it 'editing a template file in a sub directory does not change path' do + project.repository.create_file(user, 'ci/.gitlab-ci.yml', 'test', message: 'testing', branch_name: branch) + visit project_edit_blob_path(project, tree_join(branch, 'ci/.gitlab-ci.yml')) + + expect(find_by_id('file_path').value).to eq('ci/.gitlab-ci.yml') + end + context 'from blob file path' do before do visit project_blob_path(project, tree_join(branch, file_path)) diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js index b424cbc866d..73b1ea4d36f 100644 --- a/spec/javascripts/merge_request_tabs_spec.js +++ b/spec/javascripts/merge_request_tabs_spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-var */ import $ from 'jquery'; import MockAdapter from 'axios-mock-adapter'; import axios from '~/lib/utils/axios_utils'; @@ -11,9 +10,9 @@ import initMrPage from './helpers/init_vue_mr_page_helper'; describe('MergeRequestTabs', function() { let mrPageMock; - var stubLocation = {}; - var setLocation = function(stubs) { - var defaults = { + const stubLocation = {}; + const setLocation = function(stubs) { + const defaults = { pathname: '', search: '', hash: '', @@ -44,9 +43,9 @@ describe('MergeRequestTabs', function() { }); describe('opensInNewTab', function() { - var tabUrl; - var windowTarget = '_blank'; + const windowTarget = '_blank'; let clickTabParams; + let tabUrl; beforeEach(function() { loadFixtures('merge_requests/merge_request_with_task_list.html'); @@ -193,11 +192,10 @@ describe('MergeRequestTabs', function() { }); it('replaces the current history state', function() { - var newState; setLocation({ pathname: '/foo/bar/merge_requests/1', }); - newState = this.subject('commits'); + const newState = this.subject('commits'); expect(this.spies.history).toHaveBeenCalledWith( { diff --git a/spec/javascripts/syntax_highlight_spec.js b/spec/javascripts/syntax_highlight_spec.js index 5438368ccbe..99c47fa31d4 100644 --- a/spec/javascripts/syntax_highlight_spec.js +++ b/spec/javascripts/syntax_highlight_spec.js @@ -1,11 +1,10 @@ -/* eslint-disable no-var, no-return-assign */ +/* eslint-disable no-return-assign */ import $ from 'jquery'; import syntaxHighlight from '~/syntax_highlight'; describe('Syntax Highlighter', function() { - var stubUserColorScheme; - stubUserColorScheme = function(value) { + const stubUserColorScheme = function(value) { if (window.gon == null) { window.gon = {}; } @@ -40,9 +39,8 @@ describe('Syntax Highlighter', function() { }); it('prevents an infinite loop when no matches exist', function() { - var highlight; setFixtures('<div></div>'); - highlight = function() { + const highlight = function() { return syntaxHighlight($('div')); }; |