Secret Scanning and Dependabot alerts support along with a project restruct #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👋 Hey @GeekMasher! Amazing work on the project!
The most important changes in this PR are the addition of secret scanning and dependabot events support which addresses practically addresses #7 and #6. These changes add two new webhook events handlers in the
ghasreview/app.py
. The events that we handle are:secret_scanning_alert.resolved
dependabot_alert.dismissed
Besides that, I also restructured the project to make it, imo, simplified and easier to maintain. I've extracted the events payloads into separate classes located in the new
ghasreview/models
folder (read, package). This restructuring will make it easier to add new events in the future, as we can just create a new Class in themodels
folder and import it in theapp.py
.The logic from
process.py
, new required logic and all calls to the GitHub API have been move toghasreview/client.py
. This change makes theapp.py
more readable and focused on handling the events and we now will have one place to manage all the GitHub API calls.I've also moved the configuration parsing the configuration options logic into a separate file -
setup.py
. It supports as originally, both, environment variables (default) and cli arguments.Given the
Pipfile
was usinggunicorn
, I removed thewsgi.py
and moved the logic to handle bothgunicorn
andwerkzeug
(pipenv run main
) to theghasreview/app.py
. This change imo make the project more straightforward and easier to understand. This consequently meant that I can also update theDockerfile
and use thepipenv run production
script to start the app in the container.I've also updated the documentation in the
README.md
to all this changes reflect these changes.I hope you like the changes! It is a relatively big PR, so let me know if you need any more information and explanation! 🚀