Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
13 tasks done
tbouffard opened this issue Sep 2, 2022 · 2 comments
Closed
13 tasks done

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

tbouffard opened this issue Sep 2, 2022 · 2 comments
Assignees

Comments

@tbouffard
Copy link
Member

tbouffard commented Sep 2, 2022

Currently, we duplicate several configuration

  • PR title checks: use a custom regex to try to match Conventional Commits rules. In the doc-site, doc-theme and all doc content repositories.
  • forbidden content (Bonita BPMN, url to doc site): all doc content.

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 process-analytics/bpmn-visualization-tools#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 (bonitasoft/bonita-doc#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: bonitasoft/bonita-doc#2103 (review)
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
Copy link
Contributor

benjaminParisel commented Sep 23, 2022

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.
bonitasoft/bonita-doc#2166

@tbouffard
Copy link
Member Author

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

@tbouffard tbouffard self-assigned this Nov 18, 2022
@tbouffard tbouffard removed their assignment May 26, 2023
@tbouffard tbouffard self-assigned this Nov 17, 2023
benjaminParisel pushed a commit that referenced this issue Nov 24, 2023
)

This workflow calls the "pr-antora-content-guidelines-checker" action with the configuration which applies to all documentation content repositories. This reduces the configuration maintenance. It applies to Pull Request only.

covers #422
benjaminParisel added a commit to bonitasoft/bonita-labs-doc that referenced this issue Nov 24, 2023
Use the new use reusable workflow to validate if the contribution (PR) follows the guidelines on documentation content

For now only check if:
- files contain:description: attributes
- files not contain any forbidden attribute

Covers bonitasoft/bonita-documentation-site#591
Covers bonitasoft/bonita-documentation-site#422
@tbouffard tbouffard moved this from In Progress to In Review in Bonita documentation site - work in progress Nov 24, 2023
benjaminParisel added a commit to bonitasoft/bonita-central-doc that referenced this issue Nov 24, 2023
Use new action to validate if contribution (PR) follows the guidelines on documentation content

For now only check if:
* files contain :description: attributes
* files not contain any forbidden attributes

Covers bonitasoft/bonita-documentation-site#591
Covers bonitasoft/bonita-documentation-site#422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants