chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:24:55 +08:00
commit 7baeb17845
15305 changed files with 2077301 additions and 0 deletions
@@ -0,0 +1,55 @@
#!/usr/bash
block_unresolved_conflict() {
set -e
[ "$CI" = "true" ] && set -x
# Git conflict marker, typically 7 characters
local match="<<<<<<<|=======|>>>>>>>"
local diff_params="$1 --name-status -G $match"
local count=0
if [[ $1 == *..* ]]; then
# Checking whether the branch exists can solve the problem that the feature branch is removed after the merge, resulting in an error in git.
sourceBranch=${1%%..*}
targetBranch=${1#*..}
if ! git branch -a | grep -qE "$sourceBranch"; then
echo "branch do not exist: $sourceBranch"
return 0
fi
if ! git branch -a | grep -qE "$targetBranch"; then
echo "branch do not exist: $targetBranch"
return 0
fi
fi
# Specify the pattern you want to exclude
EXCLUDE_PATTERNS=(
'frontend/scripts/block-unresolved-conflict.sh'
'frontend/packages/arch/bot-api/src/auto-generate/**'
'frontend/packages/arch/idl/src/**'
'common/git-hooks/**'
)
for pattern in "${EXCLUDE_PATTERNS[@]}"; do
exclude_string+=":(exclude)$pattern "
done
diff_params+=" $exclude_string"
# Only detect modified files
conflicts=$(git diff $diff_params | grep '^M' | cut -f 2-)
if [[ -n "$conflicts" ]]; then
for conflict in $conflicts; do
if grep -Eq $match $conflict; then
echo $conflict
((count++))
fi
done
if [[ $count -ne 0 ]]; then
echo "Unresolved merge conflicts in these files, please check"
exit 1
fi
fi
return 0
}
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR=$(realpath "$SCRIPT_DIR/..")
if [ "$CUSTOM_SKIP_POST_INSTALL" == "true" ]; then
exit 0
fi
# pushd $ROOT_DIR/packages/arch/i18n && npm run pull-i18n && popd || exit
node $ROOT_DIR/common/scripts/install-run-rush.js pull-idl -a install || exit
if [ "$NO_STARLING" != true ]; then
# Update copy
pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:starling && popd || exit
pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:starling-cozeloop && popd || exit
fi
if [ "$CI" != "true" ]; then
node $ROOT_DIR/common/scripts/install-run-rush.js pre-build -o tag:phase-prebuild -v
fi
# if [ -z "$BUILD_TYPE" ]; then
# #update icon
# pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:icon && popd || exit
# pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:illustration && popd || exit
# fi
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
#
# Copyright 2025 coze-dev Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Set the red ANSI escape code
RED='\033[0;31m'
# ANSI escape code to reset color
NC='\033[0m'
CURRENT_USER=$(git config user.email)
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
CURRENT_ORIGIN_BRANCH=$(git rev-parse --abbrev-ref @{u})
# Get current origin URL
CURRENT_ORIGIN_URL=$(git remote get-url origin)
# if [[ -n "$CURRENT_ORIGIN_BRANCH" ]]; then
# block_unresolved_conflict "$CURRENT_BRANCH..$CURRENT_ORIGIN_BRANCH"
# fi
# Check if current origin contains coze-dev/coze-studio
if [[ "$CURRENT_ORIGIN_URL" == *"coze-dev/coze-studio"* ]]; then
# Block push to main branch for coze-dev/coze-studio repository
if [ "$CURRENT_BRANCH" = "main" ] && [ "$CURRENT_USER" != "ci_flow@bytedance.com" ]; then
echo "${RED}Do not push to main branch manually!!!${NC}"
exit 1
fi
fi
if git status --porcelain | grep -q "pnpm-lock.yaml"; then
echo -e "${RED}Error: pnpm-lock.yaml is included in the changes. Please commit it before push!${NC}"
exit 1
fi
+21
View File
@@ -0,0 +1,21 @@
retry() {
local retries=$1 # number of retries
local wait_time=$2 # waiting time
shift 2
local count=0
cd $(pwd)
until "$@"; do
exit_code=$?
count=$((count + 1))
if [ $count -lt $retries ]; then
echo "Attempt $count/$retries failed with exit code $exit_code. Retrying in $wait_time seconds..."
sleep $wait_time
else
echo "Attempt $count/$retries failed with exit code $exit_code. No more retries left."
return $exit_code
fi
done
return 0
}
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# Copyright 2025 coze-dev Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Setup common env for CI & SCM
# 1. Ignore installs that do not affect builds
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
export CYPRESS_INSTALL_BINARY=0
export TAIKO_SKIP_CHROMIUM_DOWNLOAD=0
export RE2_DOWNLOAD_SKIP_PATH=1
# 2. Effective in the CI environment:
echo ::set-env name=PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD::$PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD
echo ::set-env name=CYPRESS_INSTALL_BINARY::$CYPRESS_INSTALL_BINARY
echo ::set-env name=TAIKO_SKIP_CHROMIUM_DOWNLOAD::$TAIKO_SKIP_CHROMIUM_DOWNLOAD
echo ::set-env name=RE2_DOWNLOAD_SKIP_PATH::$RE2_DOWNLOAD_SKIP_PATH
echo ::set-env name=RE2_DOWNLOAD_MIRROR::$RE2_DOWNLOAD_MIRROR