Skip to content

Commit

Permalink
Merge branch 'develop' into related_v18_Updating_Invoice_Notes_32134
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Jan 13, 2025
2 parents 1cf1629 + 0097d75 commit e3c5830
Show file tree
Hide file tree
Showing 1,284 changed files with 92,341 additions and 30,240 deletions.
1 change: 0 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ languages:
engines:
phpcodesniffer: true
exclude_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Definition:

As the Developer:

1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/DCO)
1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/blob/develop/DCO)
2. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
3. Clone your fork.
4. Choose a branch(See the [Branches](#branches) section below).
Expand Down
3 changes: 3 additions & 0 deletions .github/changed-lines-count-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add this tag for any changes for more than 1 line
"Pending analysis of PR (maintenance team)":
min: 1
10 changes: 5 additions & 5 deletions .github/workflows/doxygen-gh-pages.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- develop
permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -18,16 +18,16 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/html
config_file: build/doxygen/dolibarr-doxygen.doxyfile
folder: dev/build/html
config_file: dev/build/doxygen/dolibarr-doxygen.doxyfile

# - name: Deploy
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# branch: gh-pages
# folder: build/html # The folder the action should deploy.
# folder: dev/build/html # The folder the action should deploy.
# target-folder: docs/html2

#jobs:
# doxygen:
# runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/exakat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
uses: docker://exakat/exakat-ga
with:
ignore_rules: 'Classes/UseInstanceof,Constants/ConstantStrangeNames,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
ignore_dirs: '/htdocs/includes/,/htdocs/install/doctemplates/,/build/,/dev/,/doc/,/scripts/,/test/'
ignore_dirs: '/htdocs/includes/,/htdocs/install/doctemplates/,/dev/,/doc/,/scripts/,/test/'
file_extensions: php
project_reports: Perfile
49 changes: 24 additions & 25 deletions .github/workflows/github_ci_php71_pgsql.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
- 5432:5432

steps:
# git clone dolibarr into GITHUB_WORKSPACE = /home/runner/work/dolibarr/dolibarr
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Version PHP
run: |
php -i | head -
Expand All @@ -59,7 +59,7 @@ jobs:
sudo apt install apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1
sudo update-alternatives --set php /usr/bin/php7.1
php -i | head -

cd $GITHUB_WORKSPACE
ls $GITHUB_WORKSPACE
composer -n require --ignore-platform-reqs phpunit/phpunit ^7.5 \
Expand All @@ -76,7 +76,7 @@ jobs:
sudo rm -fr htdocs/includes/phpunit/php-code-coverage/src/Report/Html

- name: Adding path of binaries tools installed by composer to the PATH
run: |
run: |
export PATH="$GITHUB_WORKSPACE/htdocs/includes/bin:$PATH"
echo $PATH
# We must have a directory bin created by the previous composer call
Expand Down Expand Up @@ -107,32 +107,32 @@ jobs:
psql --version
echo "Check pgloader version"
pgloader --version

- name: Create database
run: |
pwd
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
sudo apt-get install -y mysql-client
mysql --version | head -
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SELECT VERSION();" | head -
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SHOW DATABASES"

echo "Drop and create database"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'DROP DATABASE IF EXISTS travis;'
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO [email protected];'
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'FLUSH PRIVILEGES;'

mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql

mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"

echo "Init postgresql database"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql

mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"

echo "Init postgresql database"
ps fauxww | grep postgres
ls /etc/postgresql/14/main/
sudo chmod -R a+rwx /etc/postgresql/14/main/pg_hba.conf

sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/14/main/pg_hba.conf
sudo cat /etc/postgresql/14/main/pg_hba.conf

Expand All @@ -144,7 +144,7 @@ jobs:

sudo mkdir -p /tmp/pgloader
sudo chmod -R a+rwx /tmp/pgloader/

echo sudo pgloader mysql://root:[email protected]:32574/travis postgresql://postgres:[email protected]:5432/travis
sudo pgloader mysql://root:[email protected]:32574/travis postgresql://postgres:[email protected]:5432/travis
echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql postgresql://postgres:[email protected]:5432/travis
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
echo '$'force_install_main_data_root=\'/var/www/html\'';' >> $INSTALL_FORCED_FILE
cat $INSTALL_FORCED_FILE

- name: Create document directory
run: |
echo "Create documents directory and set permissions"
Expand All @@ -199,9 +199,9 @@ jobs:
sudo chmod -R a+rwx /var/www/html/documents
sudo echo "***** First line of dolibarr.log" > /var/www/html/documents/dolibarr.log
sudo chmod a+rwx /var/www/html/documents/dolibarr.log

- name: Copy app into /var/www
run: |
run: |
sudo cp -r $GITHUB_WORKSPACE/htdocs/. /var/www/html
sudo mv /var/www/html/index.html /var/www/html/index.disabled.html
sudo ln -fs /var/www/html /var/www/htdocs
Expand All @@ -217,7 +217,7 @@ jobs:
a2query -s
a2query -m
ls /etc/apache2/sites-available
#sudo cp -f $GITHUB_WORKSPACE/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
#sudo cp -f $GITHUB_WORKSPACE/dev/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
#sudo sed -e "s?%GITHUB_WORKSPACE%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
a2ensite 000-default
a2enmod php7.1
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
wget -O - --debug http://127.0.0.1 > $GITHUB_WORKSPACE/test.html 2>&1
head -n 200 $GITHUB_WORKSPACE/test.html

echo Logs are...
#sudo cat /tmp/install.log
sudo cat /var/log/apache2/access.log
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade600700.log
php upgrade2.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-2.log
php step5.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-3.log

echo "\dt llx_c_paiement" | psql 'postgresql://postgres:[email protected]:5432/travis'
echo "\dt llx_c_payment_term" | psql 'postgresql://postgres:[email protected]:5432/travis'

Expand Down Expand Up @@ -324,17 +324,17 @@ jobs:
php upgrade.php 17.0.0 18.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade17001800.log
php upgrade2.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-2.log
php step5.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-3.log

- name: Result of migration scripts
if: always()
run: |
ls -alrt $GITHUB_WORKSPACE/

echo Show content of last file
cat "$(ls -rt $GITHUB_WORKSPACE/ | tail -n1)"

- name: Enabling new modules
run: |
run: |
# Enable modules not enabled into original dump
set -e
cd /var/www/html/install
Expand All @@ -361,5 +361,4 @@ jobs:
includes/bin/phpunit -d memory_limit=-1 -c /var/www/test/phpunit/phpunittest.xml /var/www/test/phpunit/AllTests.php
phpunitresult=$?
echo "Phpunit return code = $phpunitresult"
set +e

set +e
41 changes: 20 additions & 21 deletions .github/workflows/github_ci_php81_mysql.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Version PHP
run: |
php -i | head -
Expand All @@ -38,14 +38,14 @@ jobs:
sudo composer self-update 2.2.18
sudo chmod -R a+rwx /home/runner
composer -n config -g vendor-dir htdocs/includes

sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y pgloader memcached
sudo apt install apache2 php8.1 php8.1-cli php8.1-curl php8.1-mysql php8.1-pgsql php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-xml php8.1-mbstring php8.1-xml php8.1-zip libapache2-mod-php8.1
sudo update-alternatives --set php /usr/bin/php8.1
php -i | head -

cd $GITHUB_WORKSPACE
ls $GITHUB_WORKSPACE
composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \
Expand All @@ -56,7 +56,7 @@ jobs:
sudo rm -fr htdocs/includes/phpunit/php-code-coverage/src/Report/Html

- name: Adding path of binaries tools installed by composer to the PATH
run: |
run: |
export PATH="$GITHUB_WORKSPACE/htdocs/includes/bin:$PATH"
echo $PATH
# We must have a directory bin created by the previous composer call
Expand Down Expand Up @@ -87,26 +87,26 @@ jobs:
psql --version
echo "Check pgloader version"
pgloader --version

- name: Create database
run: |
pwd
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
sudo apt-get install -y mysql-client
mysql --version | head -
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SELECT VERSION();" | head -
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SHOW DATABASES"

echo "Drop and create database"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'DROP DATABASE IF EXISTS travis;'
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO [email protected];'
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'FLUSH PRIVILEGES;'

mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql

mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql

mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"

- name: Generate Dolibarr conf file
run: |
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
echo '$'force_install_main_data_root=\'/var/www/html\'';' >> $INSTALL_FORCED_FILE
cat $INSTALL_FORCED_FILE

- name: Create document directory
run: |
echo "Create documents directory and set permissions"
Expand All @@ -154,9 +154,9 @@ jobs:
sudo chmod -R a+rwx /var/www/html/documents
sudo echo "***** First line of dolibarr.log" > /var/www/html/documents/dolibarr.log
sudo chmod a+rwx /var/www/html/documents/dolibarr.log

- name: Copy app into /var/www
run: |
run: |
sudo cp -r $GITHUB_WORKSPACE/htdocs/. /var/www/html
sudo mv /var/www/html/index.html /var/www/html/index.disabled.html
sudo ln -fs /var/www/html /var/www/htdocs
Expand All @@ -172,7 +172,7 @@ jobs:
a2query -s
a2query -m
ls /etc/apache2/sites-available
#sudo cp -f $GITHUB_WORKSPACE/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
#sudo cp -f $GITHUB_WORKSPACE/dev/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
#sudo sed -e "s?%GITHUB_WORKSPACE%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
a2ensite 000-default
a2enmod php8.1
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
wget -O - --debug http://127.0.0.1 > $GITHUB_WORKSPACE/test.html 2>&1
head -n 200 $GITHUB_WORKSPACE/test.html

echo Logs are...
#sudo cat /tmp/install.log
sudo cat /var/log/apache2/access.log
Expand Down Expand Up @@ -274,17 +274,17 @@ jobs:
php upgrade.php 17.0.0 18.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade17001800.log
php upgrade2.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-2.log
php step5.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-3.log

- name: Result of migration scripts
if: always()
run: |
ls -alrt $GITHUB_WORKSPACE/

echo Show content of last file
cat "$(ls -rt $GITHUB_WORKSPACE/ | tail -n1)"

- name: Enabling new modules
run: |
run: |
# Enable modules not enabled into original dump
set -e
cd /var/www/html/install
Expand All @@ -311,7 +311,7 @@ jobs:
includes/bin/phpunit -d memory_limit=-1 -c /var/www/test/phpunit/phpunittest.xml /var/www/test/phpunit/AllTests.php
phpunitresult=$?
echo "Phpunit return code = $phpunitresult"
set +e
set +e

- name: Code quality check - Lint
if: github.event_name == 'push'
Expand All @@ -325,10 +325,9 @@ jobs:
- name: Code quality check - phpcs
if: github.event_name == 'push'
run: |
htdocs/includes/bin/phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
htdocs/includes/bin/phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;

- name: Code quality check - var-dump-check
if: github.event_name == 'push'
run: |
htdocs/includes/bin/var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php .

4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Run PHPStan
id: phpstan
run: |
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings
# continue-on-error: true

# Save cache
Expand All @@ -90,4 +90,4 @@ jobs:
# id: phpstan-baseline
# if: ${{ success() }}
# run: |
# phpstan -vv analyse --memory-limit 7G -a build/phpstan/bootstrap_action.php --generate-baseline build/phpstan/phpstan-baseline.neon
# phpstan -vv analyse --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php --generate-baseline dev/build/phpstan/phpstan-baseline.neon
4 changes: 2 additions & 2 deletions .github/workflows/phpstan_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
github_token: ${{ env.GH_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
baseline_path: build/phpstan/phpstan-baseline.neon
phpstan_additional_arguments: --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php
baseline_path: dev/build/phpstan/phpstan-baseline.neon
commit_name: Dolibot
commit_email: [email protected]
commit_message: PHPStan > Update baseline
Expand Down
Loading

0 comments on commit e3c5830

Please sign in to comment.