Skip to content

module 2 - collaborator information - #23

Open
jacobeicher wants to merge 1 commit into
ohioit:developmentfrom
senior-design-21-22:module-2
Open

module 2 - collaborator information#23
jacobeicher wants to merge 1 commit into
ohioit:developmentfrom
senior-design-21-22:module-2

Conversation

@jacobeicher

@jacobeicher jacobeicher commented Mar 31, 2022

Copy link
Copy Markdown

#2

options:
access_token:
description:
- GitHub API token used to retrieve information about collaborators in repositories a user has access.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'a user has access.' -> 'to which a user has access'

Comment on lines +55 to +64
organization:
description:
- The organization whose repository's collaborators will be modified.
required: true
type: str

repository:
description:
- The repository whose collaborators will be managed.
required: true
type: str

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use consistent language. Pick either 'will be managed' or 'will be modified'

Comment on lines +55 to +64
organization:
description:
- The organization whose repository's collaborators will be modified.
required: true
type: str

repository:
description:
- The repository whose collaborators will be managed.
required: true
type: str

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use consistent language. Pick either 'will be managed' or 'will be modified'

collaborators['<ORG NAME>/<REPO NAME>'].<INDEX>:
description: This index provides access to a dictionary containing information about a single collaborator.
type: dict
returned: if at least one collaborator is within repository

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'within repository' -> 'contained within repository'

collaborators['<ORG NAME>/<REPO NAME>'].<INDEX>:
description: This index provides access to a dictionary containing information about a single collaborator.
type: dict
returned: if at least one collaborator is within repository

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'within repository' -> 'contained within repository'

Comment on lines +259 to +264
# changing
for current_collaborator in output_collaborators:
if collaborator == current_collaborator['login']:
current_collaborator['permissions'] = permissions
if permission == 'admin':
current_collaborator['site_admin'] = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can the collaborator_position be used here like it is in the absent_collaborator_check_mode? I'm trying to understand why it was necessary to iterate over output_collaborators?

output = []

if module.params['state'] == 'present':
if len(module.params['collaborator']) and len(module.params['repository']) and module.params['permission'].lower() in valid_permissions:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check that the inputs are valid before doing any other work.

output = []

if module.params['state'] == 'present':
if len(module.params['collaborator']) and len(module.params['repository']) and module.params['permission'].lower() in valid_permissions:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check that the inputs are valid before doing any other work.

else:
output = absent_collaborator_check_mode(
g, module.params['repository'], module.params['collaborator'], current_collaborators)
elif module.params['state'] not in ["absent", "present"]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Validate input parameters before doing any other work.

else:
output = absent_collaborator_check_mode(
g, module.params['repository'], module.params['collaborator'], current_collaborators)
elif module.params['state'] not in ["absent", "present"]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Validate input parameters before doing any other work.

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