Closed M-casado closed 1 month ago
I created and tested (see PR) new code in order to:
dev
or main
, via a workflowAgain, this code is simply to automate manual checks that in the future, when reviews are due and we're adding new SOPs, we don't want to do manually. Therefore, in this PR we have both code that lints SOPs and code that automatically creates the content table with all SOPs and their information.
Information that is present in the SOP index table (which is empty for now since we don't have any SOP public yet) can be easily modified, adding or removing columns at will. I chose the following format based on what I believe would be useful for users (i.e., GDI members) searching for GDI SOPs: | Name | Identifier | Template version | Type | GDI Node | Instance version | Nº steps | Last modified |
---|---|---|---|---|---|---|---|---|
Unfortunately, I don't have so much technical background to review this PR. However, I believe that the idea behind the use of the code to make more automated checks (and reviews) in the future is very good!
No worries, @elisavettorstensson - The key is also to have all of us informed about the non-technical flag that if there is a ❌ in a PR, it may need to be checked before merging.
The code itself will need to be maintained, and I can do for as long as I am part of the task. Others may want to contribute to it as well, in a technical (directly adding to it) or non-technical (letting me know of desired changes) way. If you're in the latter, and you feel like some checks/actions would be great to automate for this GH, feel free to raise them in the fortnightly meetings :)
I'm hoping in the future to add more checks as well. There are many things that we could automate instead of having to check manually. Examples could be:
Went over the code goals and features at today's meeting.
Summary
I created a python script
sop-linter.py
that contains the set of rules for linting of SOPs. These rules include things like having required sections, or the format of some tables. Given that linting rules in the script are each a method, it's easy to add/modify them at any given time. The script can be run by anyone manually, prior to creating a PR, to see if SOPs pass the validation:I also created a GitHub workflow
lint-sops.yml
that triggers at any PR targetingmain
ordev
branches in the repository. The workflow executes the linting SOP, and will be an easy check on whether new SOPs follow format/content rules we specify in thesop-linter.py
script. When executed, its visual tag (❌ or ✔️ ) will quickly raise possible issues with the format of SOPs that are being added to the project.Types of changes
Motivation and Context
In order to add SOPs quickly to the repository, by multiple contributors, and still maintain some structure, these automatic workflows are required. With this addition, we will be able to raise possible issues at source, and keep harmony across SOPs.
References
ZenHub #268
Changes Introduced
scripts/sop-linter.py
to lint SOP documents.github/workflows/lint-sops.yml
to automatically trigger the linting scripttests/
requirements.txt
for running codeReview
Not yet
Additional Notes
Both the code and the workflow were tested in my fork of the GDI repository (see testing PR).
This is how it will look like when we add SOPs to the repo at
dev
ormain
through PRs:As the name implies, we should have it as a requirement to have the linter pass all checks (✔️ ) for an SOP to be added to the repo.
Checklist:
General Compliance:
Only applicable if the PR includes new, or changes to, GDI SOPs (i.e., documents at
sops/
):