-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Create a slash PR bot to run our ./build.sh
command
#2353
Conversation
I’ll add the change log later this afternoon, my time. I’m running late The checkov didn’t like the workflow_dispatch input arguments. |
I could’ve force pushed to clean everything, (the only way to test was to make pushes). What’s fun with using workflow_dispatch type is that we can even test changes to a command that is in the PR (once the dispatcher and an empty one with the same name exists in the default branch). That way, I didn’t have to commit to main each time I wanted to test. The commands will only work for people with write access to the repo (it can be one of the 5 levels of permissions). It is configured in the slash command dispatcher. |
More commands can be added by adding the name to the slash command dispatcher, and having a new workflow file called the same, but with |
With cache on Python dependencies, running the /build command runs in about 1 min 30 s. The eyes reaction is added when the command dispatcher processed the command comment. The rocket reaction is added when the command is launched, and the hurray reaction is added when command is completed (inside the command) |
Oh, and the comment is edited during the run to show progress :) |
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ BASH | bash-exec | 6 | 0 | 0.02s | |
✅ BASH | shellcheck | 6 | 0 | 0.13s | |
✅ BASH | shfmt | 6 | 0 | 0 | 0.04s |
✅ COPYPASTE | jscpd | yes | no | 2.88s | |
✅ DOCKERFILE | hadolint | 114 | 0 | 13.47s | |
✅ JSON | eslint-plugin-jsonc | 21 | 0 | 0 | 1.81s |
✅ JSON | jsonlint | 19 | 0 | 0.22s | |
✅ JSON | npm-package-json-lint | yes | no | 0.68s | |
✅ JSON | v8r | 21 | 0 | 11.92s | |
markdownlint | 309 | 2 | 230 | 5.45s | |
✅ MARKDOWN | markdown-link-check | 309 | 0 | 5.48s | |
✅ MARKDOWN | markdown-table-formatter | 309 | 2 | 0 | 15.0s |
✅ OPENAPI | spectral | 1 | 0 | 1.7s | |
bandit | 183 | 47 | 2.05s | ||
✅ PYTHON | black | 183 | 0 | 0 | 3.53s |
✅ PYTHON | flake8 | 183 | 0 | 1.8s | |
✅ PYTHON | isort | 183 | 0 | 0 | 0.42s |
✅ PYTHON | mypy | 183 | 0 | 6.89s | |
✅ PYTHON | pylint | 183 | 0 | 10.94s | |
pyright | 183 | 244 | 17.47s | ||
✅ REPOSITORY | checkov | yes | no | 28.18s | |
devskim | yes | 61 | 1.29s | ||
✅ REPOSITORY | dustilock | yes | no | 2.45s | |
✅ REPOSITORY | git_diff | yes | no | 0.05s | |
✅ REPOSITORY | secretlint | yes | no | 7.88s | |
✅ REPOSITORY | syft | yes | no | 0.88s | |
✅ REPOSITORY | trivy | yes | no | 21.18s | |
✅ SPELL | cspell | 745 | 0 | 16.93s | |
✅ SPELL | misspell | 566 | 2 | 0 | 0.56s |
✅ XML | xmllint | 3 | 0 | 0 | 0.03s |
✅ YAML | prettier | 81 | 2 | 0 | 2.34s |
✅ YAML | v8r | 23 | 0 | 58.4s | |
✅ YAML | yamllint | 82 | 0 | 1.25s |
See detailed report in MegaLinter reports
You could have same capabilities but better runtime performances if you request a new MegaLinter flavor.
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ BASH | bash-exec | 6 | 0 | 0.02s | |
✅ BASH | shellcheck | 6 | 0 | 0.13s | |
✅ BASH | shfmt | 6 | 0 | 0 | 0.36s |
✅ COPYPASTE | jscpd | yes | no | 2.75s | |
✅ DOCKERFILE | hadolint | 114 | 0 | 16.56s | |
✅ JSON | eslint-plugin-jsonc | 21 | 0 | 0 | 2.11s |
✅ JSON | jsonlint | 19 | 0 | 0.24s | |
✅ JSON | v8r | 21 | 0 | 12.21s | |
markdownlint | 309 | 0 | 230 | 6.59s | |
✅ MARKDOWN | markdown-link-check | 309 | 0 | 5.57s | |
✅ MARKDOWN | markdown-table-formatter | 309 | 0 | 0 | 17.62s |
✅ OPENAPI | spectral | 1 | 0 | 1.63s | |
bandit | 183 | 47 | 1.99s | ||
✅ PYTHON | black | 183 | 0 | 0 | 3.62s |
✅ PYTHON | flake8 | 183 | 0 | 1.75s | |
✅ PYTHON | isort | 183 | 0 | 0 | 0.73s |
✅ PYTHON | mypy | 183 | 0 | 6.89s | |
✅ PYTHON | pylint | 183 | 0 | 11.58s | |
pyright | 183 | 246 | 17.44s | ||
✅ REPOSITORY | checkov | yes | no | 29.15s | |
✅ REPOSITORY | git_diff | yes | no | 0.35s | |
✅ REPOSITORY | secretlint | yes | no | 14.14s | |
✅ REPOSITORY | trivy | yes | no | 27.22s | |
✅ SPELL | cspell | 745 | 0 | 19.81s | |
✅ SPELL | misspell | 566 | 0 | 0 | 0.93s |
✅ XML | xmllint | 3 | 0 | 0 | 0.36s |
✅ YAML | prettier | 81 | 2 | 0 | 3.43s |
✅ YAML | v8r | 23 | 0 | 58.0s | |
✅ YAML | yamllint | 82 | 0 | 1.09s |
See detailed report in MegaLinter reports
So I added a skip comment for CKV_GHA_7, Since it is not really a build, where we wouldn't want the output to change, here we want it to react to what the slash command dispatcher sends it, to know which comment to target, and to make sure the correct repo is called. Also, it is only users with write permissions that can call a workflow run. |
I'm not sure I understand everything... plz could you add a section in contributing documentation, with examples ? |
Ok, I'll write something soon. But it's for us, maintainers only, so that we could not require contributors to set up everything to run the ./build.sh. Only ask them to change the descriptors, and a quick comment to the PR with the following:
will bring the PR up to date. |
@nvuillam Is this enough? |
@nvuillam Is this enough to be merged? I'm quite eager to start using it soon :) |
Just add a screenshot of a comment with the |
For now there are 3 code blocks with the exact contents of what is placed.
(Note that there is the "text" language in the top of the fence blocks added since these two screenshots) To have a real use screenshot, it would have to either be already merged, or I re-setup a new repo with it merged into main. I tested in the beginning by committing to my branch and also main, and once sure that it works, I used the |
Ok, you can add a screenshot in a next PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great , can't wait to see it in action :)
We'll be able to let users use the built-in web editor (pressing the period ( |
/help
|
1 similar comment
/help
|
Yes and no, yes, since there are already running jobs so the 20 is supposed to be hit https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits But its nothing like in the repos inside OSGeo, on good days (with a lot of contributions, across GDAL, PROJ (popular libraries in GIS), and grass), every 20 minute job has to wait 2h30 to start. |
Here we go, the 2s+4s jobs ran :) |
Fixes #2351
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance