diff --git a/app/assets/javascripts/ide/stores/modules/file_templates/getters.js b/app/assets/javascripts/ide/stores/modules/file_templates/getters.js index e8a72f7bc52..4a407aea557 100644 --- a/app/assets/javascripts/ide/stores/modules/file_templates/getters.js +++ b/app/assets/javascripts/ide/stores/modules/file_templates/getters.js @@ -18,6 +18,10 @@ export const templateTypes = () => [ name: __('Dockerfile'), key: 'dockerfiles', }, + { + name: '.metrics-dashboard.yml', + key: 'metrics_dashboard_ymls', + }, ]; export const showFileTemplatesBar = (_, getters, rootState) => name => diff --git a/doc/development/documentation/styleguide.md b/doc/development/documentation/styleguide.md index 9ad93ae01fd..ad5ac75f96f 100644 --- a/doc/development/documentation/styleguide.md +++ b/doc/development/documentation/styleguide.md @@ -827,9 +827,40 @@ Using the Markdown extension is necessary for the [`/help`](index.md#gitlab-help ### Links to external documentation When describing interactions with external software, it's often helpful to include links to external -documentation. When possible, make sure that you are linking to an **authoritative** source. +documentation. When possible, make sure that you're linking to an [**authoritative** source](#authoritative-sources). For example, if you're describing a feature in Microsoft's Active Directory, include a link to official Microsoft documentation. +### Authoritative sources + +When citing external information, use sources that are written by the people who created +the item or product in question. These sources are the most likely to +be accurate and remain up to date. + +Examples of authoritative sources include: + +- Specifications, such as a [Request for Comments](https://www.ietf.org/standards/rfcs/) document +from the Internet Engineering Task Force. +- Official documentation for a product. For example, if you're setting up an interface with the +Google OAuth 2 authorization server, include a link to Google's documentation. +- Official documentation for a project. For example, if you're citing NodeJS functionality, +refer directly to [NodeJS documentation](https://nodejs.org/en/docs/). +- Books from an authoritative publisher. + +Examples of sources to avoid include: + +- Personal blog posts. +- Wikipedia. +- Non-trustworthy articles. +- Discussions on forums such as Stack Overflow. +- Documentation from a company that describes another company's product. + +While many of these sources to avoid can help you learn skills and or features, they can become +obsolete quickly. Nobody is obliged to maintain any of these sites. Therefore, we should avoid using them as reference literature. + +NOTE: **Note:** +Non-authoritative sources are acceptable only if there is no equivalent authoritative source. +Even then, focus on non-authoritative sources that are extensively cited or peer-reviewed. + ### Links requiring permissions Don't link directly to: diff --git a/lib/gitlab/danger/teammate.rb b/lib/gitlab/danger/teammate.rb index a06c3554d3d..dac61126488 100644 --- a/lib/gitlab/danger/teammate.rb +++ b/lib/gitlab/danger/teammate.rb @@ -82,7 +82,7 @@ module Gitlab diff = floored_offset_hours - author.floored_offset_hours return "same timezone as `@#{author.username}`" if diff.zero? - ahead_or_behind = diff < 0 ? 'behind' : 'ahead' + ahead_or_behind = diff < 0 ? 'behind' : 'ahead of' pluralized_hours = pluralize(diff.abs, 'hour', 'hours') "#{pluralized_hours} #{ahead_or_behind} `@#{author.username}`" diff --git a/spec/frontend/ide/stores/modules/file_templates/getters_spec.js b/spec/frontend/ide/stores/modules/file_templates/getters_spec.js index 5855496a330..c9676b23fa1 100644 --- a/spec/frontend/ide/stores/modules/file_templates/getters_spec.js +++ b/spec/frontend/ide/stores/modules/file_templates/getters_spec.js @@ -5,7 +5,7 @@ import * as getters from '~/ide/stores/modules/file_templates/getters'; describe('IDE file templates getters', () => { describe('templateTypes', () => { it('returns list of template types', () => { - expect(getters.templateTypes().length).toBe(4); + expect(getters.templateTypes().length).toBe(5); }); }); diff --git a/spec/lib/gitlab/danger/teammate_spec.rb b/spec/lib/gitlab/danger/teammate_spec.rb index 385eb4e9b69..82bed5073db 100644 --- a/spec/lib/gitlab/danger/teammate_spec.rb +++ b/spec/lib/gitlab/danger/teammate_spec.rb @@ -192,12 +192,12 @@ RSpec.describe Gitlab::Danger::Teammate do context 'when author is given' do where(:tz_offset_hours, :author_offset, :diff_text) do -12 | -10 | "2 hours behind `@mario`" - -10 | -12 | "2 hours ahead `@mario`" + -10 | -12 | "2 hours ahead of `@mario`" -10 | 2 | "12 hours behind `@mario`" 2 | 4 | "2 hours behind `@mario`" - 4 | 2 | "2 hours ahead `@mario`" + 4 | 2 | "2 hours ahead of `@mario`" 2 | 3 | "1 hour behind `@mario`" - 3 | 2 | "1 hour ahead `@mario`" + 3 | 2 | "1 hour ahead of `@mario`" 2 | 2 | "same timezone as `@mario`" end