From f1da2397ebec06b486e93be2d0e6393e587ce78b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 9 Jul 2024 21:26:04 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/rules.gitlab-ci.yml | 2 + Gemfile.checksum | 2 +- Gemfile.lock | 2 +- .../lib/utils/datetime/date_format_utility.js | 122 ++-- .../branch_rules/components/view/index.vue | 4 +- .../components/usage_quotas_app.vue | 14 +- app/assets/stylesheets/tailwind.css | 67 -- .../types/container_repository_type.rb | 16 + .../container_registry/protection/rule.rb | 28 + .../npm/process_package_file_service.rb | 2 +- .../feature_flags/beta/ai_gateway_agents.yml | 9 + config/tailwind.config.js | 265 -------- .../geo/replication/troubleshooting/common.md | 6 +- doc/api/graphql/reference/index.md | 2 + doc/api/merge_requests.md | 68 +- ...dicated-capacity-planning-as-a-service.png | Bin 55472 -> 0 bytes ...edicated-capacity-planning-forecasting.png | Bin 59993 -> 0 bytes .../dedicated-capacity-planning-reporting.png | Bin 93136 -> 0 bytes .../images/image-20230911144743188.png | Bin 24672 -> 0 bytes .../blueprints/capacity_planning/index.md | 203 +----- .../ci_pipeline_components/index.md | 63 +- .../decisions/001_lb_entry_point.md | 55 +- .../blueprints/cloud_connector/index.md | 70 +-- .../cloud_native_build_logs/index.md | 128 +--- .../cloud_native_gitlab_pages/index.md | 107 +--- .../index.md | 594 +----------------- .../index.md | 354 +---------- .../blueprints/database_testing/index.md | 256 +------- .../feature_flags_development/index.md | 125 +--- .../index.md | 4 +- .../gitlab_agent_deployments/index.md | 311 +-------- .../blueprints/gitlab_housekeeper/index.md | 136 +--- .../index.md | 144 +---- .../blueprints/image_resizing/index.md | 115 +--- doc/development/ai_features/index.md | 172 ++++- .../documentation/styleguide/word_list.md | 9 + doc/user/analytics/index.md | 69 +- .../secret_detection/pipeline/index.md | 1 - doc/user/project/codeowners/reference.md | 11 +- .../code_suggestions/supported_extensions.md | 6 +- doc/user/project/wiki/index.md | 3 +- lib/api/helpers.rb | 4 + package.json | 2 +- qa/qa/tools/ci/export_code_paths_mapping.rb | 10 +- .../ci/export_code_paths_mapping_spec.rb | 1 + scripts/frontend/lib/tailwind_migration.mjs | 4 + scripts/frontend/tailwind_all_the_way.mjs | 24 +- .../components/usage_quotas_app_spec.js | 43 +- spec/frontend/usage_quotas/mock_data.js | 26 + .../container_repository_details_type_spec.rb | 3 +- .../types/container_repository_type_spec.rb | 2 +- .../protection/rule_spec.rb | 42 ++ .../project/container_repositories_spec.rb | 85 +++ spec/requests/api/groups_spec.rb | 39 ++ .../npm/process_package_file_service_spec.rb | 16 +- yarn.lock | 8 +- 56 files changed, 775 insertions(+), 3079 deletions(-) create mode 100644 config/feature_flags/beta/ai_gateway_agents.yml delete mode 100644 doc/architecture/blueprints/capacity_planning/images/dedicated-capacity-planning-as-a-service.png delete mode 100644 doc/architecture/blueprints/capacity_planning/images/dedicated-capacity-planning-forecasting.png delete mode 100644 doc/architecture/blueprints/capacity_planning/images/dedicated-capacity-planning-reporting.png delete mode 100644 doc/architecture/blueprints/capacity_planning/images/image-20230911144743188.png diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index ddea2cf48ca..79c85d0b2a4 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1758,6 +1758,8 @@ .qa:rules:e2e:test-on-cng: rules: + - <<: *if-merge-request-targeting-stable-branch + when: never - <<: *if-security-merge-request when: never - <<: *if-security-schedule diff --git a/Gemfile.checksum b/Gemfile.checksum index 7f8a5a5a00d..455954099e0 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -525,7 +525,7 @@ {"name":"rack","version":"2.2.9","platform":"ruby","checksum":"fd6301a97a1c1e955e68f85c861fcb1cde6145a32c532e1ea321a72ff8cc4042"}, {"name":"rack-accept","version":"0.4.5","platform":"ruby","checksum":"66247b5449db64ebb93ae2ec4af4764b87d1ae8a7463c7c68893ac13fa8d4da2"}, {"name":"rack-attack","version":"6.7.0","platform":"ruby","checksum":"3ca47e8f66cd33b2c96af53ea4754525cd928ed3fa8da10ee6dad0277791d77c"}, -{"name":"rack-cors","version":"2.0.1","platform":"ruby","checksum":"bcc66bdf5c6a4af05d571c4d01d35ac4a873552ba4f86c05fbe39365c39b9b0a"}, +{"name":"rack-cors","version":"2.0.2","platform":"ruby","checksum":"415d4e1599891760c5dc9ef0349c7fecdf94f7c6a03e75b2e7c2b54b82adda1b"}, {"name":"rack-oauth2","version":"1.21.3","platform":"ruby","checksum":"4e72a79dd6a866692e84422a552b27c38a5a1918ded06661e04910f2bbe676ba"}, {"name":"rack-protection","version":"2.2.2","platform":"ruby","checksum":"fd41414dbabbec274af0bdb1f72a48504449de4d979782c9af38cbb5dfff3299"}, {"name":"rack-proxy","version":"0.7.7","platform":"ruby","checksum":"446a4b57001022145d5c3ba73b775f66a2260eaf7420c6907483141900395c8a"}, diff --git a/Gemfile.lock b/Gemfile.lock index fee33d7230c..64cbbe4478d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1427,7 +1427,7 @@ GEM rack (>= 0.4) rack-attack (6.7.0) rack (>= 1.0, < 4) - rack-cors (2.0.1) + rack-cors (2.0.2) rack (>= 2.0.0) rack-oauth2 (1.21.3) activesupport diff --git a/app/assets/javascripts/lib/utils/datetime/date_format_utility.js b/app/assets/javascripts/lib/utils/datetime/date_format_utility.js index 9a6052d469e..3236a2c46d7 100644 --- a/app/assets/javascripts/lib/utils/datetime/date_format_utility.js +++ b/app/assets/javascripts/lib/utils/datetime/date_format_utility.js @@ -10,7 +10,7 @@ import { parsePikadayDate } from './pikaday_utility'; * If `abbreviated` is provided, returns abbreviated * name. * - * @param {Boolean} abbreviated + * @param {boolean} abbreviated */ export const getMonthNames = (abbreviated) => { if (abbreviated) { @@ -49,7 +49,7 @@ export const getMonthNames = (abbreviated) => { * Returns month name based on provided date. * * @param {Date} date - * @param {Boolean} abbreviated + * @param {boolean} abbreviated */ export const monthInWords = (date, abbreviated = false) => { if (!date) { @@ -59,6 +59,13 @@ export const monthInWords = (date, abbreviated = false) => { return getMonthNames(abbreviated)[date.getMonth()]; }; +/** + * Formats date to `January 01, 1970` + * + * @param {Date} [date] + * @param {boolean} [abbreviated] + * @param {boolean} [hideYear] + */ export const dateInWords = (date, abbreviated = false, hideYear = false) => { if (!date) return date; @@ -86,9 +93,10 @@ export const dateInWords = (date, abbreviated = false, hideYear = false) => { * * The largest supported unit is "days". * - * @param {Number} intervalInSeconds The time interval in seconds - * @param {Object} params.abbreviated - Abbreviate the returned units (seconds = s, days = d, etc) - * @returns {String} A humanized description of the time interval + * @param {number} intervalInSeconds The time interval in seconds + * @param {Object} [params] + * @param {boolean} [params.abbreviated] Abbreviate the returned units (seconds = s, days = d, etc) + * @returns {string} A humanized description of the time interval */ export const humanizeTimeInterval = (intervalInSeconds, { abbreviated = false } = {}) => { if (intervalInSeconds < 60 /* = 1 minute */) { @@ -123,19 +131,20 @@ export const getWeekdayNames = () => [ /** * Given a date object returns the day of the week in English - * @param {date} date - * @returns {String} + * @param {Date} date + * @returns {string} */ export const getDayName = (date) => getWeekdayNames()[date.getDay()]; /** * Returns the i18n month name from a given date * @example - * formatDateAsMonth(new Date('2020-06-28')) -> 'Jun' - * @param {String} datetime where month is extracted from - * @param {Object} options - * @param {Boolean} options.abbreviated whether to use the abbreviated month string, or not - * @return {String} the i18n month name + * // returns 'Jun' + * formatDateAsMonth(new Date('2020-06-28')) + * @param {string} datetime where month is extracted from + * @param {Object} [options] + * @param {boolean} [options.abbreviated] whether to use the abbreviated month string, or not + * @return {string} the i18n month name */ export function formatDateAsMonth(datetime, options = {}) { const { abbreviated = true } = options; @@ -145,11 +154,12 @@ export function formatDateAsMonth(datetime, options = {}) { /** * @example - * dateFormat('2017-12-05','mmm d, yyyy h:MMtt Z' ) -> "Dec 5, 2017 12:00am UTC" - * @param {date} datetime - * @param {String} format - * @param {Boolean} UTC convert local time to UTC - * @returns {String} + * // returns "Dec 5, 2017 12:00am UTC" + * formatDate('2017-12-05','mmm d, yyyy h:MMtt Z' ) + * @param {(Date|string|number)} [datetime] + * @param {string} format + * @param {boolean} UTC convert local time to UTC + * @returns {string} */ export const formatDate = (datetime, format = 'mmm d, yyyy h:MMtt Z', utc = false) => { if (isString(datetime) && datetime.match(/\d+-\d+\d+ /)) { @@ -162,7 +172,7 @@ export const formatDate = (datetime, format = 'mmm d, yyyy h:MMtt Z', utc = fals * Formats milliseconds as timestamp (e.g. 01:02:03). * This takes durations longer than a day into account (e.g. two days would be 48:00:00). * - * @param milliseconds + * @param {number} milliseconds * @returns {string} */ export const formatTime = (milliseconds) => { @@ -190,8 +200,8 @@ export const formatTime = (milliseconds) => { /** * Port of ruby helper time_interval_in_words. * - * @param {Number} seconds - * @return {String} + * @param {number} seconds + * @return {string} */ export const timeIntervalInWords = (intervalInSeconds) => { const secondsInteger = parseInt(intervalInSeconds, 10); @@ -231,6 +241,8 @@ export const stringifyTime = (timeObject, fullNameFormat = false) => { * Accepts seconds and returns a timeObject { weeks: #, days: #, hours: #, minutes: # } * Seconds can be negative or positive, zero or non-zero. Can be configured for any day * or week length. + * + * @param {number} seconds */ export const parseSeconds = ( seconds, @@ -276,7 +288,7 @@ export const parseSeconds = ( /** * Pads given items with zeros to reach a length of 2 characters. * - * @param {...any} args Items to be padded. + * @param {...any} args Items to be padded. * @returns {Array} Padded items. */ export const padWithZeros = (...args) => args.map((arg) => `${arg}`.padStart(2, '0')); @@ -286,12 +298,15 @@ export const padWithZeros = (...args) => args.map((arg) => `${arg}`.padStart(2, * This can be useful when populating date/time fields along with a distinct timezone selector, in * which case we'd want to ignore the timezone's offset when populating the date and time. * - * Examples: - * stripTimezoneFromISODate('2021-08-16T00:00:00.000-02:00') => '2021-08-16T00:00:00.000' - * stripTimezoneFromISODate('2021-08-16T00:00:00.000Z') => '2021-08-16T00:00:00.000' + * @example + * // returns '2021-08-16T00:00:00.000' + * stripTimezoneFromISODate('2021-08-16T00:00:00.000-02:00') + * @example + * // returns '2021-08-16T00:00:00.000' + * stripTimezoneFromISODate('2021-08-16T00:00:00.000Z') * - * @param {String} date The ISO date string representation. - * @returns {String} The ISO date string without the timezone. + * @param {string} date The ISO date string representation. + * @returns {string} The ISO date string without the timezone. */ export const stripTimezoneFromISODate = (date) => { if (Number.isNaN(Date.parse(date))) { @@ -302,11 +317,13 @@ export const stripTimezoneFromISODate = (date) => { /** * Extracts the year, month and day from a Date instance and returns them in an object. - * For example: - * dateToYearMonthDate(new Date('2021-08-16')) => { year: '2021', month: '08', day: '16' } + * + * @example + * // returns { year: '2021', month: '08', day: '16' } + * dateToYearMonthDate(new Date('2021-08-16')) * * @param {Date} date The date to be parsed - * @returns {Object} An object containing the extracted year, month and day. + * @returns An object containing the extracted year, month and day. */ export const dateToYearMonthDate = (date) => { if (!isDate(date)) { @@ -323,11 +340,13 @@ export const dateToYearMonthDate = (date) => { /** * Extracts the hours and minutes from a string representing a time. - * For example: - * timeToHoursMinutes('12:46') => { hours: '12', minutes: '46' } * - * @param {String} time The time to be parsed in the form HH:MM. - * @returns {Object} An object containing the hours and minutes. + * @example + * // returns { hours: '12', minutes: '46' } + * timeToHoursMinutes('12:46') + * + * @param {string} time The time to be parsed in the form HH:MM. + * @returns An object containing the hours and minutes. */ export const timeToHoursMinutes = (time = '') => { if (!time || !time.match(/\d{1,2}:\d{1,2}/)) { @@ -341,10 +360,10 @@ export const timeToHoursMinutes = (time = '') => { /** * This combines a date and a time and returns the computed Date's ISO string representation. * - * @param {Date} date Date object representing the base date. - * @param {String} time String representing the time to be used, in the form HH:MM. - * @param {String} offset An optional Date-compatible offset. - * @returns {String} The combined Date's ISO string representation. + * @param {Date} date Date object representing the base date. + * @param {string} time String representing the time to be used, in the form HH:MM. + * @param {string} offset An optional Date-compatible offset. + * @returns {string} The combined Date's ISO string representation. */ export const dateAndTimeToISOString = (date, time, offset = '') => { const { year, month, day } = dateToYearMonthDate(date); @@ -361,8 +380,8 @@ export const dateAndTimeToISOString = (date, time, offset = '') => { * Converts a Date instance to time input-compatible value consisting in a 2-digits hours and * minutes, separated by a semi-colon, in the 24-hours format. * - * @param {Date} date Date to be converted - * @returns {String} time input-compatible string in the form HH:MM. + * @param {Date} date Date to be converted + * @returns {string} time input-compatible string in the form HH:MM. */ export const dateToTimeInputValue = (date) => { if (!isDate(date)) { @@ -376,6 +395,21 @@ export const dateToTimeInputValue = (date) => { }); }; +/** + * Formats a given amount of time units + * + * @example + * // returns '42 days' + * formatTimeAsSummary({ days: 42 }); + * + * @param {Object} config object containing exactly one property to format + * @param {number} [config.seconds] + * @param {number} [config.minutes] + * @param {number} [config.hours] + * @param {number} [config.days] + * @param {number} [config.weeks] + * @param {number} [config.months] + */ export const formatTimeAsSummary = ({ seconds, hours, days, minutes, weeks, months }) => { if (months) { const value = roundToNearestHalf(months); @@ -431,9 +465,8 @@ export const formatTimeAsSummary = ({ seconds, hours, days, minutes, weeks, mont * ie -32400 => -9 hours * ie -12600 => -3.5 hours * - * @param {Number} offset UTC offset in seconds as a integer - * - * @return {String} the + or - offset in hours, e.g. `-10`, ` 0`, `+4` + * @param {number} offset UTC offset in seconds as a integer + * @returns {string} the + or - offset in hours, e.g. `-10`, ` 0`, `+4` */ export const formatUtcOffset = (offset) => { const parsed = parseInt(offset, 10); @@ -447,8 +480,8 @@ export const formatUtcOffset = (offset) => { /** * Returns formatted timezone * - * @param {Object} timezone item with offset and name - * @returns {String} the UTC timezone with the offset, e.g. `[UTC+2] Berlin, [UTC 0] London` + * @param {Object} timezone item with offset and name + * @returns {string} the UTC timezone with the offset, e.g. `[UTC+2] Berlin, [UTC 0] London` */ export const formatTimezone = ({ offset, name }) => `[UTC${formatUtcOffset(offset)}] ${name}`; @@ -457,7 +490,6 @@ export const formatTimezone = ({ offset, name }) => `[UTC${formatUtcOffset(offse * * @param {Date} startDate * @param {Date} dueDate - * @returns */ export const humanTimeframe = (startDate, dueDate) => { const start = startDate ? parsePikadayDate(startDate) : null; diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue b/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue index 3e8c24cd6ce..ad62159b50a 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue +++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue @@ -380,7 +380,9 @@ export default {
{{ $options.i18n.allBranches }}
- {{ branch }} + {{ + branch + }}

{{ matchingBranchesLinkTitle }}

diff --git a/app/assets/javascripts/usage_quotas/components/usage_quotas_app.vue b/app/assets/javascripts/usage_quotas/components/usage_quotas_app.vue index 9d6c365b363..ccb62a5b2f5 100644 --- a/app/assets/javascripts/usage_quotas/components/usage_quotas_app.vue +++ b/app/assets/javascripts/usage_quotas/components/usage_quotas_app.vue @@ -1,10 +1,14 @@