snapshot of https://github.com/frappe/crm.git (develop, 2026-09-18; blobs > 131072B omitted)
Some checks failed
Frontend / Unit Tests & Coverage (push) Has been skipped
Regenerate POT file (translatable strings) / Regenerate POT file (develop) (push) Failing after 1m13s
Regenerate POT file (translatable strings) / Regenerate POT file (main-hotfix) (push) Failing after 6s
Server / Tests (frappe ${{ matrix.frappe-branch }}) (push) Has been skipped
Server / Resolve frappe matrix (push) Failing after 1s
Frontend / Lint (push) Failing after 1s
Frontend / Production Build (push) Failing after 1s
Server / Coverage Wrap Up (push) Has been skipped
Frontend / Coverage Wrap Up (push) Has been skipped

This commit is contained in:
upstream-mirror
2026-09-18 01:36:01 +05:00
commit db69de1c11
905 changed files with 102713 additions and 0 deletions

63
.github/helper/install.sh vendored Normal file
View File

@@ -0,0 +1,63 @@
#!/bin/bash
set -e
cd ~ || ex
sudo apt update
sudo apt remove mysql-server mysql-client
sudo apt install libcups2-dev redis-server mariadb-client libmariadb-dev
# Frappe (and erpnext) branch to test against; set by CI matrix, defaults to develop.
FRAPPE_BRANCH="${FRAPPE_BRANCH:-develop}"
pip install frappe-bench
git clone "https://github.com/frappe/frappe" --branch "${FRAPPE_BRANCH}" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
mkdir ~/frappe-bench/sites/test_site
cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config.json" ~/frappe-bench/sites/test_site/site_config.json
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE DATABASE test_frappe"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "FLUSH PRIVILEGES"
install_whktml() {
wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
sudo chmod o+x /usr/local/bin/wkhtmltopdf
}
install_whktml &
cd ~/frappe-bench || exit
sed -i 's/watch:/# watch:/g' Procfile
sed -i 's/schedule:/# schedule:/g' Procfile
sed -i 's/socketio:/# socketio:/g' Procfile
sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
bench get-app crm "${GITHUB_WORKSPACE}"
# Only pull erpnext when the integration is under test, to keep other runs fast.
if [ "${INSTALL_ERPNEXT}" = "true" ]; then
bench get-app erpnext --branch "${FRAPPE_BRANCH}"
fi
bench setup requirements --dev
bench start &>> ~/frappe-bench/bench_start.log &
CI=Yes bench build --app frappe &
bench --site test_site reinstall --yes
if [ "${INSTALL_ERPNEXT}" = "true" ]; then
bench --verbose --site test_site install-app erpnext crm
else
bench --verbose --site test_site install-app crm
fi

16
.github/helper/site_config.json vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"db_host": "127.0.0.1",
"db_port": 3306,
"db_name": "test_frappe",
"db_password": "test_frappe",
"auto_email_id": "test@example.com",
"mail_server": "smtp.example.com",
"mail_login": "test@example.com",
"mail_password": "test",
"admin_password": "admin",
"root_login": "root",
"root_password": "root",
"host_name": "http://test_site:8000",
"install_apps": ["crm"],
"throttle_user_limit": 100
}

59
.github/helper/update_pot_file.sh vendored Normal file
View File

@@ -0,0 +1,59 @@
#!/bin/bash
set -e
cd ~ || exit
echo "Setting Up Bench..."
pip install frappe-bench
bench -v init frappe-bench --skip-assets --skip-redis-config-generation --python "$(which python)" --frappe-branch develop
cd ./frappe-bench || exit
echo "Get FCRM..."
bench get-app --skip-assets crm "${GITHUB_WORKSPACE}"
echo "Generating POT file..."
bench generate-pot-file --app crm
cd ./apps/crm || exit
echo "Configuring git user..."
git config user.email "developers@erpnext.com"
git config user.name "frappe-pr-bot"
echo "Setting the correct git remote..."
# Here, the git remote is a local file path by default. Let's change it to the upstream repo.
git remote set-url upstream https://github.com/frappe/crm.git
gh auth setup-git
# One stable branch, not a dated one. The POT file is fully regenerated every run, so a
# fresh dated branch/PR each week just piles up and conflicts once any one is merged. Reusing
# a single branch (reset to the base tip, force-pushed) keeps exactly one PR that updates in
# place and can never conflict, since it's always rebuilt from the current base.
branch_name="pot_${BASE_BRANCH}"
echo "Resetting ${branch_name} onto ${BASE_BRANCH}..."
generated_pot=$(mktemp)
cp crm/locale/main.pot "${generated_pot}"
git fetch upstream "${BASE_BRANCH}"
git checkout -f -B "${branch_name}" "upstream/${BASE_BRANCH}"
cp "${generated_pot}" crm/locale/main.pot
git add crm/locale/main.pot
if git diff --cached --quiet; then
echo "No POT changes; nothing to do."
exit 0
fi
echo "Commiting changes..."
git commit -m "chore: update POT file"
echo "Pushing ${branch_name}..."
git push -u upstream "${branch_name}" --force
if gh pr view "${branch_name}" -R frappe/crm --json state -q '.state' 2>/dev/null | grep -q OPEN; then
echo "PR already open for ${branch_name}; force-push updated it."
else
echo "Creating a PR..."
gh pr create --fill --base "${BASE_BRANCH}" --head "${branch_name}" -R frappe/crm
fi