bonitasoft / bonita-documentation-site

The sources of the Bonita Documentation site
https://documentation.bonitasoft.com/
GNU General Public License v2.0
9 stars 5 forks source link

Remove duplications in the GH workflows: PR metadata checks #422

Closed tbouffard closed 10 months ago

tbouffard commented 2 years ago

Currently, we duplicate several configuration

This duplication forces us to update all workflows when a new rules is added. I suggest we introduce one or several reusable workflows in the doc-site repo that will be called in other repositories.

✔️ PR Title checks

Currently we are using an action and we need to customize a rexep for the body: https://github.com/marketplace/actions/conventional-commit-checker It doesn't enforce that the title follows Conventional Commits, the rexep it uses is not exhaustive. It doesn't check that the prefix is ok: for instance, doc is valid whereas docs should be used instead.

Bonita connectors use another action (https://github.com/GsActions/commit-message-checker) which also relies on regexp and seems not accurate as well to match Conventional Commits rules. See https://github.com/bonitasoft/bonita-connector-webservice/blob/17a214d5a3f8af55080855a67a476497e3235689/.github/workflows/commit-message-check.yml

I have tested another actions that is designed to use Conventional Commits preset https://github.com/jef/conventional-commits-pr-action that I used in https://github.com/process-analytics/bpmn-visualization-tools/pull/3 this one could also be ok: https://github.com/beemojs/conventional-pr-action

If we want to go in the rexep way, we can use this tool to validate the rexep: https://regexr.com/

Note: having a shared action/wf will allow us to start with an implementation and update it at any time without having to change all workflow in doc content repositories

Tasks

✔️ Doc content checks

Currently, we enforce that some string are not present in files touched by the PR (doc site url, Bonita BPM) We use a shared Bonitasoft actions but the specific forbidden words are duplicated in all branches and repositories. We should add a dedicated action or reusable workflow in the bonita-documentation-site that will configure the same words for all repositories. This will make the maintenance easier when we want to add a word for instance. In addition, we want to add more checks in the future, for instance: content wording and syntax with Vale (https://github.com/bonitasoft/bonita-doc/pull/2247), AsciiDoc file name, image size, image duplication detection, ... Having a shared action/workflow will bring the new checks to all components seamlessly, without having to change anything in the documentation content repository.

I recently saw usage of HTML anchor instead of AsciiDoc syntax: https://github.com/bonitasoft/bonita-doc/pull/2103#pullrequestreview-1064985616 As part of this issue, we could add a new forbidden content to avoid such addition in the future.

Tasks

Note about the reusable workflows

In the doc-site repository, we could trigger it directly on pull request except if it requires inputs. Forbidden content check is not necessary in the doc-site and doc-theme repository, so we could ignore them if we detect the current repository is one them. Alternatively, we can add an option to not run it.

benjaminParisel commented 2 years ago

We decide today to test https://github.com/jef/conventional-commits-pr-action action to check the commit title. They're only replaced on Bonita-doc repository for now. https://github.com/bonitasoft/bonita-doc/pull/2166

tbouffard commented 1 year ago

For "PR Title Checks", I propose to create a shared actions and then use it in all repositories: https://github.com/bonitasoft/actions/issues/82