From 27e7c5a57bc982b834a92e6144ab000c629aeec7 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 30 Nov 2023 16:00:37 +0100 Subject: [PATCH] Move all "master" uses to "main" The canonical repository https://github.com/moodlehq/moodle-plugin-ci has moved its "master" branch to "main". So, here, we are adjusting all the places where the, now old, "master" branch was being used. Usually that includes: - CI Integrations (GHA, Travis...). - Docs: READMEs, change logs, comments, any link pointing to "master" in general. - Cases in code base that may depend of git branch name (unlikely, but...) --- .github/workflows/test.yml | 4 ++-- .travis.yml | 4 ++-- README.md | 7 ++++--- docs/AddExtraPlugins.md | 2 +- docs/CHANGELOG.md | 36 ++++++++++++++++++------------------ docs/GHAFileExplained.md | 2 +- docs/ReleaseNewVersion.md | 4 ++-- docs/TravisFileExplained.md | 2 +- docs/UPGRADE-2.0.md | 4 ++-- docs/UPGRADE-3.0.md | 2 +- docs/UPGRADE-4.0.md | 6 +++--- docs/index.md | 6 +++--- tests/ValidateTest.php | 2 +- 13 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3327ef50..de9b33d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,7 +75,7 @@ jobs: matrix: include: - php: '8.2' - moodle-branch: 'master' + moodle-branch: 'main' - php: '8.2' moodle-branch: 'MOODLE_403_STABLE' - php: '8.2' @@ -194,7 +194,7 @@ jobs: include: # Each supported PHP version once. That's enough. - php: '8.2' - moodle-branch: 'master' + moodle-branch: 'main' - php: '8.1' moodle-branch: 'MOODLE_403_STABLE' - php: '8.0' diff --git a/.travis.yml b/.travis.yml index 12d723ef..62ffcb43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,9 +88,9 @@ jobs: - stage: Integration tests if: env(MOODLE_BRANCH) IS present - # Only master with highest supported PHP version. + # Only main with highest supported PHP version. - php: 8.2 - env: MOODLE_BRANCH=master + env: MOODLE_BRANCH=main # Last stable with highest supported PHP version. - php: 8.2 env: MOODLE_BRANCH=MOODLE_402_STABLE diff --git a/README.md b/README.md index 36e6dac4..b9460a57 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Latest Stable Version](https://poser.pugx.org/moodlehq/moodle-plugin-ci/v)](//packagist.org/packages/moodlehq/moodle-plugin-ci) -![Moodle Plugin CI](https://github.com/moodlehq/moodle-plugin-ci/workflows/Moodle%20Plugin%20CI/badge.svg) -[![Build Status](https://travis-ci.com/moodlehq/moodle-plugin-ci.svg?branch=master)](https://travis-ci.com/moodlehq/moodle-plugin-ci) -[![codecov](https://codecov.io/gh/moodlehq/moodle-plugin-ci/branch/master/graph/badge.svg?token=I3PPJ383G7)](https://codecov.io/gh/moodlehq/moodle-plugin-ci) +[![Moodle Plugin CI](https://github.com/moodlehq/moodle-plugin-ci/actions/workflows/test.yml/badge.svg)](https://github.com/moodlehq/moodle-plugin-ci/actions/workflows/test.yml) +[![Build Status](https://app.travis-ci.com/moodlehq/moodle-plugin-ci.svg?branch=main)](https://app.travis-ci.com/github/moodlehq/moodle-plugin-ci) +[![codecov](https://codecov.io/gh/moodlehq/moodle-plugin-ci/branch/main/graph/badge.svg?token=I3PPJ383G7)](https://codecov.io/gh/moodlehq/moodle-plugin-ci) [![Total Downloads](https://poser.pugx.org/moodlehq/moodle-plugin-ci/downloads)](//packagist.org/packages/moodlehq/moodle-plugin-ci) [![License](https://poser.pugx.org/moodlehq/moodle-plugin-ci/license)](//packagist.org/packages/moodlehq/moodle-plugin-ci) @@ -31,3 +31,4 @@ Many, many thanks to all the collaborators, very specially to **Mark Nielsen** f making this product such a great tool for the entire **Moodle development community**, we'll try to keep the bar high! And, of course, everybody is welcome to participate and help here, it's **Open Source**, you know! +/ diff --git a/docs/AddExtraPlugins.md b/docs/AddExtraPlugins.md index 61042aa7..c8dd4656 100644 --- a/docs/AddExtraPlugins.md +++ b/docs/AddExtraPlugins.md @@ -16,7 +16,7 @@ You may add as many plugins as you like, by simply calling the `add-plugin` comm command takes a single argument and that is your GitHub account name and the project name. So, in the example, it would clone `https://github.com/moodlehq/moodle-local_hub.git`. -By default, the branch that is cloned is the `master` branch. You can use the `--branch` (`-b`) option to override +If not specified, the default branch of the repository is used (normally `main`). You can use the `--branch` (`-b`) option to override this behavior. If you use the same branch names as Moodle (EG: `MOODLE_XY_STABLE`), then a handy trick is to pass the `$MOODLE_BRANCH` build variable to the `add-plugin` command. Here is an example: diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4057aec2..4c2fee0d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -21,7 +21,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt php: error while loading shared libraries: libonig.so.5 ``` - To avoid that problem it's recommended to to add the `libonig5` package to the `travis.yml` file. For a working example, please reference the updated `.travis.dist.yml`file. + To avoid that problem, it's recommended to to add the `libonig5` package to the `travis.yml` file. For a working example, please reference the updated `.travis.dist.yml`file. ## [4.1.8] - 2023-10-20 ### Changed @@ -164,7 +164,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt ### Fixed - Updated to `php-coveralls/php-coveralls` v2 for uploading coverage results to [Coveralls](https://coveralls.io) with the `coveralls-upload` command. -- ACTION REQUIRED: Review any use of the `coveralls-upload` command in GHA and ensure that `COVERALLS_REPO_TOKEN` is set in the environment. See [Coveralls integration](https://github.com/moodlehq/moodle-plugin-ci/blob/master/docs/CodeCoverage.md#coveralls-integration) for more information. +- ACTION REQUIRED: Review any use of the `coveralls-upload` command in GHA and ensure that `COVERALLS_REPO_TOKEN` is set in the environment. See [Coveralls integration](https://github.com/moodlehq/moodle-plugin-ci/blob/main/docs/CodeCoverage.md#coveralls-integration) for more information. ## [3.4.4] - 2023-01-20 ### Changed @@ -172,10 +172,10 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt ## [3.4.3] - 2022-12-24 ### Changed -- Updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) and - [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +- Updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) and + [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) (and documentation) to fulfil [Moodle 4.2 new requirements](https://tracker.moodle.org/browse/MDL-74905). -- ACTION REQUIRED: Review existing integrations running tests against master (4.2dev). There are a few Moodle 4.2 new requirements: +- ACTION REQUIRED: Review existing integrations running tests against main (4.2dev). There are a few Moodle 4.2 new requirements: - PHP 8.0 is required (instead of 7.4). - PostgreSQL 13 is required (instead of 12). - MariaDB 10.6 is required (instead of 10.4). @@ -198,10 +198,10 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt - `moodle-plugin-ci install` now provides an option `--db-port` to define a custom database port. ### Changed -- Updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) and - [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +- Updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) and + [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) (and documentation) to fulfil [Moodle 4.1 new requirements](https://tracker.moodle.org/browse/MDL-71747). -- ACTION REQUIRED: Review existing integrations running tests against master (4.1dev). There are a few Moodle 4.1 new requirements: +- ACTION REQUIRED: Review existing integrations running tests against main (4.1dev). There are a few Moodle 4.1 new requirements: - PHP 7.4 is required (instead of 7.3). - PostgreSQL 12 is required (instead of 10). Pay special attention to the changes needed for this and Travis! - MariaDB 10.4 is required (instead of 10.2.29). @@ -229,7 +229,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt ## [3.2.5] - 2022-03-31 ### Changed - ACTION SUGGESTED: Now, it's safe to 'unpin' the MariaDB version in all integrations. With MariaDB 10.6.7 and 10.7.3 already released, the existing problems are gone, so it's possible to move away from the older 10.5 version. To achieve that, just look for any use of `image: mariadb:10.5` and change it to `image: mariadb:10`. For more information, see [MDL-72131](https://tracker.moodle.org/browse/MDL-72131). -- Updated version of [moodle-local_codechecker](https://github.com/moodlehq/moodle-local_codechecker) to v3.1.0. For list of changes see [changelog](https://github.com/moodlehq/moodle-local_codechecker/blob/master/CHANGES.md#changes-in-version-310-20220225---fondant-chocolate), you should expect numerous `@covers` annotation warnings in particular. +- Updated version of [moodle-local_codechecker](https://github.com/moodlehq/moodle-local_codechecker) to v3.1.0. For list of changes see [changelog](https://github.com/moodlehq/moodle-local_codechecker/blob/main/CHANGES.md#changes-in-version-310-20220225---fondant-chocolate), you should expect numerous `@covers` annotation warnings in particular. ### Added - Use utf8mb4 for MySQL and MariaDB setup. @@ -267,8 +267,8 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt - New tool-agnostic `CI_BUILD_DIR` env. variable that can be used instead of the old `TRAVIS_BUILD_DIR` one. Note that support for the later [will be removed](https://github.com/moodlehq/moodle-plugin-ci/issues/118) at some point in the future. ### Changed -- Updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) and - [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +- Updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) and + [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) to use PostgreSQL 10 (Moodle 4.0 new requirement). - ACTION REQUIRED: Existing integrations running tests with PostgreSQL now need to use version 10 or newer. - ACTION REQUIRED: Existing integrations running tests with MariaDB must avoid using the 10.6 version and use 10.5 instead. It comes with some changes making it incompatible with Moodle default installation. To achieve that, just look for any use of `image: mariadb:10` and change it to `image: mariadb:10.5`. This is being tracked @ [MDL-72131]( https://tracker.moodle.org/browse/MDL-72131) and, once fixed, it will be possible to go back to the original image. @@ -283,8 +283,8 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt only if adding PHP 8 jobs. These changes include 1) Setting up the `max_input_vars=5000` PHP configuration setting, for all runs, and 2) Enabling the `xmlrpc-beta` extension if the plugin requires xmlrpc services, only for PHP 8 runs. See - [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) and - [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) for more information. + [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) and + [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) for more information. ### Changed - Updated various internal dependencies and tools. @@ -311,12 +311,12 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt - ACTION REQUIRED: If you are using GitHub Actions, add `NVM_DIR` definition in "Initialise moodle-plugin-ci" step. Without it `nvm` can't be used for node version switching, see the step definition at - [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) + [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) and add missing `NVM_DIR` line your plugin's GHA workflow file. ### Changed - `moodle-plugin-ci add-plugin` command now uses default banch to checkout - instead of `master` if `--branch` param is not specified.. + instead of `main` if `--branch` param is not specified.. ## [3.0.4] - 2021-01-29 ### Fixed @@ -333,7 +333,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt ### Added - Detect existence of legacy php-webdriver, and use a different Firefox image when it is in use. -- Add [manual](https://github.com/moodlehq/moodle-plugin-ci/blob/master/docs/index.md) and [example](https://github.com/moodlehq/moodle-plugin-ci/blob/master/docs/GHAFileExplained.md) on using GitHub Actions as CI tool. +- Add [manual](https://github.com/moodlehq/moodle-plugin-ci/blob/main/docs/index.md) and [example](https://github.com/moodlehq/moodle-plugin-ci/blob/main/docs/GHAFileExplained.md) on using GitHub Actions as CI tool. ## [3.0.3] - 2020-10-16 ### Changed @@ -616,7 +616,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt - `moodle-plugin-ci shifter` command. Run YUI Shifter on plugin YUI modules. - `moodle-plugin-ci csslint` command. Lints the CSS files in the plugin. -[Unreleased]: https://github.com/moodlehq/moodle-plugin-ci/compare/4.1.8...master +[Unreleased]: https://github.com/moodlehq/moodle-plugin-ci/compare/4.1.8...main [4.1.8]: https://github.com/moodlehq/moodle-plugin-ci/compare/4.1.7...4.1.8 [4.1.7]: https://github.com/moodlehq/moodle-plugin-ci/compare/4.1.6...4.1.7 [4.1.6]: https://github.com/moodlehq/moodle-plugin-ci/compare/4.1.5...4.1.6 @@ -681,4 +681,4 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt [1.3.0]: https://github.com/moodlehq/moodle-plugin-ci/compare/1.2.0...1.3.0 [1.2.0]: https://github.com/moodlehq/moodle-plugin-ci/compare/1.1.0...1.2.0 [1.1.0]: https://github.com/moodlehq/moodle-plugin-ci/compare/1.0.0...1.1.0 -[.travis.dist.yml]: https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml +[.travis.dist.yml]: https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml diff --git a/docs/GHAFileExplained.md b/docs/GHAFileExplained.md index fbc65e2c..7408d4f9 100644 --- a/docs/GHAFileExplained.md +++ b/docs/GHAFileExplained.md @@ -4,7 +4,7 @@ title: GitHub Actions CI workflow file explained --- Below is the -[gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) +[gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) file with comments added to explain what each section is doing. For additional information please refer to [workflow syntax reference](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions). diff --git a/docs/ReleaseNewVersion.md b/docs/ReleaseNewVersion.md index 64c04ee9..67fe2b4f 100644 --- a/docs/ReleaseNewVersion.md +++ b/docs/ReleaseNewVersion.md @@ -18,14 +18,14 @@ Prior to tagging a release, ensure the following have been updated: Any other version will automatically be used. When all the changes above have been performed, push them straight upstream to -`master` or create a standard PR to get them reviewed and incorporated +`main` or create a standard PR to get them reviewed and incorporated upstream. In the latter case, use your repo clone for PR - this way Packagist will not capture new branch in the list of tags and you will not end up having double CI build on Travis, also when merging PR, please **avoid merge commit** (use "Rebase and merge" option). Once all code and commits are in place and verified, you need to tag a -release. Tag `master` branch `HEAD` and push using commands: +release. Tag `main` branch `HEAD` and push using commands: ```bash $ git tag -a 4.0.8 -m "Release version 4.0.8" diff --git a/docs/TravisFileExplained.md b/docs/TravisFileExplained.md index 843e4e1f..d9911092 100644 --- a/docs/TravisFileExplained.md +++ b/docs/TravisFileExplained.md @@ -3,7 +3,7 @@ layout: page title: Travis CI file explained --- -Below is the [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +Below is the [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) file but with comments added to explain what each section is doing. For additional help, see [Travis CI's documentation](http://docs.travis-ci.com/user/getting-started/). diff --git a/docs/UPGRADE-2.0.md b/docs/UPGRADE-2.0.md index 113c0d13..f3c74a5d 100644 --- a/docs/UPGRADE-2.0.md +++ b/docs/UPGRADE-2.0.md @@ -13,9 +13,9 @@ Requirements have changed, this project now requires PHP 5.6 or later and Moodle Detailed information about what changed in Version 2 can be found in the [change log](CHANGELOG.md). -## Step 3: Review the Travis CI configuration file +## Step 3: Review the Travis CI configuration file -Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) and update your `.travis.yml` file in your plugin. For detailed information about the contents of `.travis.dist.yml` file, please see this [help document](TravisFileExplained.md). **Please carefully** review the updated `.travis.dist.yml` as some steps have been removed and others added, like installation of Java 8, diff --git a/docs/UPGRADE-3.0.md b/docs/UPGRADE-3.0.md index 61b34f23..eba7ac8d 100644 --- a/docs/UPGRADE-3.0.md +++ b/docs/UPGRADE-3.0.md @@ -15,7 +15,7 @@ Detailed information about what changed in Version 3 can be found in the [change ## Step 3: Review the Travis CI configuration file -Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) and update your `.travis.yml` file in your plugin. For detailed information about the contents of `.travis.dist.yml` file, please see this [help document](TravisFileExplained.md). **Please carefully** review the updated `.travis.dist.yml` as some steps have been removed (like installation of Java 8, installing of NodeJS, etc.) and others added. diff --git a/docs/UPGRADE-4.0.md b/docs/UPGRADE-4.0.md index b2a1ef57..7581e107 100644 --- a/docs/UPGRADE-4.0.md +++ b/docs/UPGRADE-4.0.md @@ -17,7 +17,7 @@ Detailed information about what changed in Version 4 can be found in the [change ### GitHub Actions -Review the updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) +Review the updated [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) 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). A summary of the actions required for version 4 is: @@ -27,7 +27,7 @@ A summary of the actions required for version 4 is: ### Travis CI -Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) +Review the updated [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) and update your `.travis.yml` file in your plugin. For detailed information about the contents of `.travis.dist.yml` file, please see our [sample Travis workflow file explanation](TravisFileExplained.md). @@ -63,7 +63,7 @@ For example, for GitHub Actions, it can be setup as follows: matrix: include: - php: 8.2 - moodle-branch: master + moodle-branch: main database: pgsql plugin-ci: ^4 # Decide the version to use per matrix element. ... diff --git a/docs/index.md b/docs/index.md index 6456d127..ac48bee5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -51,7 +51,7 @@ Follow steps to get your Moodle plugin building in CI tool of your choice. #### Step 1 -Copy [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml) file to `.github/workflows` directory +Copy [gha.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml) file to `.github/workflows` directory in your project. You can give this file any name, e.g. `moodle-ci.yml` which we use in this document. Review the `moodle-ci.yml` contents and remove anything that is not needed. See this [help document](GHAFileExplained.md) for an explanation about the contents of the this file. Once you have added the `.github/workflows/moodle-ci.yml` file, commit and push up to GitHub, to trigger a @@ -76,7 +76,7 @@ run a build to make sure nothing broke. #### Step 2 -Copy the [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) file into the +Copy the [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/main/.travis.dist.yml) file into the root of your plugin and rename it to `.travis.yml`. Now might be a good time to review the `.travis.yml` contents and remove anything that is not needed. See this [help document](TravisFileExplained.md) for an explanation about the contents of the this file. Once you have added the `.travis.yml` file, commit and push up to GitHub, to trigger a @@ -197,4 +197,4 @@ Semantic Versioning. ## License This project is licensed under the GNU GPL v3 or later. See the -[LICENSE](https://github.com/moodlehq/moodle-plugin-ci/blob/master/LICENSE) file for details. +[LICENSE](https://github.com/moodlehq/moodle-plugin-ci/blob/main/LICENSE) file for details. diff --git a/tests/ValidateTest.php b/tests/ValidateTest.php index 3c45a4e4..9e66fb59 100644 --- a/tests/ValidateTest.php +++ b/tests/ValidateTest.php @@ -107,7 +107,7 @@ public function testInvalidUrl($url) public function gitBranchProvider() { return [ - ['master'], + ['main'], ['MOODLE_27_STABLE'], ['MOODLE_28_STABLE'], ['MOODLE_29_STABLE'],