Skip to content

Conversation

@sudiptob2
Copy link
Contributor

@sudiptob2 sudiptob2 commented May 28, 2023

closes #154

  • implemented the creation of ComputeClient using the factory
  • updated scanner.
  • updated unit tests related to compute resources.
  • added test for compute client factory.

@sudiptob2 sudiptob2 force-pushed the feat/154/compute-client-factory branch 2 times, most recently from 80ce944 to 8c877b9 Compare May 30, 2023 10:25
@sudiptob2 sudiptob2 force-pushed the feat/154/compute-client-factory branch from 8c877b9 to 15e1b21 Compare May 31, 2023 05:31
@sudiptob2 sudiptob2 marked this pull request as ready for review May 31, 2023 05:45
Copy link

@under-hill under-hill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting nits

'managed_zones': ['name', 'dnsName', 'description', 'nameServers'],
'sql_instances': ['name', 'region', 'ipAddresses', 'databaseVersion'
'state'],
'state'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'state' should be aligned with 'name' (as the first element) from the prior line I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, agreed. I formatted the code with pycharm formatted. Also, the pylint we are using for this project approved this. But the formatting is indeed inconsistent. I will manually fix these formatting errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@under-hill @mshudrak I think there is a bug in the code, a comma, is missing here before state. Thats why pycharm formatted it incorrectly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch - lets fix that

}

def is_set(config: Optional[dict], config_setting: str) -> Union[dict,bool]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason we're adding extra lines here? I'm not up-to-date on the latest style guides so I'm open to new opinions, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to pep8 guidelines, they suggest 2 blank lines. Ref: Pep8 docs, A StackOverflow ans

if is_set(scan_config, 'static_ips'):
project_result['static_ips'] = crawl.get_static_ips(project_id,
compute_client)
compute_service)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This formatting seems odd as many of the others in this file have the args separated into new lines and left-aligned. I'm not too particular on which format we use, but we should be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@sudiptob2
Copy link
Contributor Author

thanks, agreed. I formatted the code with pycharm formatted. Also, the pylint we are using for this project approved this. But the formatting is indeed inconsistent. I will manually fix these formatting errors.

@sudiptob2 sudiptob2 requested a review from under-hill May 31, 2023 17:05
@under-hill under-hill merged commit 90c4569 into google:main May 31, 2023
@sudiptob2 sudiptob2 deleted the feat/154/compute-client-factory branch May 31, 2023 17:31
@HasanZaigam
Copy link

i am interested to contribute this issue you can please assign me this

@mshudrak
Copy link
Contributor

We do not assign problem, feel free to just submit PR.

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.

Subtasks: Implement client factory for compute client.

4 participants