chore: v15 release
This commit is contained in:
parent
d09618bf05
commit
fca812448e
60
.github/helper/translation.py
vendored
60
.github/helper/translation.py
vendored
@ -1,60 +0,0 @@
|
|||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
errors_encounter = 0
|
|
||||||
pattern = re.compile(r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,(\s*?.*?\n*?)*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)")
|
|
||||||
words_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}.*?[a-zA-Z]")
|
|
||||||
start_pattern = re.compile(r"_{1,2}\([f\"'`]{1,3}")
|
|
||||||
f_string_pattern = re.compile(r"_\(f[\"']")
|
|
||||||
starts_with_f_pattern = re.compile(r"_\(f")
|
|
||||||
|
|
||||||
# skip first argument
|
|
||||||
files = sys.argv[1:]
|
|
||||||
files_to_scan = [_file for _file in files if _file.endswith(('.py', '.js'))]
|
|
||||||
|
|
||||||
for _file in files_to_scan:
|
|
||||||
with open(_file, 'r') as f:
|
|
||||||
print(f'Checking: {_file}')
|
|
||||||
file_lines = f.readlines()
|
|
||||||
for line_number, line in enumerate(file_lines, 1):
|
|
||||||
if 'frappe-lint: disable-translate' in line:
|
|
||||||
continue
|
|
||||||
|
|
||||||
start_matches = start_pattern.search(line)
|
|
||||||
if start_matches:
|
|
||||||
starts_with_f = starts_with_f_pattern.search(line)
|
|
||||||
|
|
||||||
if starts_with_f:
|
|
||||||
has_f_string = f_string_pattern.search(line)
|
|
||||||
if has_f_string:
|
|
||||||
errors_encounter += 1
|
|
||||||
print(f'\nF-strings are not supported for translations at line number {line_number}\n{line.strip()[:100]}')
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
continue
|
|
||||||
|
|
||||||
match = pattern.search(line)
|
|
||||||
error_found = False
|
|
||||||
|
|
||||||
if not match and line.endswith((',\n', '[\n')):
|
|
||||||
# concat remaining text to validate multiline pattern
|
|
||||||
line = "".join(file_lines[line_number - 1:])
|
|
||||||
line = line[start_matches.start() + 1:]
|
|
||||||
match = pattern.match(line)
|
|
||||||
|
|
||||||
if not match:
|
|
||||||
error_found = True
|
|
||||||
print(f'\nTranslation syntax error at line number {line_number}\n{line.strip()[:100]}')
|
|
||||||
|
|
||||||
if not error_found and not words_pattern.search(line):
|
|
||||||
error_found = True
|
|
||||||
print(f'\nTranslation is useless because it has no words at line number {line_number}\n{line.strip()[:100]}')
|
|
||||||
|
|
||||||
if error_found:
|
|
||||||
errors_encounter += 1
|
|
||||||
|
|
||||||
if errors_encounter > 0:
|
|
||||||
print('\nVisit "https://frappeframework.com/docs/user/en/translations" to learn about valid translation strings.')
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
print('\nGood To Go!')
|
|
26
.github/workflows/backport.yml
vendored
26
.github/workflows/backport.yml
vendored
@ -1,26 +0,0 @@
|
|||||||
name: Backport
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types:
|
|
||||||
- closed
|
|
||||||
- labeled
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
main:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 60
|
|
||||||
steps:
|
|
||||||
- name: Checkout Actions
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: "frappe/backport"
|
|
||||||
path: ./actions
|
|
||||||
ref: develop
|
|
||||||
- name: Install Actions
|
|
||||||
run: npm install --production --prefix ./actions
|
|
||||||
- name: Run backport
|
|
||||||
uses: ./actions/backport
|
|
||||||
with:
|
|
||||||
token: ${{secrets.BACKPORT_BOT_TOKEN}}
|
|
||||||
labelsToAdd: "backport"
|
|
||||||
title: "{{originalTitle}}"
|
|
32
.github/workflows/initiate_release.yml
vendored
32
.github/workflows/initiate_release.yml
vendored
@ -1,32 +0,0 @@
|
|||||||
# This workflow is agnostic to branches. Only maintain on develop branch.
|
|
||||||
# To add/remove versions just modify the matrix.
|
|
||||||
|
|
||||||
name: Create weekly release pull requests
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
# 9:30 UTC => 3 PM IST Tuesday
|
|
||||||
- cron: "30 9 * * 2"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stable-release:
|
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
version: ["13", "14"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: octokit/request-action@v2.x
|
|
||||||
with:
|
|
||||||
route: POST /repos/{owner}/{repo}/pulls
|
|
||||||
owner: frappe
|
|
||||||
repo: erpnext
|
|
||||||
title: |-
|
|
||||||
"chore: release v${{ matrix.version }}"
|
|
||||||
body: "Automated weekly release."
|
|
||||||
base: version-${{ matrix.version }}
|
|
||||||
head: version-${{ matrix.version }}-hotfix
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -2,7 +2,7 @@ name: Generate Semantic Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- version-13
|
- version-14
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
@ -13,10 +13,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|
||||||
- name: Setup dependencies
|
- name: Setup dependencies
|
||||||
run: |
|
run: |
|
||||||
npm install @semantic-release/git @semantic-release/exec --no-save
|
npm install @semantic-release/git @semantic-release/exec --no-save
|
||||||
|
28
.github/workflows/server-tests-mariadb.yml
vendored
28
.github/workflows/server-tests-mariadb.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
container: [1, 2, 3, 4]
|
container: [1, 2]
|
||||||
|
|
||||||
name: Python Unit Tests
|
name: Python Unit Tests
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ jobs:
|
|||||||
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
|
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --with-coverage --total-builds 4 --build-number ${{ matrix.container }}'
|
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 2 --build-number ${{ matrix.container }}'
|
||||||
env:
|
env:
|
||||||
TYPE: server
|
TYPE: server
|
||||||
CI_BUILD_ID: ${{ github.run_id }}
|
CI_BUILD_ID: ${{ github.run_id }}
|
||||||
@ -126,27 +126,3 @@ jobs:
|
|||||||
- name: Show bench output
|
- name: Show bench output
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: cat ~/frappe-bench/bench_start.log || true
|
run: cat ~/frappe-bench/bench_start.log || true
|
||||||
|
|
||||||
- name: Upload coverage data
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: coverage-${{ matrix.container }}
|
|
||||||
path: /home/runner/frappe-bench/sites/coverage.xml
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
name: Coverage Wrap Up
|
|
||||||
needs: test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Clone
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
|
|
||||||
- name: Upload coverage data
|
|
||||||
uses: codecov/codecov-action@v2
|
|
||||||
with:
|
|
||||||
name: MariaDB
|
|
||||||
fail_ci_if_error: true
|
|
||||||
verbose: true
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"branches": ["version-13"],
|
"branches": ["version-14"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@semantic-release/commit-analyzer", {
|
"@semantic-release/commit-analyzer", {
|
||||||
"preset": "angular",
|
"preset": "angular",
|
||||||
@ -21,4 +21,4 @@
|
|||||||
],
|
],
|
||||||
"@semantic-release/github"
|
"@semantic-release/github"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import inspect
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = "15.0.0-dev"
|
__version__ = "15.0.0"
|
||||||
|
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user