Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
marc1706 committed Nov 24, 2024
2 parents e792cc1 + efa52d3 commit 5cd4ff6
Show file tree
Hide file tree
Showing 307 changed files with 10,038 additions and 4,427 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Checklist:

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB3-12345
https://tracker.phpbb.com/browse/PHPBB-12345
70 changes: 70 additions & 0 deletions .github/workflows/check_merge_to_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Check merge to master

on:
pull_request_target:
types: [ opened, synchronize, reopened ]
branches:
- 3.3.x

jobs:
merge-check:
if: github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == '3.3.x'
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure full history is fetched

- name: Set up Git user
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Fetch all branches
run: git fetch origin

- name: Simulate merging PR into 3.3.x
id: simulate_merge
run: |
git checkout 3.3.x
git fetch origin pull/${{ github.event.pull_request.number }}/head
git merge --no-ff FETCH_HEAD || exit 1
- name: Attempt to merge updated 3.3.x into master
id: merge_master
run: |
git checkout master
if git merge --no-ff 3.3.x --no-commit; then
echo "mergeable=true" >> $GITHUB_OUTPUT
else
echo "mergeable=false" >> $GITHUB_OUTPUT
git merge --abort
fi
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: The attempt to merge branch `3.3.x` into `master` has completed

- name: Post comment on PR
if: always() # Ensure this step always runs, regardless of merge result
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
The attempt to merge branch `3.3.x` into `master` has completed after considering the changes in this PR.
- Merge result: ${{ steps.merge_master.outputs.mergeable == 'true' && 'Success ✅' || 'Conflict ❌' }}
${{ steps.merge_master.outputs.mergeable == 'true' && 'This PR is ready to be merged.' || 'A separate PR will be needed to merge `3.3.x` into `master`.' }}
- name: Mark job as succeeded
if: always()
run: echo "Merge check completed. Ignoring the result to avoid failed status."
60 changes: 60 additions & 0 deletions .github/workflows/merge_3.3.x_to_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Merge 3.3.x into master

on:
push:
branches:
- 3.3.x

jobs:
merge-branch:
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.MERGE_MASTER_APP_ID }}
private-key: ${{ secrets.MERGE_MASTER_SECRET }}

- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for proper merging
ref: 3.3.x # Checkout the 3.3.x branch
token: ${{ steps.app-token.outputs.token }}

- name: Fetch the latest commit information
id: get-commit-info
run: |
# Get the latest commit SHA and its author details
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_AUTHOR_NAME=$(git log -1 --pretty=format:'%an' $COMMIT_SHA)
COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae' $COMMIT_SHA)
# Save them as output for later steps
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_ENV
echo "commit_author_name=$COMMIT_AUTHOR_NAME" >> $GITHUB_ENV
echo "commit_author_email=$COMMIT_AUTHOR_EMAIL" >> $GITHUB_ENV
- name: Set up Git with the pull request author's info
run: |
git config --global user.name "${{ env.commit_author_name }}"
git config --global user.email "${{ env.commit_author_email }}"
- name: Fetch all branches
run: git fetch --all

- name: Merge 3.3.x into master
run: |
git checkout master
if git merge --no-ff 3.3.x; then
echo "merge_failed=false" >> $GITHUB_ENV
else
echo "merge_failed=true" >> $GITHUB_ENV
fi
- name: Push changes to master if merge was successful
if: env.merge_failed == 'false'
run: git push origin master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 12 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ jobs:
db: "mysql:5.7"
- php: '8.3'
db: "mariadb:10.2"
- php: '8.4'
db: "mysql:8.0"
- php: '8.4'
db: "mariadb:10.3"

name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}

Expand Down Expand Up @@ -272,6 +276,8 @@ jobs:
db: "postgres:9.5"
- php: '8.3'
db: "postgres:9.5"
- php: '8.4'
db: "postgres:9.5"

name: PHP ${{ matrix.php }} - ${{ matrix.db }}

