From 29777c22fce254d787806aadee303b787a81f428 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 16 Apr 2026 16:42:05 -0700 Subject: [PATCH 1/2] Update tests --- tests/functional/viewonline_test.php | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/tests/functional/viewonline_test.php b/tests/functional/viewonline_test.php index c4e6cf1..95375a5 100644 --- a/tests/functional/viewonline_test.php +++ b/tests/functional/viewonline_test.php @@ -16,31 +16,24 @@ class viewonline_test extends ideas_functional_base { /** - * Visit Ideas as user "admin" + * Test viewonline page for admin */ - public function test_viewonline_visit_ideas() + public function test_viewonline_check_viewonline() { + // Visit Ideas as user "admin" $this->login(); $crawler = self::request('GET', "app.php/ideas?sid=$this->sid"); $this->assertContainsLang('IDEAS_TITLE', $crawler->filter('h2')->text()); - } - /** - * Test viewonline page for admin - * - * We use a second function here, so we get a new session and can log in - * without having to log out "admin" first. - * - * @depends test_viewonline_visit_ideas - */ - public function test_viewonline_check_viewonline() - { - // Create user1 and send them to the Viewonline - $this->create_user('user1'); - $this->login('user1'); + // Create a second user and check who is online from a separate session. + self::$client->restart(); + $this->create_user('ideas-viewonline-user1'); + $this->login('ideas-viewonline-user1'); + // PHP goes faster than DBMS, make sure session data got written to the database. + sleep(1); $crawler = self::request('GET', "viewonline.php?sid=$this->sid"); - // Is admin still viewing Ideas page + // Is admin still viewing Ideas page? self::assertStringContainsString('admin', $crawler->filter('#page-body table.table1')->text()); $session_entries = $crawler->filter('#page-body table.table1 tr')->count(); From 9fde561c48bdf21a9151e49b13c47870559c6fad Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 16 Apr 2026 16:42:20 -0700 Subject: [PATCH 2/2] Add auto merge workflow --- .github/workflows/merge-master-to-develop.yml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/merge-master-to-develop.yml diff --git a/.github/workflows/merge-master-to-develop.yml b/.github/workflows/merge-master-to-develop.yml new file mode 100644 index 0000000..4e02edc --- /dev/null +++ b/.github/workflows/merge-master-to-develop.yml @@ -0,0 +1,63 @@ +name: Sync develop branch + +on: + push: + branches: + # Keep this in sync with SYNC_SOURCE_BRANCH below. + # GitHub Actions does not allow env values in trigger branch filters. + - master + +env: + SYNC_SOURCE_BRANCH: master + SYNC_TARGET_BRANCH: dev/4.0 + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + sync-dev-branch: + name: Merge master into dev/4.0 branch + # Keep this named after the GitHub repository. + # GitHub Actions does not allow workflow env values in jobs..if. + if: github.repository == 'phpbb/ideas' && github.event.repository.fork == false + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Configure Git author + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Merge source branch into target branch when clean + run: | + if ! git ls-remote --exit-code --heads origin "${SYNC_TARGET_BRANCH}" > /dev/null 2>&1; then + echo "origin/${SYNC_TARGET_BRANCH} does not exist; skipping." + exit 0 + fi + + git fetch --no-tags --prune origin "${SYNC_TARGET_BRANCH}" + git checkout -B "${SYNC_TARGET_BRANCH}" "origin/${SYNC_TARGET_BRANCH}" + + if git merge --no-edit "$GITHUB_SHA"; then + if [ "$(git rev-list --count "origin/${SYNC_TARGET_BRANCH}..HEAD")" -eq 0 ]; then + echo "${SYNC_TARGET_BRANCH} is already up to date." + exit 0 + fi + + git push origin "HEAD:${SYNC_TARGET_BRANCH}" + else + echo "${SYNC_SOURCE_BRANCH} could not be merged cleanly into ${SYNC_TARGET_BRANCH}; skipping." + if git rev-parse -q --verify MERGE_HEAD > /dev/null; then + git merge --abort + fi + exit 1 + fi