This change:
- Moves the API to use the `before_file_created` hook
- Remove the newly created `$notify` param for `after_file_created` hook
- Stop persisting redactable content
- Update manager to not deal with `stored_file` instances
- Correct namespace from `\core\filereact` to `\core_files\redactor`
- Add `redactor` as a valid L2 namespace within the `core_files` API
- Correct config setting names
- Adds missing unit tests
- Disables the service for PHPUnit tests
AMOS BEGIN
MOV [fileredact,core_files],[redactor,core_files]
MOV [fileredact,core_files],[redactor:exifremover,core_files]
MOV [fileredact,core_files],[redactor:exifremover:emptyremovetags,core_files]
MOV [fileredact,core_files],[redactor:exifremover:enabled,core_files]
MOV [fileredact,core_files],[redactor:exifremover:enabled_desc,core_files]
MOV [fileredact,core_files],[redactor:exifremover:failedprocessexiftool,core_files]
MOV [fileredact,core_files],[redactor:exifremover:failedprocessgd,core_files]
MOV [fileredact,core_files],[redactor:exifremover:heading,core_files]
MOV [fileredact,core_files],[redactor:exifremover:mimetype,core_files]
MOV [fileredact,core_files],[redactor:exifremover:mimetype_desc,core_files]
MOV [fileredact,core_files],[redactor:exifremover:removetags,core_files]
MOV [fileredact,core_files],[redactor:exifremover:removetags_desc,core_files]
MOV [fileredact,core_files],[redactor:exifremover:tag:all,core_files]
MOV [fileredact,core_files],[redactor:exifremover:tag:gps,core_files]
MOV [fileredact,core_files],[redactor:exifremover:tooldoesnotexist,core_files]
MOV [fileredact,core_files],[redactor:exifremover:toolpath,core_files]
MOV [fileredact,core_files],[redactor:exifremover:toolpath_desc,core_files]
AMOS END
This workflow just finds all the individual
tests available in core (all the test_ methods
in _test.php file) and runs them one by one,
with a total isolation, because each one is
executed by a different PHPUnit invocation..
Any test ending with error, will be reported
as part of the output.
Note that we are not using PHPUnit's own
isolation here, just running them one by one.
This is an adjustment for MDL-77166, where the auto-close PRs
workflow was introduced.
That workflow does close and lock any PR in the moodle/moodle.git repo.
We have detected that, when proceeding to lock the PRs it's
always adding a comment. But we only want that when closing the
PRs (as they are open). When the only task is to lock them (normally
old PRs that are already closed by not locked) we don't want any
comment to be added (so no notification/spam happens on those old PRs).
Luckily there is a setting for it: skip-closed-pr-comment: true
So applying for it. Note that we have run various tests in fork
repository and it seems to be working ok. Only open PRs got the
comment and closed PRs were silently locked.
Note that we have also enabled it to be executed
via manual dispatch to be able to close currently
existing PRs.
Once everything existing is closed, it will take on
any new PR arriving. Then, we can remove the manual
dispatching, although it's not critical to leave it
there in case we want to use that workflow with other
repos.
Note that, for windows php82, we need to have the php-zip extension
explicitly added. So we are adding it too.
From the manual:
"As of PHP 8.2.0, php_zip.dll DLL must be enabled in php.ini.
Previously, this extension was built-in."
Basically, we only need to change:
- PHP 8.0
- MySQL 8.0
- PostgreSQL 13
Also, remove any php-xmlrpc installation because they aren't
needed since Moodle 4.1.
Finally, ensure that we aren't using mysql bin logs ever, because
they are huge and can make the 1Gb tmpfs to become full. This is
specifically needed for MySQL 8.0, because it comes with bin logs
enabled by default.
We have forked the mysql-action to achieve that:
https://github.com/moodlehq/mysql-action
Worth blaming travis because, after PG 11 and 12 using port 5433,
now they are back (in PG 13) to port 5432. Surely there is some
logic behind the undocumented ping-pong but...
Have tried to also bump Travis to 22.04 (jammy) but it
was not working ok, with problems trying to find both
PHP and PostgreSQL versions.
Surely that's because 22.04 support is really new (Sep 9, 2022):
https://blog.travis-ci.com/22-9-9-ubuntujammy
So we'll have to wait a little more before being able to, also,
bump Travis to use 22.04
Basically, we only need to change:
- PHP 7.4
- PostgreSQL 12
Also, moving up to focal as dev environment, removing NVM_VERSION
because nvm automatically detects .nvmrc and switching to
socketed connection for PostgreSQL (little improvements).
We are disabling the -v (verbose) option, used by default. Still,
now we support a secret (that can be added to everyone's repository)
to accept any PHPUnit's command line options and run the tests with
them.
Some examples:
phpunit_options = -v (to keep the verbose option enabled)
phpunit_options = --testdox (to print information about every test...)
... (basically anything supported by the CLI).
Also, we are raising here the environment from Ubuntu 18.04 to 20.04
(self tested by GHA, heh)
Also adds xmlrpc-beta from PECL (PHP8 moved the extension there)
and setups max_input_vars=5000 as initial value (see MDL-71390).
Note that this also includes a tiny modification when configuring
redis sessions, because there was some outdated code from old issue,
now fixed (MDL-60978), so that info has been removed.
First working version, supports phpunit (using build matrix):
- php72 (lowest), running mysql.
- php74 (highest), running postgres.
Also verifies that the branch has been "gruntified" and there
isn't any missing change (build js/css files).
TODO: Verify the remaining checks currently in .travis.yml, namely:
- CITEST
- Add caching
- Better health-check for DB images.
- Support from the tracker (satus badges and enable check).
- Support from CiBoT (status and enable check).
- Consider moving both the common setup (git, composer...)
and the database (mysql, postgres) to own actions for
easier tweaking.