Skip to content

Commit fcfc276

Browse files
committed
Prepare the 4.0.0 docs
- Update the GHA dist and doc to current v4. - Update the Travis dist and doc to current v4. - Other small changes to better show v4 links and info. - Upgrading guide v4 added. - Complete the changelog for release 4.0.0
1 parent 63a791f commit fcfc276

File tree

12 files changed

+155
-46
lines changed

12 files changed

+155
-46
lines changed

.travis.dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ php:
2626
env:
2727
global:
2828
- PGVER=13
29-
- MOODLE_BRANCH=MOODLE_311_STABLE
29+
- MOODLE_BRANCH=MOODLE_402_STABLE
3030
matrix:
3131
- DB=pgsql
3232
- DB=mysqli
@@ -40,7 +40,7 @@ before_install:
4040
# To use pcov for code coverage on Moodle 3.10 and up, install it using:
4141
# - pecl install pcov
4242
- cd ../..
43-
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
43+
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
4444
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
4545

4646
install:

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
[![License](https://poser.pugx.org/moodlehq/moodle-plugin-ci/license)](//packagist.org/packages/moodlehq/moodle-plugin-ci)
77

88
The goal of this project is to facilitate the running of tests and code
9-
analysis against a Moodle plugin using CI environments, such as [Travis
10-
CI](https://travis-ci.com) or [GitHub
11-
Actions](https://docs.github.com/en/actions). All of these tests and tools
9+
analysis against a Moodle plugin using CI environments, such as [GitHub
10+
Actions](https://docs.github.com/en/actions) or [Travis
11+
CI](https://travis-ci.com). All of these tests and tools
1212
are run everytime a change is pushed to a GitHub branch or pull request.
1313

1414
* [Getting started](https://moodlehq.github.io/moodle-plugin-ci/)
1515
* [Help topics](https://moodlehq.github.io/moodle-plugin-ci/Help.html)
1616
* [Changelog](https://moodlehq.github.io/moodle-plugin-ci/CHANGELOG.html)
17-
* [Upgrade 3.0](https://moodlehq.github.io/moodle-plugin-ci/UPGRADE-3.0.html)
17+
* [Upgrade 4.0](https://moodlehq.github.io/moodle-plugin-ci/UPGRADE-4.0.html)
1818

1919
History, acknowledgement and appreciation
2020
=========================================
21-
This repository is a fork of the original [moodle-plugin-ci](https://github.com/blackboard-open-source/moodle-plugin-ci), created
22-
and maintained by **MoodleRooms** / **Blackboard** over the last years. All the licenses, copyrights and authorship of
21+
This repository is a fork of [moodle-plugin-ci](https://github.com/blackboard-open-source/moodle-plugin-ci), originally created
22+
and maintained by **MoodleRooms** / **Blackboard**. All the licenses, copyrights and authorship of
2323
the original code and commits have been kept unmodified, how not!
2424

25-
After some unsuccessful attempts over the last months to keep the product alive and maintained,
25+
After some unsuccessful attempts along 2019-2020 to keep the product alive and maintained,
2626
proposing updates and fixes via standard pull requests, asking for some alternative collaboration schemas,
2727
and specially with the urgency of some changes to be implemented in order to keep the tool working
2828
with modern **Moodle** versions, it was decided, by **Moodle HQ**, to create this fork and take on its maintenance officially.

docs/CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).
1010

1111
## [Unreleased]
12+
### Added
13+
- Upgrade guide: [Upgrading from 3.x to 4.0](UPGRADE-4.0.md)
14+
- Support for PHP 8.1 and up.
15+
16+
### Changed
17+
- Lots of internals upgraded:
18+
- [Symfony 5.4](https://symfony.com/releases/5.4).
19+
- [PHPUnit 9.x](https://phpunit.de/announcements/phpunit-9.html).
20+
- [Code coverage](https://app.codecov.io/gh/moodlehq/moodle-plugin-ci) reporting.
21+
- [Psalm level 2](https://psalm.dev/docs/running_psalm/error_levels/) compliance.
22+
- [PSR-12](https://www.php-fig.org/psr/psr-12/) compliance.
23+
- Small changes to documentation towards prioritise GitHub Actions over Travis CI.
24+
- In addition to the internal and doc changes above, this initial 4.x release has 100% feature-parity with current 3.x series, setting the base for further improvements and new features. No changes are expected in general, other than in order to meet the new requirements.
25+
26+
### Removed
27+
- Support for PHP < 7.4 (the new minimum version).
28+
- Support for Moodle < 3.8.3, that was the [first release officially supporting PHP 7.4](https://moodledev.io/general/development/policies/php#php-74)).
1229

1330
## [3.4.12] - 2023-05-03
1431
### Changed
@@ -267,7 +284,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
267284

268285
### Added
269286
- New help document: [CLI commands and options](CLI.md)
270-
- Upgrade guide: [Upgrading from 2.X to 3.0](UPGRADE-3.0.md)
287+
- Upgrade guide: [Upgrading from 2.x to 3.0](UPGRADE-3.0.md)
271288

272289
### Removed
273290
- Support for PHP 5.x (7.0.0 is now required).

docs/GHAFileExplained.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,28 @@ jobs:
3838
ports:
3939
- 5432:5432
4040
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
41+
4142
mariadb:
4243
image: mariadb:10
4344
env:
4445
MYSQL_USER: 'root'
4546
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
47+
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
48+
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
4649
ports:
4750
- 3306:3306
4851
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
4952

5053
# Determines build matrix. This is a list of PHP versions, databases and
5154
# branches to test our project against. For each combination a separate
5255
# build will be created. For example below 6 builds will be created in
53-
# total (7.3-pgsql, 7.3-mariadb, 7.4-pgsql, 7.4-mariadb, etc.). If we add
56+
# total (7.4-pgsql, 7.4-mariadb, 8.0-pgsql, 8.0-mariadb, etc.). If we add
5457
# another branch, total number of builds will become 12.
55-
# If you need to use PHP 7.0 and run phpunit coverage test, make sure you are
56-
# using ubuntu-16.04 virtual environment in this case to have phpdbg or
57-
# this version in the system. See the "Setup PHP" step below for more details
58-
# about PHPUnit code coverage.
5958
strategy:
6059
fail-fast: false
6160
matrix:
62-
php: ['7.3', '7.4', '8.0']
63-
moodle-branch: ['MOODLE_311_STABLE']
61+
php: ['7.4', '8.0', '8.1']
62+
moodle-branch: ['MOODLE_401_STABLE']
6463
database: [pgsql, mariadb]
6564

6665
# There is an alternative way allowing to define explicitly define which php, moodle-branch
@@ -69,16 +68,13 @@ jobs:
6968
# matrix:
7069
# include:
7170
# - php: '8.0'
72-
# moodle-branch: 'MOODLE_311_STABLE'
71+
# moodle-branch: 'MOODLE_401_STABLE'
7372
# database: pgsql
74-
# Optional line: Only needed if going to run php8 jobs and the plugin
75-
# needs xmlrpc services or other special extensions.
76-
# extensions: xmlrpc-beta
77-
# - php: '7.4'
78-
# moodle-branch: 'MOODLE_310_STABLE'
73+
# - php: '8.0'
74+
# moodle-branch: 'MOODLE_400_STABLE'
7975
# database: mariadb
80-
# - php: '7.3'
81-
# moodle-branch: 'MOODLE_39_STABLE'
76+
# - php: '7.4'
77+
# moodle-branch: 'MOODLE_311_STABLE'
8278
# database: pgsql
8379

8480
steps:
@@ -103,7 +99,7 @@ jobs:
10399
# locale, define nvm location.
104100
- name: Initialise moodle-plugin-ci
105101
run: |
106-
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
102+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
107103
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
108104
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
109105
sudo locale-gen en_AU.UTF-8

docs/Help.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ There are few important options that you may want to use:
8888

8989
## Upgrade guides
9090

91+
* [Upgrading to Version 4](UPGRADE-4.0.md)
9192
* [Upgrading to Version 3](UPGRADE-3.0.md)
9293
* [Upgrading to Version 2](UPGRADE-2.0.md)
9394

docs/ReleaseNewVersion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Once all code and commits are in place and verified, you need to tag a
2828
release. Tag `master` branch `HEAD` and push using commands:
2929

3030
```bash
31-
$ git tag -a 3.1.0 -m "Release version 3.1.0"
32-
$ git push origin 3.1.0
31+
$ git tag -a 4.0.8 -m "Release version 4.0.8"
32+
$ git push origin 4.0.8
3333
```
3434

3535
(while it's also possible to use GitHub interface, we have decided not to do
@@ -53,6 +53,6 @@ to be created manually. First build PHAR file manually:
5353
$ make build
5454
```
5555

56-
Once the above command suceeded, navigate to latest release in [GitHub
56+
Once the above command succeeds, navigate to latest release in [GitHub
5757
interface](https://github.com/moodlehq/moodle-plugin-ci/releases), click
5858
"Edit" and attach generated PHAR file to release (you will find it at `./build` subdir).

docs/TravisFileExplained.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ env:
5050
# socketed connections instead of localhost ones.
5151
- PGVER=13
5252
# This line determines which version branch of Moodle to test against.
53-
- MOODLE_BRANCH=MOODLE_311_STABLE
53+
- MOODLE_BRANCH=MOODLE_402_STABLE
5454
# This matrix is used for testing against multiple databases. So for
5555
# each version of PHP being tested, one build will be created for each
56-
# database listed here. EG: for PHP 7.3, one build will be created
57-
# using PHP 7.3 and pgsql. In addition, another build will be created
58-
# using PHP 7.3 and mysqli.
56+
# database listed here. EG: for PHP 7.4, one build will be created
57+
# using PHP 7.4 and pgsql. In addition, another build will be created
58+
# using PHP 7.4 and mysqli.
5959
matrix:
6060
- DB=pgsql
6161
- DB=mysqli
@@ -73,10 +73,10 @@ env:
7373
# jobs:
7474
# include:
7575
# - php: 8.0
76-
# env: MOODLE_BRANCH=MOODLE_311_STABLE DB=pgsql
76+
# env: MOODLE_BRANCH=MOODLE_401_STABLE DB=pgsql
77+
# - php: 8.0
78+
# env: MOODLE_BRANCH=MOODLE_400_STABLE DB=pgsql
7779
# - php: 7.4
78-
# env: MOODLE_BRANCH=MOODLE_311_STABLE DB=pgsql
79-
# - php: 7.3
8080
# env: MOODLE_BRANCH=MOODLE_311_STABLE DB=mysqli
8181
# ....
8282
# Note: this also enables to add specific env variables (NODE_VERSION,
@@ -98,7 +98,7 @@ before_install:
9898
# directories to build the project.
9999
- cd ../..
100100
# Install this project into a directory called "ci".
101-
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
101+
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
102102
# Update the $PATH so scripts from this project can be called easily.
103103
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
104104

docs/UPGRADE-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: page
3-
title: Upgrading from 1.X to 2.0
3+
title: Upgrading from 1.x to 2.0
44
---
55

66
This document outlines the steps one should take when upgrading to the new major version.

docs/UPGRADE-3.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: page
3-
title: Upgrading from 2.X to 3.0
3+
title: Upgrading from 2.x to 3.0
44
---
55

66
This document outlines the steps one should take when upgrading to the new major version.

docs/UPGRADE-4.0.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
layout: page
3+
title: Upgrading from 3.x to 4.0
4+
---
5+
6+
This document outlines the steps one should take when upgrading to the new major version.
7+
8+
## Step 1: Review the new requirements
9+
10+
Requirements have changed, this project now requires **PHP 7.4 or later** and **Moodle 3.8.3** or later.
11+
12+
## Step 2: Review the change log
13+
14+
Detailed information about what changed in Version 4 can be found in the [change log](CHANGELOG.md).
15+
16+
## Step 3: Review the CIs configuration files
17+
18+
### GitHub Actions
19+
20+
Review the updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml)
21+
and update the GitHub Action workflow file in your plugin (for example, `.github/workflows/ci.yml`). For detailed information about the contents of that `ci.yml` file, please see our [sample GitHub Action workflow explanation](GHAFileExplained.md).
22+
23+
A summary of the actions required for version 4 is:
24+
25+
1. Change the `composer create-project` line and bump from version 3 (`^3`) to version 4 (`^4`).
26+
2. Test it and, hopefully, party!
27+
28+
### Travis CI
29+
30+
Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml)
31+
and update your `.travis.yml` file in your plugin. For detailed information about the contents of `.travis.dist.yml`
32+
file, please see our [sample Travis workflow file explanation](TravisFileExplained.md).
33+
34+
1. Change the `composer create-project` line and bump from version 3 (`^3`) to version 4 (`^4`).
35+
2. Test it and, hopefully, party!
36+
37+
## FAQ
38+
39+
### What is happening to Version 3?
40+
41+
Version 3 still exists within its own [3.x](https://github.com/moodlehq/moodle-plugin-ci/tree/3.x) branch. You can continue using it, but it is no longer getting new features and may not receive additional updates. In addition, it may start breaking in Moodle 4.3 or later, because of 8.2 incompatibilities.
42+
43+
### Why Version 4?
44+
45+
Mainly to be able to modernise all the internal components of the application which had remained largely unmodified since version 2. This will make it much easier to plan for the future and to leave behind very old versions of PHP (< 7.4) and Moodle (< 3.8.3), which have not been supported for a long time.
46+
47+
### Can I run Version 3 and 4?
48+
49+
If your plugin uses a single Git branch, but still works on Moodle versions older than 3.8.3, then you might want to try using both versions in a single GiHub Action or Travis file.
50+
51+
First of all, this is not recommended due to its complexity. The preferred method is to use separate branches so your CI files are only using one version or another.
52+
53+
Despite our recommendations, if you still want to run both versions in the same CI process, you can set environment variables to specify which version to use for every job.
54+
55+
For example, for GitHub Actions, it can be setup as follows:
56+
57+
```yaml
58+
# WARNING - this is only a partial example,
59+
# several steps were excluded to keep it simple!
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
include:
64+
- php: 8.2
65+
moodle-branch: master
66+
database: pgsql
67+
plugin-ci: ^4 # Decide the version to use per matrix element.
68+
...
69+
...
70+
- php: 7.3
71+
moodle-branch: MOODLE_37_STABLE
72+
database: mariadb
73+
plugin-ci: ^3 # Decide the version to use per matrix element.
74+
75+
...
76+
...
77+
steps:
78+
- name: Check out repository code
79+
uses: actions/checkout@v3
80+
with:
81+
path: plugin
82+
...
83+
...
84+
- name: Initialise moodle-plugin-ci
85+
run: |
86+
// Apply here for the configured plugin-ci version.
87+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ${{ matrix.plugin-ci }}
88+
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
89+
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
90+
...
91+
...
92+
```
93+
94+
The same can be also implemented for Travis CI jobs, adding the `plugin-ci` version as one more element in the jobs matrix `env` element.

0 commit comments

Comments
 (0)