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

Secret Scanning and Dependabot alerts support along with a project restruct #70

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

theztefan
Copy link
Collaborator

👋 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 the models folder and import it in the app.py.

The logic from process.py, new required logic and all calls to the GitHub API have been move to ghasreview/client.py. This change makes the app.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 using gunicorn, I removed the wsgi.py and moved the logic to handle both gunicorn and werkzeug (pipenv run main) to the ghasreview/app.py. This change imo make the project more straightforward and easier to understand. This consequently meant that I can also update the Dockerfile and use the pipenv 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! 🚀

@theztefan theztefan requested a review from GeekMasher as a code owner August 8, 2024 13:36
Dockerfile Outdated Show resolved Hide resolved
@GeekMasher GeekMasher self-requested a review August 9, 2024 19:50
@GeekMasher GeekMasher merged commit db44608 into advanced-security:main Aug 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants