This change introduces a new command to `@TheRespectPanda` bot,
allowing him to dispatch the ci-perf.yml workflow benchmarks for
a pull request.
Initially, the bot will just trigger it and return the workflow
run URL for manual inspection. Future iterations on this feature
could then grab the benchmark results and update the comment.
- Parce PSL ICANN section into structured sections (rules,
wildcards, exceptions) according to the format.
- Updates PublicSuffix semantics for complete application of
the rules.
- Includes private domain suffixes now.
- Refreshes the existing data.
- Fixes the update-regionals.yml workflow, set it to run
twice a week.
References: https://github.com/publicsuffix/list/wiki/Format#format
Includes a basic bot workflow that just answers "pong" to ping
requests, includes a help message and ignores invalid commands.
This is the minimum feature that exercises token access, non
recursive comments (answering to its own pong) and so on.
See #1635
The goal is to collect data for a while. Until we have enough
benchmarks, the PR check is not very useful, so it was disabled.
We added `--tolerate-failure` to all runs, so this check will
never fail because of a missed performance assertion, but it will
report it and archive it.
With the introduction of composite actions in the GitHub workflows,
the ci-perf.yml workflow broke.
This happens because the setup-action configures a Post Run (a hook
to be executed after the workflow).
Since the benchmarks checkout a different orphan branch, when that
Post Run executes, it cannot find the action anymore.
To fix it, I introduce a new step that restores the git workspace,
making it available for that hook.
- Added a composite action for common setup tasks.
- Shorter names that fit better GitHub runner displays.
- Changed ci-perf to only run if src or tests change.
- Removed redundant step names when they're obvious.
When we change the contract of a validator, or create a new one, we need to
ensure that the mixin for the validator is present and matches the validator's
constructor.
This commit changes the current class that generates those mixin classes,
converting it into a linter so we can run it in the GitHub workflow to check for
missing changes.
The `reuse lint` command only checks for REUSE compliance, which
will accept all sorts of SPDX headers.
In this project, however, we have also other conventions. For
example, we require all PHP and docs files from the project
to have a specific license (not just any license) and also a
specific File Copyright Text (not just any copyright).
This commit introduces a command to solve this problem, validating
the headers more thoroughly.
The introduced command also does some dogfooding, using validators
from the library itself to perform some of its tasks, namely: Call,
Each, Contains, Templated and Named, showcasing potential different
use cases for the project.
Makes the project more friendly to GitHub users by providing
conventional files.
Those changes will improve our score under the GitHub
community tab:
https://github.com/Respect/Validation/community
- The CHANGELOG.md file was removed. It was outdated and
not being maintained.
- Minimalistic .github/PULL_REQUEST_TEMPLATE.md
- Minimalistic .github/SECURITY.md
- Minimalistic .github/CODE_OF_CONDUCT.md
- Minimalistic .github/ISSUE_TEMPLATE
A new workflow, continuous-integration-perf.yml was introduced. It:
- Checks out the `benchmarks` branch locally.
- Runs the benchmarks, accounting for non-existant baselines
and target (main/PR).
- Stores the .phpbench storage folder and a human-readable
report in the `benchmarks` branch.
- Does not make a PR fail, and never reports a failure
when merging to main.
- Allows workflow_dispatch for quick re-runs, and has an
option to reset the baseline in case something changes
(GitHub runner setup gets faster/slower, major refactors,
etc).
Thus, it keeps a historical record of all benchmark results.
These results can be viewed by exploring GitHub via the web
interface and seeing the changes in `latest.md` (the human
file commited).
Additionally, one can clone the `benchmarks` branch and run
`phpbench log` to explore the history in more detail.
Some adjustments to previously added benchmarks were made:
- Assertions were included in order to track time and memory
tresholds.
- The benchmarks are now more surgical, and address the
concrete validators instead of the whole chain validate.
These changes were made to make benchmarks more isolated, with
the intention of adding chain-related benchmarks separately
in the future.
This commit introduces REUSE compliance by annotating all files
with SPDX information and placing the reused licences in the
LICENSES folder.
We additionally removed the docheader tool which is made obsolete
by this change.
The main LICENSE and copyright text of the project is now not under
my personal name anymore, and it belongs to "The Respect Project
Contributors" instead.
This change restores author names to several files, giving the
appropriate attribution for contributions.
When we make changes to the category of a validator, it's easy to forget
to update overall list of validators. This commit a GitHub actions that
will run a console command to check if the documentation it up-to-date.
The job will fail when we need to change the document, but the console
command will fix the issues, so there isn't a lot of friction there.
I created those validators to make it easy to parse parameters or
console command inputs that were answers to questions one might ask.
One of the biggest problems is that it depends on the machine's locale,
which can be a bit troublesome, rather than receiving a locale in the
constructor. That doesn’t allow for a lot of flexibility when someone
has a multi-lingual application. Additionally, these validators rely on
the regex from `nl_langinfo()`, which is very permissive, resulting in
false positives.
I have a working version of a console command that retrieves data from
the Unicode Common Locale Data Repository (CLDR) and updates a list of
`yesstr` and `nostr` strings from the main XML file of each language.
However, I came to realise that the whole thing is not worth it.
The validators Yes and No can be replaced by using rules like `Regex`
and `In`. They won’t have the ease of multilingual support, but I don’t
think those validators are used a lot. So, I decided I would just remove
them, and if users really ask for it in the next major version, I’d be
happy to revive my branch.
It makes more sense to use PHP to generate PHP code than to use Bash. I
love writing Bash scripts, but I know it's not for everyone, and they
can become quite complex. Porting them to PHP code also lowers the
barrier for people to change them.
While I was making those changes, I also noticed a problem with how we
save the domain suffixes. We're converting all of them to ASCII, so we
are not preserving languages such as Chinese, Thai, and Hebrew, which
use non-ASCII characters.
This workflow now automatically enables auto-merge for pull requests
created by the regional information update job. When all required CI
checks pass, the PR will merge automatically using rebase strategy.
We want to release version 3.0 as fresh as possible, without having to
maintain backward compatibility with the previous versions. Because that
version will be on for some time, we decided it will be best to support
only PHP version 8.5 or higher.
Acked-by: Alexandre Gomes Gaigalas <alganet@gmail.com>
I'm creating a workaround here, which is not exactly happy with, but
adding "uopz" as a dependency to run the tests make it harder for
developers, including myself.
Although I love PHPT files, and I've done my fair share of making it
easier to write them in this library, they're very slow, and running
them has become a hindrance.
I've been fidgeting with the idea of using Pest for a while, and I think
it's the right tool for the job. I had to create a couple of functions
to make it easier to run those tests, and now they're working really
alright.
I migrated all the PHPT files into Pest files -- I automated most of the
work with a little script using "nikic/php-parser"; this commit should
contain all the previous PHPT tests as Pest tests.
The previous integration tests would take sixteen seconds, and the Pest
tests take less than a second.
Since we now have PHP ISO Codes as a dependency[1], it doesn't make
sense to keep dealing with this data ourselves.
[1]: 04b2722d02
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
Since we now have PHP ISO Codes as a dependency[1], it doesn't make
sense to keep dealing with this data ourselves.
[1]: 04b2722d02
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
PHP 8.0 is no longer supported. Some of our dependencies now do not work
on PHP 8.0 anymore.
This commit will also run tests on PHP 8.3.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
- For this particular updater, a list of exceptions to the rules
downloaded by geonames is included in POSTAL_CODES_EXTRA, for
cases in which we seem to do better than geonames itself based
on previous user reports.
- Added an option to also validate formatting of the postal codes.
- Combined multiple PR bots into a single one.
Since we already have that library as a dependency of our repository, it
makes sense to use it as a source of language codes instead of keeping a
list of currencies ourselves.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
Since "sokil/php-isocodes" is a dependency of our repository already, it
makes sense to use it as a source of currency codes instead of keeping a
list of currencies ourselves.
By using that library, we can also validate currency codes using
different sets.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
We have three workflows that automatically update the code. They are
using version 2.0 as a base to create their changes. We need to update
that because the last supported version is 2.1.
Since I do not think it is a good idea to change code every time a new
MINOR version is released, I moved that value to a repository secret.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
We already supported PHP 8.0 as our constrains in the "composer.json"
file was ">=7.3", but we were not testing it before.
Because of that, I found a bug on "EndsWith" which is fixed now.
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>