-
Notifications
You must be signed in to change notification settings - Fork 106
feat: Extend parser to parse most of resources #262
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
Conversation
mshudrak
left a comment
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.
Overall looks good. I left two minor comments. By the way, when I test it and click on Detail button it does not show details. I do it on a full log that was created a while ago. Is it expected?
| 'Managed Zone', | ||
| 'SQL Instance', | ||
| 'Cloud Function', | ||
| 'Dns Policie', |
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.
Dns Policy or Policies
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.
Done
| case 'Compute Disk': | ||
| return ComputeDisk; | ||
| case 'Managed Zone': | ||
| return MangedZone; |
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.
ManagedZone
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.
Done
|
Yes because I didn't add the Details sections to this branch yet |
| }; | ||
| for (const [resourceType, resourceList] of Object.entries(projectData)) { | ||
| let type = titleCase(resourceType.slice(0, -1)); | ||
| if (type === 'Dns Policie') type = 'Dns Policy'; |
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.
oops, sorry. Forgot to flag this one. Dns Policies or Dns Policy
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.
To get the type of the resource, I use the name of it in the json file, then remove the last character to make it singular
This doesn't work in the naming of dns_policies so I handle it differently using this if statement
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.
Why do you need to remove the last character?
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.
Because I used the singular names of resources in the code
I can change that to use plural ones
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.
all good. merging it.
|
There is one small typo but other than good to merge. Fix it and I will merge it. |
* feat 🎉 :Intial commit for visualization tool * feat ✨ Adding gcp-scanner-visualizer command * style 🎨 Adding linting and formating * feat ➕ Add Flask to requirements * feat: Add Layout for Resources Page * feat: add intial TS types for resources * add errors handling * compress images and add them to src folder * add status color logic to utils file * feat: Add search through resources functionality (#252) * feat: add filtering with search * auto focus on search input and with ctrl + f * feat: Extend parser to parse most of resources (#262) * feat: add filtering with search * feat: add sort and search functionalities (#263) * chore: refactor ControlMenu component into smaller components * feat: add Details Drawer to resources cards * feat: Add Details Drawer to Resources Cards (#264) * feat: parse IAM policy roles * feat: add IAM roles list * feat: Add Searching in IAM roles using email (#274) * Add UI for projects filter component * filter resources using projects * filter roles using projects * use http.server module instead of flask * docs: Add visualization tool usage readme * Add visualization tool build files to git ignore * Include visualization tool files in the MANIFEST.in * Update INSTALL.md to include the build step for the visualization tool when building from source * Add a build step for the visualization tool in the python-publish workflow * add version to visualizer
Description
Change parser implementation to a more generic one that can parse most resources types
Additional Notes
The types supported by the tool are:
Compute InstanceCompute DiskCompute ImageMachine ImageCompute SnapshotManaged ZoneSQL InstanceCloud FunctionDns PoliciesPubsub SubThese types are defined in
availableResourceTypesinsrc/types/resources.tsOther types have special structures in the output file which we can handle later