Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/feature_flags/development/namespace_storage_limit_bypass_date_check.yml8
-rw-r--r--config/initializers/doorkeeper_openid_connect_patch.rb23
-rw-r--r--config/routes/group.rb2
-rw-r--r--config/vue3migration/compiler.js113
4 files changed, 89 insertions, 57 deletions
diff --git a/config/feature_flags/development/namespace_storage_limit_bypass_date_check.yml b/config/feature_flags/development/namespace_storage_limit_bypass_date_check.yml
deleted file mode 100644
index f70e60d14b5..00000000000
--- a/config/feature_flags/development/namespace_storage_limit_bypass_date_check.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: namespace_storage_limit_bypass_date_check
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86794
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/361785
-milestone: '15.0'
-type: development
-group: group::utilization
-default_enabled: false
diff --git a/config/initializers/doorkeeper_openid_connect_patch.rb b/config/initializers/doorkeeper_openid_connect_patch.rb
deleted file mode 100644
index d61b70eaa31..00000000000
--- a/config/initializers/doorkeeper_openid_connect_patch.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-# This pulls in
-# https://github.com/doorkeeper-gem/doorkeeper-openid_connect/pull/194
-# to ensure generated `kid` values are RFC 7638-compliant.
-require 'doorkeeper/openid_connect'
-
-raise 'This patch is only needed for doorkeeper_openid_connect v1.8.5' if Doorkeeper::OpenidConnect::VERSION != '1.8.5'
-
-module Doorkeeper
- module OpenidConnect
- def self.signing_key
- key =
- if %i[HS256 HS384 HS512].include?(signing_algorithm)
- configuration.signing_key
- else
- OpenSSL::PKey.read(configuration.signing_key)
- end
-
- ::JWT::JWK.new(key, { kid_generator: JWT::JWK::Thumbprint })
- end
- end
-end
diff --git a/config/routes/group.rb b/config/routes/group.rb
index ef49e53d4d3..9b346867f78 100644
--- a/config/routes/group.rb
+++ b/config/routes/group.rb
@@ -158,6 +158,8 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
resources :contacts, only: [:index, :new, :edit]
resources :organizations, only: [:index, :new, :edit]
end
+
+ resources :achievements, only: [:index, :new, :edit]
end
scope(
diff --git a/config/vue3migration/compiler.js b/config/vue3migration/compiler.js
index a2c82584227..d6b6e1e7533 100644
--- a/config/vue3migration/compiler.js
+++ b/config/vue3migration/compiler.js
@@ -2,16 +2,20 @@ const { parse, compile: compilerDomCompile } = require('@vue/compiler-dom');
const COMMENT_NODE_TYPE = 3;
-const getPropIndex = (node, prop) => node.props?.findIndex((p) => p.name === prop) ?? -1;
+const hasProp = (node, prop) => node.props?.some((p) => p.name === prop);
function modifyKeysInsideTemplateTag(templateNode) {
+ if (!templateNode.tag === 'template' || !hasProp(templateNode, 'for')) {
+ return;
+ }
+
let keyCandidate = null;
for (const node of templateNode.children) {
const keyBindingIndex = node.props
? node.props.findIndex((prop) => prop.arg && prop.arg.content === 'key')
: -1;
- if (keyBindingIndex !== -1 && getPropIndex(node, 'for') === -1) {
+ if (keyBindingIndex !== -1 && !hasProp(node, 'for')) {
if (!keyCandidate) {
keyCandidate = node.props[keyBindingIndex];
}
@@ -24,40 +28,97 @@ function modifyKeysInsideTemplateTag(templateNode) {
}
}
+function getSlotName(node) {
+ return node?.props?.find((prop) => prop.name === 'slot')?.arg?.content;
+}
+
+function filterCommentNodeAndTrailingSpace(node, idx, list) {
+ if (node.type === COMMENT_NODE_TYPE) {
+ return false;
+ }
+
+ if (node.content !== ' ') {
+ return true;
+ }
+
+ if (list[idx - 1]?.type === COMMENT_NODE_TYPE) {
+ return false;
+ }
+
+ return true;
+}
+
+function filterCommentNodes(node) {
+ const { length: originalLength } = node.children;
+ // eslint-disable-next-line no-param-reassign
+ node.children = node.children.filter(filterCommentNodeAndTrailingSpace);
+ if (node.children.length !== originalLength) {
+ // trim remaining spaces
+ while (node.children.at(-1)?.content === ' ') {
+ node.children.pop();
+ }
+ }
+}
+
+function dropVOnceForChildrenInsideVIfBecauseOfIssue7725(node) {
+ // See https://github.com/vuejs/core/issues/7725 for details
+ if (!hasProp(node, 'if')) {
+ return;
+ }
+
+ node.children?.forEach((child) => {
+ if (Array.isArray(child.props)) {
+ // eslint-disable-next-line no-param-reassign
+ child.props = child.props.filter((prop) => prop.name !== 'once');
+ }
+ });
+}
+
+function fixSameSlotsInsideTemplateFailingWhenUsingWhitespacePreserveDueToIssue6063(node) {
+ // See https://github.com/vuejs/core/issues/6063 for details
+ // eslint-disable-next-line no-param-reassign
+ node.children = node.children.filter((child, idx) => {
+ if (child.content !== ' ') {
+ // We need to drop only comment nodes
+ return true;
+ }
+
+ const previousNodeSlotName = getSlotName(node.children[idx - 1]);
+ const nextNodeSlotName = getSlotName(node.children[idx + 1]);
+
+ if (previousNodeSlotName && previousNodeSlotName === nextNodeSlotName) {
+ // We have a space beween two slot entries with same slot name, we need to drop it
+ return false;
+ }
+
+ return true;
+ });
+}
+
module.exports = {
parse,
compile(template, options) {
const rootNode = parse(template, options);
- // We do not want to switch to whitespace: collapse mode which is Vue.js 3 default
- // It will be too devastating to codebase
+ const pendingNodes = [rootNode];
+ while (pendingNodes.length) {
+ const currentNode = pendingNodes.pop();
+ if (Array.isArray(currentNode.children)) {
+ // This one will be dropped all together with compiler when we drop Vue.js 2 support
+ modifyKeysInsideTemplateTag(currentNode);
- // However, without `whitespace: condense` Vue will treat spaces between comments
- // and nodes itself as text nodes, resulting in multi-root component
- // For multi-root component passing classes / attributes fallthrough will not work
+ dropVOnceForChildrenInsideVIfBecauseOfIssue7725(currentNode);
- // See https://github.com/vuejs/core/issues/7909 for details
+ // See https://github.com/vuejs/core/issues/7909 for details
+ // However, this issue applies not only to root-level nodes
+ // But on any level comments could change slot emptiness detection
+ // so we simply drop them
+ filterCommentNodes(currentNode);
- // To fix that we simply drop all component comments only on top-level
- rootNode.children = rootNode.children.filter((n) => n.type !== COMMENT_NODE_TYPE);
+ fixSameSlotsInsideTemplateFailingWhenUsingWhitespacePreserveDueToIssue6063(currentNode);
- const pendingNodes = [rootNode];
- while (pendingNodes.length) {
- const currentNode = pendingNodes.pop();
- if (getPropIndex(currentNode, 'for') !== -1) {
- if (currentNode.tag === 'template') {
- // This one will be dropped all together with compiler when we drop Vue.js 2 support
- modifyKeysInsideTemplateTag(currentNode);
- }
-
- // This one will be dropped when https://github.com/vuejs/core/issues/7725 will be fixed
- const vOncePropIndex = getPropIndex(currentNode, 'once');
- if (vOncePropIndex !== -1) {
- currentNode.props.splice(vOncePropIndex, 1);
- }
+ currentNode.children.forEach((child) => pendingNodes.push(child));
}
-
- currentNode.children?.forEach((child) => pendingNodes.push(child));
}
return compilerDomCompile(rootNode, options);