Expand Down Expand Up @@ -364,7 +370,7 @@ jobs:
# Other database types, namely sqlite3 and mssql
other-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
include:
Expand All @@ -374,17 +380,17 @@ jobs:
db: "mcr.microsoft.com/mssql/server:2017-latest"
db_alias: 'MSSQL 2017'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2019-latest"
db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04"
db_alias: 'MSSQL 2019'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2022-latest"
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
db_alias: 'MSSQL 2022'

name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}

services:
mssql:
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }}
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }}
env:
SA_PASSWORD: "Pssw0rd_12"
ACCEPT_EULA: "y"
Expand Down Expand Up @@ -416,7 +422,7 @@ jobs:
env:
MATRIX_DB: ${{ matrix.db }}
run: |
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-latest' ]
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ]
then
db='mssql'
else
Expand Down Expand Up @@ -480,7 +486,7 @@ jobs:
strategy:
matrix:
type: ['unit', 'functional']
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']
db: ['postgres']

name: Windows - ${{ matrix.type }} - PHP ${{ matrix.php }} - ${{ matrix.db }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

# Excludes test / dev files
/phpunit.xml
/.phpunit.result.cache
/phpBB/composer.phar
/tests/phpbb_unit_tests.sqlite*
/tests/test_config*.php
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ We have unit and functional tests in order to prevent regressions. You can view

Branch | Description | GitHub Actions |
------- | ----------- | -------------- |
**master** | Latest development version | ![Tests](https://github.com/phpbb/phpbb/workflows/Tests/badge.svg?branch=master) |
**3.3.x** | Development of version 3.3.x | ![Tests](https://github.com/phpbb/phpbb/workflows/Tests/badge.svg?branch=3.3.x) |
**master** | Latest development version | ![Tests](https://github.com/phpbb/phpbb/actions/workflows/tests.yml/badge.svg?branch=master) |
**3.3.x** | Development of version 3.3.x | ![Tests](https://github.com/phpbb/phpbb/actions/workflows/tests.yml/badge.svg?branch=3.3.x) |

## 📜 License

Expand Down
5 changes: 3 additions & 2 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
<property name="newversion" value="4.0.0-a1-dev" />
<property name="prevversion" value="3.3.12" />
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.3.10, 3.3.11" />
<property name="prevversion" value="3.3.14" />
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.3.10, 3.3.11, 3.3.12, 3.3.13" />
<!-- no configuration should be needed beyond this point -->

<property name="oldversions" value="${olderversions}, ${prevversion}" />
Expand Down Expand Up @@ -181,6 +181,7 @@

<!-- create an empty config.php file (not for diffs) -->
<touch file="build/new_version/phpBB3/config.php" />
<copy file="build/new_version/phpBB3/vendor-ext/.htaccess" tofile="build/new_version/phpBB3/vendor/.htaccess" />

</target>

Expand Down
Binary file modified composer.phar
Binary file not shown.
4 changes: 2 additions & 2 deletions git-tools/hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ do
"footer")
err=$ERR_FOOTER;
# Each ticket is on its own line
echo "$line" | grep -Eq "^PHPBB3-[0-9]+$";
echo "$line" | grep -Eq "^PHPBB3?-[0-9]+$";
;;
"eof")
err=$ERR_EOF;
Expand Down Expand Up @@ -356,7 +356,7 @@ echo "$expecting" | grep -q "eof" || (
# Check the branch ticket is mentioned, doesn't make sense otherwise
if [ $ticket -gt 0 ]
then
echo "$tickets" | grep -Eq "\bPHPBB3-$ticket\b" || (
echo "$tickets" | grep -Eq "\bPHPBB3?-$ticket\b" || (
complain "Ticket ID [$ticket] of branch missing from list of tickets:" >&2;
complain "$tickets" | sed 's/ /\n/g;s/^/* /g' >&2;
quit $ERR_FOOTER;
Expand Down
2 changes: 1 addition & 1 deletion git-tools/hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ then
# Branch is prefixed with 'ticket/', append ticket ID to message
if [ "$branch" != "${branch##ticket/}" ];
then
tail="$(printf '\n\nPHPBB3-%s' "$ticket_id")";
tail="$(printf '\n\nPHPBB-%s' "$ticket_id")";
fi
fi

Expand Down
Loading

0 comments on commit 5cd4ff6

Please sign in to comment.