google / gcp_scanner

A comprehensive scanner for Google Cloud
Apache License 2.0
311 stars 97 forks source link

Update crawl.py and scanner.py - Class Implementation #105

Closed RahulDubey391 closed 1 year ago

RahulDubey391 commented 1 year ago

Refactored crawl.py to have multiple classes separated by service type into separate files. Updated scanner.py to use crawler Classes.

Description

Refactoring applied to separate crawlers into separate classes based on Service-type in crawl.py. Each class is put into its own module and imported into a Composition Class in crawl.py. Further Composition Crawler Class is used in scanner.py

Changes Made

Checklist

Related Issues

This update solves the issue #2 partially.

Additional Notes

Extensive testing is required to check classes and method implementations

Feel free to modify and customize this template as needed to fit the specific needs of the GCP Scanner project.

mshudrak commented 1 year ago

Hi Rahul, all tests are failing. Have you tested the new code? I would also recommend to first submit a proposal on what/how you want to refactor, what benefit it provides to us and discuss it on the corresponding issue. Perhaps, create a proposal.

RahulDubey391 commented 1 year ago

Hi Rahul, all tests are failing. Have you tested the new code? I would also recommend to first submit a proposal on what/how you want to refactor, what benefit it provides to us and discuss it on the corresponding issue. Perhaps, create a proposal.

Hi @mshudrak , These tests are failing because in unit test file, the changes are not made to consider the class implementation. But you are correct, I'll put this as a proposal for the final application, also I'll include Parallelization proposal in the same proposal. Meanwhile, I'll try to see if I can update the unit tests as well.

I'll keep this PR in queue so that I can mention the code structure in proposal application. Thanks for the guidance!!!

RahulDubey391 commented 1 year ago

@mshudrak Hi, I have a question regarding the proposal. For this refactoring PR do I have to include code as well in Proposal? If so should I prepare the proposal as Doc file or .Md file?

mshudrak commented 1 year ago

Nah, just provide a link/links to PRs you made. We accept proposals in any format you like.

RahulDubey391 commented 1 year ago

Nah, just provide a link/links to PRs you made. We accept proposals in any format you like.

Thanks!!! I'll mention this PR in the proposal. Good day @mshudrak

mshudrak commented 1 year ago

I am archiving this one. Noted on the application.