Skip to content

Commit 4be4446

Browse files
authored
Merge pull request #19 from stronk7/add_v2_to_v3_docs
Initial preparations for version 3.
2 parents 9766a90 + 7eae31b commit 4be4446

File tree

7 files changed

+127
-16
lines changed

7 files changed

+127
-16
lines changed

.travis.dist.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cache:
1616
php:
1717
- 7.2
1818
- 7.3
19+
- 7.4
1920

2021
env:
2122
global:
@@ -27,7 +28,7 @@ env:
2728
before_install:
2829
- phpenv config-rm xdebug.ini
2930
- cd ../..
30-
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^2
31+
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
3132
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
3233

3334
install:

composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"type": "project",
66
"license": "GPL-3.0-or-later",
77
"authors": [
8+
{
9+
"name": "Ruslan Kabalin",
10+
"email": "[email protected]",
11+
"homepage": "https://moodle.com",
12+
"role": "Maintainer"
13+
},
814
{
915
"name": "Mark Nielsen",
1016
"email": "[email protected]",
@@ -18,6 +24,11 @@
1824
"role": "Developer"
1925
}
2026
],
27+
"support": {
28+
"issues": "https://github.com/moodlehq/moodle-plugin-ci/issues",
29+
"source": "https://github.com/moodlehq/moodle-plugin-ci",
30+
"docs": "https://moodlehq.github.io/moodle-plugin-ci/"
31+
},
2132
"repositories": [
2233
{
2334
"type": "package",

docs/CHANGELOG.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1010

1111
## [Unreleased]
1212
### Changed
13-
- TODO: Document all the changes to jump to this new release from previous 2.5.0, similarly to the docs explaining 1.x => 2.x changes.
1413
- ACTION REQUIRED: project organization renamed to moodlehq. You must update your `.travis.yml` to use `moodlehq/moodle-plugin-ci`
15-
- Updated [.travis.dist.yml] with a new `services` section to ensure databases start.
16-
- Updated [.travis.dist.yml] to remove `openjdk-8-jre-headless` and updated `moodlehq/moodle-local_ci` to fix Mustache linting. See [moodle-local_ci/pull#198](https://github.com/moodlehq/moodle-local_ci/pull/198).
17-
- `moodle-plugin-ci behat` is using Selenium docker container for built-in Selenium server.
1814
- ACTION REQUIRED: If you initiated Selenium server in docker container as
1915
part of your test scenario (e.g. separate step in install stage similar to
2016
one outlined in workaround
2117
[blackboard-open-source/issue#110](https://github.com/blackboard-open-source/moodle-plugin-ci/issues/110)),
2218
this is no longer required, you can remove this step.
23-
- Updated version of `moodlehq/moodle-local_codechecker` to v2.9.6
19+
- ACTION REQUIRED: You may safely remove `nvm install <version>` and `nvm use
20+
<version>` from .travis.yml, this is now a part of installation routine.
21+
- Updated [.travis.dist.yml] with a new `services` section to ensure databases start.
22+
- Updated [.travis.dist.yml] to remove `openjdk-8-jre-headless` and updated `moodlehq/moodle-local_ci` to fix Mustache linting. See [moodle-local_ci/pull#198](https://github.com/moodlehq/moodle-local_ci/pull/198).
23+
- `moodle-plugin-ci behat` is using Selenium docker container for built-in Selenium server.
24+
- Updated version of `moodlehq/moodle-local_codechecker` to v2.9.7
2425
- Updated [.travis.dist.yml] to build Moodle 3.9
2526
- `moodle-plugin-ci install` installs Node.js (npm) using the version
2627
specified in .nvmrc file or `lts/carbon` if .nvmrc is missing (pre Moodle
@@ -29,8 +30,6 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
2930
this parameter should be compatible with `nvm install` command,
3031
e.g. `v8.9`, `8.9.0`, `lts/erbium`. See
3132
[#7](https://github.com/moodlehq/moodle-plugin-ci/issues/7)
32-
- ACTION REQUIRED: You may safely remove `nvm install <version>` and `nvm use
33-
<version>` from .travis.yml, this is now a part of installation routine.
3433

3534
### Added
3635
- New help document: [CLI commands and options](CLI.md)

docs/TravisFileExplained.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ language: php
1515
addons:
1616
postgresql: "9.5"
1717

18-
# Ensure DB services are running.
18+
# Ensure DB and docker services are running.
1919
services:
2020
- mysql
2121
- postgresql
22+
- docker
2223

23-
# Cache NPM's and Composer's caches to speed up build times.
24+
# Cache Composer's and NPM's caches to speed up build times.
2425
cache:
2526
directories:
2627
- $HOME/.composer/cache
@@ -32,6 +33,7 @@ cache:
3233
php:
3334
- 7.2
3435
- 7.3
36+
- 7.4
3537

3638
# This section sets up the environment variables for the build.
3739
env:
@@ -51,6 +53,22 @@ env:
5153
# (git://github.com/moodle/moodle.git is used by default):
5254
# - MOODLE_REPO=git://github.com/username/moodle.git
5355

56+
# Also, note that, for multi-branch scenarios, where the same plugin
57+
# codebase needs to be tested against multiple branches of Moodle,
58+
# it is possible to remove the `php`, `env/global`, and `matrix`
59+
# sections above and just create a `jobs` section explicitly defining
60+
# which `php`, `MOODLE_BRANCH` and `DB` to use, for example:
61+
#
62+
# jobs:
63+
# include:
64+
# - php: 7.3
65+
# env: MOODLE_BRANCH=MOODLE_39_STABLE DB=psql
66+
# - php: 7.3
67+
# env: MOODLE_BRANCH=MOODLE_39_STABLE DB=mysqli
68+
# ....
69+
# Note: this also enables to add specific env variables (NODE_VERSION,
70+
# EXTRA_PLUGINS...) per job, if you don't want to do it globally.
71+
5472
# This lists steps that are run before the installation step.
5573
before_install:
5674
# This disables XDebug which should speed up the build.
@@ -59,7 +77,7 @@ before_install:
5977
# directories to build the project.
6078
- cd ../..
6179
# Install this project into a directory called "ci".
62-
- composer create-project -n --no-dev --prefer-dist moodlehq/plugin-ci ci ^2
80+
- composer create-project -n --no-dev --prefer-dist moodlehq/plugin-ci ci ^3
6381
# Update the $PATH so scripts from this project can be called easily.
6482
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
6583

@@ -71,6 +89,7 @@ install:
7189
# - Create Moodle config.php, database, etc.
7290
# - Copy your plugin(s) into Moodle.
7391
# - Run Composer install within Moodle.
92+
# - Install the correct (or configured) version of nodejs/npm using NVM.
7493
# - Run NPM install in Moodle and in your plugin if it has a "package.json".
7594
# - Run "grunt ignorefiles" within Moodle to update ignore file lists.
7695
# - If your plugin has Behat features, then Behat will be setup.

docs/UPGRADE-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ upgrade of NodeJS, etc.
2525

2626
### What is happening to Version 1?
2727

28-
Version 1 still exists in the [v1](https://github.com/moodlehq/moodle-plugin-ci/tree/v1) branch. You can continue
28+
Version 1 still exists as its last release [1.5.8](https://github.com/moodlehq/moodle-plugin-ci/tree/1.5.8). You can continue
2929
to use it, but it is no longer getting new features and may not receive additional updates. In addition, it may start
3030
breaking in Moodle 3.2 or later.
3131

docs/UPGRADE-3.0.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
layout: page
3+
title: Upgrading from 2.X to 3.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.0 or later and Moodle 3.2 or later.
11+
12+
## Step 2: Review the change log
13+
14+
Detailed information about what changed in Version 3 can be found in the [change log](CHANGELOG.md).
15+
16+
## Step 3: Review the Travis CI configuration file
17+
18+
Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml)
19+
and update your `.travis.yml` file in your plugin. For detailed information about the contents of `.travis.dist.yml`
20+
file, please see this [help document](TravisFileExplained.md). **Please carefully** review the updated
21+
`.travis.dist.yml` as some steps have been removed and others added, like installation of Java 8,
22+
upgrade of NodeJS, etc.
23+
24+
A summary of the actions required may be:
25+
26+
1. Move to `moodlehq/moodle-plugin-ci` and bump to version 3 (^3).
27+
2. Ensure that the `docker` service is available.
28+
3. Remove any use of selenium or browsers, now they are handled automatically using docker images.
29+
4. Remove any use of manual `nvm`, `node` or `npm` stuff (unless it's to install components specific for your plugin). Now that's handled automatically too.
30+
31+
Note: Still, it's possible to configure the `node` version to be used, in case you want to experiment or have any exact need for a given plugin or branch. This is how it works, in order of precedence, fall-backing to next:
32+
33+
1. `--node-version` (install option).
34+
2. `NODE_VERSION` (env variable).
35+
3. `.nvmrc` (file present since Moodle 3.5).
36+
4. `lts/carbon` (last resort, default/legacy before Moodle 3.5).
37+
38+
## FAQ
39+
40+
### What is happening to Version 2?
41+
42+
Version 2 still exists as its last release [2.5.0](https://github.com/moodlehq/moodle-plugin-ci/tree/2.5.0). You can continue
43+
to use it, but it is no longer getting new features and may not receive additional updates. In addition, it may start breaking in Moodle 3.10 or later.
44+
45+
### Why Version 3?
46+
47+
Mainly to clearly separate development from the original [moodle-plugin-ci](https://github.com/blackboard-open-source/moodle-plugin-ci) as explained [here](https://github.com/moodlehq/moodle-plugin-ci#history-acknowledgement-and-appreciation). Also because, since **Moodle 3.5** we have a better way to control different node/npm versions using [nvm](https://github.com/nvm-sh/nvm) automatically. Finally because we wanted to leave PHP 5.x behind once and forever and this was a good moment to force the jump to **PHP 7**.
48+
49+
### Can I run Version 1 and 3?
50+
51+
If your plugin uses a single Git branch, but still works on Moodle versions older than 3.2, then you might be wanting
52+
to try to use both versions in a single `.travis.yml` file. First, this is not recommended due to its complexity.
53+
The preferred method is to use separate branches so your `.travis.yml` file is only using one version or another.
54+
If that is not desirable, then one could go about it by using environment variables. First, be sure that you update
55+
your `.travis.yml` file as explained above. Then a rough and **untested** example might be:
56+
57+
```yaml
58+
# WARNING - this is only a partial example, several steps were excluded to keep it simple!
59+
60+
env:
61+
# Define a V3 flag to conditionally run commands.
62+
- MOODLE_BRANCH=MOODLE_31_STABLE DB=pgsql V3=false
63+
- MOODLE_BRANCH=MOODLE_32_STABLE DB=mysqli V3=true
64+
65+
before_install:
66+
# You must install the correct version of this project:
67+
- if [ "$V3" = false ]; then composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^1; fi
68+
- if [ "$V3" = true ]; then composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3; fi
69+
70+
script:
71+
# Example of a Version 3 execution:
72+
- if [ "$V3" = true ]; then ...; fi
73+
74+
# Example of a Version 1 execution:
75+
- if [ "$V3" = false ]; then ...; fi
76+
77+
# And of course some exist in both versions, so just call it normally:
78+
- moodle-plugin-ci phpunit
79+
```

docs/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ This project supports the following testing frameworks and code analysis tools:
2525

2626
## Requirements
2727

28-
The requirements for **Version 2** are **PHP 5.6** or later and **Moodle 3.2** or later.
28+
The requirements for **Version 3** are **PHP 7.0** or later and **Moodle 3.2** or later.
2929

3030
In addition, the plugin being tested must have a [version.php](https://docs.moodle.org/dev/version.php) file
3131
and `$plugin->component` must be defined within it.
3232

33-
If you need to run your plugin in earlier versions of Moodle, then please use Version 1 of this tool. Documentation
34-
and more information about Version 1 can be found in the [v1](https://github.com/moodlehq/moodle-plugin-ci/tree/v1)
35-
branch. Please know that Version 1 is no longer getting new features and may not receive additional updates.
33+
If you need to run your plugin in earlier versions of Moodle, then please use previous versions of this tool. Documentation
34+
and more [information about Version 2 can be found here](https://github.com/moodlehq/moodle-plugin-ci/tree/2.5.0/docs/index.md). Similarly, [information about Version 1 can be found in here](https://github.com/moodlehq/moodle-plugin-ci/blob/1.5.8/README.md)
35+
36+
Please know older versions (1 and 2) are no longer getting new features and may not receive additional updates.
3637

3738
## Getting started
3839

@@ -67,6 +68,7 @@ Congratulations, you are building on Travis CI! Next steps on your continuous b
6768

6869
Guides to updating your plugin's `.travis.yml` file to use the latest versions of this tool.
6970

71+
* [Upgrade to 3.0](UPGRADE-3.0.md)
7072
* [Upgrade to 2.0](UPGRADE-2.0.md)
7173

7274
## Documentation

0 commit comments

Comments
 (0)