From 1b5db0f4a6ee2fc490aec0b8bed7d78d4ecc7996 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 12 Jun 2020 03:08:22 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../form_group/dashboard_timezone.vue | 60 +++++++++++++ .../components/metrics_settings.vue | 3 + .../operation_settings/store/actions.js | 4 + .../store/mutation_types.js | 3 +- .../operation_settings/store/mutations.js | 3 + .../operation_settings/store/state.js | 4 + app/models/project_metrics_setting.rb | 4 + .../operations/_metrics_dashboard.html.haml | 4 +- .../214370-add-timezone-setting.yml | 5 ++ doc/.vale/gitlab/spelling-exceptions.txt | 4 + doc/development/architecture.md | 4 +- doc/policy/maintenance.md | 4 +- doc/raketasks/migrate_snippets.md | 4 +- doc/security/webhooks.md | 2 +- doc/ssh/README.md | 4 +- doc/system_hooks/system_hooks.md | 4 +- doc/topics/git/index.md | 2 +- doc/topics/git/lfs/index.md | 16 ++-- .../lfs/migrate_from_git_annex_to_git_lfs.md | 4 +- doc/topics/git/lfs/migrate_to_git_lfs.md | 12 +-- doc/topics/gitlab_flow.md | 2 +- doc/university/training/user_training.md | 2 +- doc/update/patch_versions.md | 4 +- doc/update/upgrading_from_ce_to_ee.md | 2 +- doc/update/upgrading_from_source.md | 6 +- .../upgrading_postgresql_using_slony.md | 4 +- doc/user/admin_area/appearance.md | 2 +- doc/user/admin_area/license.md | 2 +- .../settings/external_authorization.md | 4 +- .../admin_area/settings/gitaly_timeouts.md | 2 +- doc/user/admin_area/settings/index.md | 2 +- doc/user/analytics/productivity_analytics.md | 2 +- doc/user/application_security/dast/index.md | 6 +- .../dependency_list/index.md | 4 +- doc/user/application_security/index.md | 6 +- .../offline_deployments/index.md | 2 +- .../application_security/sast/analyzers.md | 2 +- .../secret_detection/index.md | 4 +- .../vulnerabilities/index.md | 4 +- doc/user/clusters/crossplane.md | 2 +- doc/user/feature_highlight.md | 4 +- doc/user/gitlab_com/index.md | 64 ++++++------- .../repository/repository_mirroring.md | 2 +- doc/user/shortcuts.md | 2 +- locale/gitlab.pot | 12 +++ .../components/metrics_settings_spec.js | 89 ++++++++++++++----- .../store/mutations_spec.js | 10 +++ spec/models/project_metrics_setting_spec.rb | 8 ++ 48 files changed, 283 insertions(+), 122 deletions(-) create mode 100644 app/assets/javascripts/operation_settings/components/form_group/dashboard_timezone.vue create mode 100644 changelogs/unreleased/214370-add-timezone-setting.yml diff --git a/app/assets/javascripts/operation_settings/components/form_group/dashboard_timezone.vue b/app/assets/javascripts/operation_settings/components/form_group/dashboard_timezone.vue new file mode 100644 index 00000000000..42c9d876595 --- /dev/null +++ b/app/assets/javascripts/operation_settings/components/form_group/dashboard_timezone.vue @@ -0,0 +1,60 @@ + + + diff --git a/app/assets/javascripts/operation_settings/components/metrics_settings.vue b/app/assets/javascripts/operation_settings/components/metrics_settings.vue index ebf486162fc..77c356e5a7f 100644 --- a/app/assets/javascripts/operation_settings/components/metrics_settings.vue +++ b/app/assets/javascripts/operation_settings/components/metrics_settings.vue @@ -2,12 +2,14 @@ import { mapState, mapActions } from 'vuex'; import { GlDeprecatedButton, GlLink } from '@gitlab/ui'; import ExternalDashboard from './form_group/external_dashboard.vue'; +import DashboardTimezone from './form_group/dashboard_timezone.vue'; export default { components: { GlDeprecatedButton, GlLink, ExternalDashboard, + DashboardTimezone, }, computed: { ...mapState(['helpPage']), @@ -40,6 +42,7 @@ export default {
+ {{ __('Save Changes') }} diff --git a/app/assets/javascripts/operation_settings/store/actions.js b/app/assets/javascripts/operation_settings/store/actions.js index 62d00ac50e3..122acb6bdcf 100644 --- a/app/assets/javascripts/operation_settings/store/actions.js +++ b/app/assets/javascripts/operation_settings/store/actions.js @@ -7,11 +7,15 @@ import * as mutationTypes from './mutation_types'; export const setExternalDashboardUrl = ({ commit }, url) => commit(mutationTypes.SET_EXTERNAL_DASHBOARD_URL, url); +export const setDashboardTimezone = ({ commit }, selected) => + commit(mutationTypes.SET_DASHBOARD_TIMEZONE, selected); + export const saveChanges = ({ state, dispatch }) => axios .patch(state.operationsSettingsEndpoint, { project: { metrics_setting_attributes: { + dashboard_timezone: state.dashboardTimezone.selected, external_dashboard_url: state.externalDashboard.url, }, }, diff --git a/app/assets/javascripts/operation_settings/store/mutation_types.js b/app/assets/javascripts/operation_settings/store/mutation_types.js index 237d2b6122f..92543fd7f03 100644 --- a/app/assets/javascripts/operation_settings/store/mutation_types.js +++ b/app/assets/javascripts/operation_settings/store/mutation_types.js @@ -1,3 +1,2 @@ -/* eslint-disable import/prefer-default-export */ - export const SET_EXTERNAL_DASHBOARD_URL = 'SET_EXTERNAL_DASHBOARD_URL'; +export const SET_DASHBOARD_TIMEZONE = 'SET_DASHBOARD_TIMEZONE'; diff --git a/app/assets/javascripts/operation_settings/store/mutations.js b/app/assets/javascripts/operation_settings/store/mutations.js index eb495839616..f55717f6c98 100644 --- a/app/assets/javascripts/operation_settings/store/mutations.js +++ b/app/assets/javascripts/operation_settings/store/mutations.js @@ -4,4 +4,7 @@ export default { [types.SET_EXTERNAL_DASHBOARD_URL](state, url) { state.externalDashboard.url = url; }, + [types.SET_DASHBOARD_TIMEZONE](state, selected) { + state.dashboardTimezone.selected = selected; + }, }; diff --git a/app/assets/javascripts/operation_settings/store/state.js b/app/assets/javascripts/operation_settings/store/state.js index 5376f6b32e6..07e3095f4e9 100644 --- a/app/assets/javascripts/operation_settings/store/state.js +++ b/app/assets/javascripts/operation_settings/store/state.js @@ -5,4 +5,8 @@ export default (initialState = {}) => ({ url: initialState.externalDashboardUrl, helpPage: initialState.externalDashboardHelpPage, }, + dashboardTimezone: { + selected: initialState.dashboardTimezoneSetting, + helpPage: initialState.dashboardTimezoneHelpPage, + }, }); diff --git a/app/models/project_metrics_setting.rb b/app/models/project_metrics_setting.rb index 689b5a44276..c66d0f52f4c 100644 --- a/app/models/project_metrics_setting.rb +++ b/app/models/project_metrics_setting.rb @@ -9,4 +9,8 @@ class ProjectMetricsSetting < ApplicationRecord addressable_url: { enforce_sanitization: true, ascii_only: true } enum dashboard_timezone: { local: 0, utc: 1 } + + def dashboard_timezone=(val) + super(val&.downcase) + end end diff --git a/app/views/projects/settings/operations/_metrics_dashboard.html.haml b/app/views/projects/settings/operations/_metrics_dashboard.html.haml index eda8a52f188..0607a85a6c9 100644 --- a/app/views/projects/settings/operations/_metrics_dashboard.html.haml +++ b/app/views/projects/settings/operations/_metrics_dashboard.html.haml @@ -1,5 +1,5 @@ .js-operation-settings{ data: { operations_settings_endpoint: project_settings_operations_path(@project), help_page: help_page_path('user/project/integrations/prometheus'), external_dashboard: { url: metrics_external_dashboard_url, - help_page: help_page_path('user/project/operations/linking_to_an_external_dashboard'), - } } } + help_page: help_page_path('user/project/operations/linking_to_an_external_dashboard') }, + dashboard_timezone: { setting: metrics_dashboard_timezone.upcase } } } diff --git a/changelogs/unreleased/214370-add-timezone-setting.yml b/changelogs/unreleased/214370-add-timezone-setting.yml new file mode 100644 index 00000000000..03c564da54c --- /dev/null +++ b/changelogs/unreleased/214370-add-timezone-setting.yml @@ -0,0 +1,5 @@ +--- +title: Display dates on metrics dashboards in UTC time zone +merge_request: 32746 +author: +type: added diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index e2bbb3b7139..b56fa2861ca 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -35,6 +35,7 @@ awardable Axios Azure B-tree +backfilling backport backported backporting @@ -233,6 +234,7 @@ lookups loopback Lucene Maildir +Mailgun Makefile Makefiles Markdown @@ -348,6 +350,8 @@ redirections refactorings referer referers +reflog +reflogs reindex reindexed reindexes diff --git a/doc/development/architecture.md b/doc/development/architecture.md index 83e40150e02..f0ce033587d 100644 --- a/doc/development/architecture.md +++ b/doc/development/architecture.md @@ -227,7 +227,7 @@ Consul is a tool for service discovery and configuration. Consul is distributed, - Configuration: - [Omnibus](https://docs.gitlab.com/omnibus/settings/database.html#disabling-automatic-database-migration) - [Charts](https://docs.gitlab.com/charts/charts/gitlab/migrations/) - - [Source](../update/upgrading_from_source.md#13-install-libs-migrations-etc) + - [Source](../update/upgrading_from_source.md#13-install-libraries-migrations-etc) - Layer: Core Service (Data) #### Elasticsearch @@ -523,7 +523,7 @@ Redis is packaged to provide a place to store: - [Project page](https://github.com/docker/distribution/blob/master/README.md) - Configuration: - - [Omnibus](../update/upgrading_from_source.md#13-install-libs-migrations-etc) + - [Omnibus](../update/upgrading_from_source.md#13-install-libraries-migrations-etc) - [Charts](https://docs.gitlab.com/charts/charts/registry/) - [Source](../administration/packages/container_registry.md#enable-the-container-registry) - [GDK](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/registry.md) diff --git a/doc/policy/maintenance.md b/doc/policy/maintenance.md index 1befcc4374d..bba16e491d0 100644 --- a/doc/policy/maintenance.md +++ b/doc/policy/maintenance.md @@ -89,9 +89,9 @@ If your GitLab instance has any GitLab Runners associated with it, it is very important to upgrade the GitLab Runners to match the GitLab minor version that was upgraded to. This is to ensure [compatibility with GitLab versions](https://docs.gitlab.com/runner/#compatibility-with-gitlab-versions). -### Version 12 onwards: Extra step for major upgrades +### Version 12 onward: Extra step for major upgrades -From version 12 onwards, an additional step is required. More significant migrations +From version 12 onward, an additional step is required. More significant migrations may occur during major release upgrades. To ensure these are successful: diff --git a/doc/raketasks/migrate_snippets.md b/doc/raketasks/migrate_snippets.md index fce91ab703e..476615d3926 100644 --- a/doc/raketasks/migrate_snippets.md +++ b/doc/raketasks/migrate_snippets.md @@ -35,7 +35,7 @@ bundle exec rake gitlab:snippets:migrate SNIPPET_IDS=1,2,3,4 ``` There is a default limit (100) to the number of ids supported in the migration -process. You can modify this limit by using the env variable `LIMIT`. +process. You can modify this limit by using the environment variable `LIMIT`. ```shell sudo gitlab-rake gitlab:snippets:migrate SNIPPET_IDS=1,2,3,4 LIMIT=50 @@ -83,7 +83,7 @@ bundle exec rake gitlab:snippets:list_non_migrated RAILS_ENV=production As the number of non-migrated snippets can be large, we limit by default the size of the number of ids returned to 100. You can -modify this limit by using the env variable `LIMIT`. +modify this limit by using the environment variable `LIMIT`. ```shell sudo gitlab-rake gitlab:snippets:list_non_migrated LIMIT=200 diff --git a/doc/security/webhooks.md b/doc/security/webhooks.md index 12c46e61873..af9be499e80 100644 --- a/doc/security/webhooks.md +++ b/doc/security/webhooks.md @@ -65,7 +65,7 @@ and expand **Outbound requests**: The allowed entries can be separated by semicolons, commas or whitespaces (including newlines) and be in different formats like hostnames, IP addresses and/or -IP ranges. IPv6 is supported. Hostnames that contain unicode characters should +IP ranges. IPv6 is supported. Hostnames that contain Unicode characters should use IDNA encoding. The allowlist can hold a maximum of 1000 entries. Each entry can be a maximum of diff --git a/doc/ssh/README.md b/doc/ssh/README.md index 6b9f6340cc6..5db1bde6413 100644 --- a/doc/ssh/README.md +++ b/doc/ssh/README.md @@ -344,7 +344,7 @@ NOTE: **Note:** The example `Host` aliases are defined as `user_1.gitlab.com` and `user_2.gitlab.com` for efficiency and transparency. Advanced configurations are more difficult to maintain; using this type of alias makes it easier to -understand when using other tools such as `git remote` subcommands. SSH +understand when using other tools such as `git remote` sub-commands. SSH would understand any string as a `Host` alias thus `Tanuki1` and `Tanuki2`, despite giving very little context as to where they point, would also work. @@ -385,7 +385,7 @@ GitLab integrates with the system-installed SSH daemon, designating a user connecting to the GitLab server over SSH are identified by their SSH key instead of their username. -SSH *client* operations performed on the GitLab server wil be executed as this +SSH *client* operations performed on the GitLab server will be executed as this user. Although it is possible to modify the SSH configuration for this user to, e.g., provide a private SSH key to authenticate these requests by, this practice is **not supported** and is strongly discouraged as it presents significant diff --git a/doc/system_hooks/system_hooks.md b/doc/system_hooks/system_hooks.md index f9d140de24f..4ece58f533d 100644 --- a/doc/system_hooks/system_hooks.md +++ b/doc/system_hooks/system_hooks.md @@ -27,7 +27,7 @@ Your GitLab instance can perform HTTP POST requests on the following events: - `user_remove_from_group` - `user_update_for_group` -The triggers for most of these are self-explanatory, but `project_update` and `project_rename` deserve some clarification: `project_update` is fired any time an attribute of a project is changed (name, description, tags, etc.) *unless* the `path` attribute is also changed. In that case, a `project_rename` is triggered instead (so that, for instance, if all you care about is the repo URL, you can just listen for `project_rename`). +The triggers for most of these are self-explanatory, but `project_update` and `project_rename` deserve some clarification: `project_update` is fired any time an attribute of a project is changed (name, description, tags, etc.) *unless* the `path` attribute is also changed. In that case, a `project_rename` is triggered instead (so that, for instance, if all you care about is the repository URL, you can just listen for `project_rename`). `user_failed_login` is sent whenever a **blocked** user attempts to login and denied access. @@ -313,7 +313,7 @@ If the user is blocked via LDAP, `state` will be `ldap_blocked`. } ``` -`owner_name` and `owner_email` are always `null`. Please see . +`owner_name` and `owner_email` are always `null`. Please see [issue #20011](https://gitlab.com/gitlab-org/gitlab/-/issues/20011). **Group renamed:** diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 03b9365fc57..2e36fea14bf 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -92,7 +92,7 @@ Git-related queries from GitLab. The following relate to Git Large File Storage: - [Getting Started with Git LFS](https://about.gitlab.com/blog/2017/01/30/getting-started-with-git-lfs-tutorial/) -- [Migrate an existing Git repo with Git LFS](lfs/migrate_to_git_lfs.md) +- [Migrate an existing Git repository with Git LFS](lfs/migrate_to_git_lfs.md) - [Removing objects from LFS](lfs/index.md#removing-objects-from-lfs) - [GitLab Git LFS user documentation](lfs/index.md) - [GitLab Git LFS admin documentation](../../administration/lfs/index.md) diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md index edd7190c0e3..706d3c3eddf 100644 --- a/doc/topics/git/lfs/index.md +++ b/doc/topics/git/lfs/index.md @@ -37,7 +37,7 @@ Documentation for GitLab instance administrators is under [LFS administration do - Any Git LFS request will ask for HTTPS credentials to be provided so a good Git credentials store is recommended - Git LFS always assumes HTTPS so if you have GitLab server on HTTP you will have - to add the URL to Git config manually (see [troubleshooting](#troubleshooting)) + to add the URL to Git configuration manually (see [troubleshooting](#troubleshooting)) NOTE: **Note:** With 8.12 GitLab added LFS support to SSH. The Git LFS communication @@ -83,7 +83,7 @@ git clone git@gitlab.example.com:group/project.git ``` If you already cloned the repository and you want to get the latest LFS object -that are on the remote repository, eg. for a branch from origin: +that are on the remote repository, such as for a branch from origin: ```shell git lfs fetch origin master @@ -91,7 +91,7 @@ git lfs fetch origin master ### Migrate an existing repo to Git LFS -Read the documentation on how to [migrate an existing Git repo with Git LFS](migrate_to_git_lfs.md). +Read the documentation on how to [migrate an existing Git repository with Git LFS](migrate_to_git_lfs.md). ### Removing objects from LFS @@ -128,7 +128,7 @@ in order to do that you can edit the `.gitattributes` file manually: ``` After a file type has been registered as lockable, Git LFS will make -them readonly on the file system automatically. This means you will +them read-only on the file system automatically. This means you will need to lock the file before editing it. ### Managing Locked Files @@ -205,8 +205,8 @@ If the status `error 501` is shown, it is because: on how to enable LFS support. - Git LFS client version is not supported by GitLab server. Check your Git LFS - version with `git lfs version`. Check the Git config of the project for traces - of deprecated API with `git lfs -l`. If `batch = false` is set in the config, + version with `git lfs version`. Check the Git configuration of the project for traces + of deprecated API with `git lfs -l`. If `batch = false` is set in the configuration, remove the line and try to update your Git LFS client. Only version 1.0.1 and newer are supported. @@ -218,9 +218,9 @@ the LFS client is trying to reach GitLab through HTTPS. However, your GitLab instance is being served on HTTP. This behavior is caused by Git LFS using HTTPS connections by default when a -`lfsurl` is not set in the Git config. +`lfsurl` is not set in the Git configuration. -To prevent this from happening, set the lfs URL in project Git config: +To prevent this from happening, set the LFS URL in project Git configuration: ```shell git config --add lfs.url "http://gitlab.example.com/group/project.git/info/lfs" diff --git a/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md b/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md index 6125e8c9f4f..09087fcae13 100644 --- a/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md +++ b/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md @@ -172,7 +172,7 @@ GitLab.com), therefore, you don't need to do anything server-side. If the terminal doesn't prompt you with a full response on `git-lfs` commands, [install the Git LFS client](https://git-lfs.github.com/) first. -1. Inside the repo, run the following command to initiate LFS: +1. Inside the repository, run the following command to initiate LFS: ```shell git lfs install @@ -189,7 +189,7 @@ GitLab.com), therefore, you don't need to do anything server-side. ``` Once you do that, run `git status` and you'll see `.gitattributes` added - to your repo. It collects all file patterns that you chose to track via + to your repository. It collects all file patterns that you chose to track via `git-lfs`. 1. Add the files, commit and push them to GitLab: diff --git a/doc/topics/git/lfs/migrate_to_git_lfs.md b/doc/topics/git/lfs/migrate_to_git_lfs.md index 60859686047..a64639a9238 100644 --- a/doc/topics/git/lfs/migrate_to_git_lfs.md +++ b/doc/topics/git/lfs/migrate_to_git_lfs.md @@ -16,18 +16,18 @@ the files are still referenced by previous commits. Through the method described on this document, first migrate to Git LFS with a tool such as the open source community-maintained [BFG](https://rtyley.github.io/bfg-repo-cleaner/) -through a mirror repo, then clean up the repository's history, +through a mirror repository, then clean up the repository's history, and lastly create LFS tracking rules to prevent new binary files from being added. This tutorial was inspired by the guide -[Use BFG to migrate a repo to Git LFS](https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html). +[Use BFG to migrate a repository to Git LFS](https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html). For more information on Git LFS, see the [references](#references) below. CAUTION: **Warning:** The method described on this guide rewrites Git history. Make -sure to back up your repo before beginning and use it at your +sure to back up your repository before beginning and use it at your own risk. ## Requirements @@ -71,7 +71,7 @@ Consider an example upstream project, `git@gitlab.com:gitlab-tests/test-git-lfs- Create a copy of your repository so that you can recover it in case something goes wrong. -1. Clone `--mirror` the repo: +1. Clone `--mirror` the repository: Cloning with the mirror flag will create a bare repository. This ensures you get all the branches within the repo. @@ -102,7 +102,7 @@ Consider an example upstream project, `git@gitlab.com:gitlab-tests/test-git-lfs- git reflog expire --expire=now --all && git gc --prune=now --aggressive ``` - You can also take a look on how to further [clean the repo](../../../user/project/repository/reducing_the_repo_size_using_git.md), + You can also take a look on how to further [clean the repository](../../../user/project/repository/reducing_the_repo_size_using_git.md), but it's not necessary for the purposes of this guide. 1. Install Git LFS in the mirror repository: @@ -166,7 +166,7 @@ but commented out to help encourage others to add to it in the future. --> - [Migrate from Git Annex to Git LFS](migrate_from_git_annex_to_git_lfs.md) - [GitLab's Git LFS user documentation](index.md) - [GitLab's Git LFS administrator documentation](../../../administration/lfs/index.md) -- Alternative method to [migrate an existing repo to Git LFS](https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs) +- Alternative method to [migrate an existing repository to Git LFS](https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs)