Skip to content

Module 1 - Repo Information - #21

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

Module 1 - Repo Information#21
jacobeicher wants to merge 1 commit into
ohioit:developmentfrom
senior-design-21-22:module-1

Conversation

@jacobeicher

@jacobeicher jacobeicher commented Mar 28, 2022

Copy link
Copy Markdown

#1

Comment thread .github/workflows/ansible-test.yml Outdated
run: pip install ansible==5.5

- name: Install PyGithub
run: pip install PyGithub

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Install a specific version of PyGithub

@Khounborinn Khounborinn Apr 1, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This has been updated to install PyGithub version 1.55

Comment thread README.md Outdated
### Collaborator Information

```
- name: "Functions of Collaborator information module"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functions of Collaborator information module -> List the collaborators of a 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.

This example description has been updated.

Comment thread README.md Outdated
```
### Webhook
```
- name: "Add/Modify webhook to GitHub repository MOD 3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Add/Modify webhook to GitHub repository MOD 3 - Manage webhooks of a GitHub 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.

This example description has been updated.

Comment thread README.md Outdated
### Branch Protection

```
- name: "Modify branch protections to a branch"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Modify branch protections to a branch -> Manage the branch protections rules of a branch

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This example description has been updated.

Comment thread README.md Outdated
### General Repository

```
- name: "Create repository within enterprise organization"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Create repository within enterprise organization -> Manage a repository within an enterprise organization

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This example description has been updated.

Comment thread galaxy.yml Outdated
readme: README.md
authors:
- Robert Foreman <foremar1@ohio.edu>
- Bradley Golski <bg881717@ohio.edu>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

List all of your names.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This has been updated, so now all of our member names are included with emails.


from ansible.module_utils.basic import AnsibleModule
from github import Github
__metaclass__ = type

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this needed?

Comment thread tests/unit/modules/utils.py Outdated
@@ -0,0 +1,46 @@
import json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I could not find where the code in this file was used. Where is it used?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

My mistake, I had originally had a test function in there that returned a json formatted output, but it was removed in the final version of the file. The import has been removed.

@@ -0,0 +1,342 @@
from __future__ import (absolute_import, division, print_function)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

General comment about this tests:

Where does the test code call the code in plugins/modules/repository_information.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Khounborinn Please address this issue.

@Khounborinn Khounborinn Apr 1, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Future and meta class are for legacy versions of Python. It's for earlier Python versions to work with newer versions of code. Typically it's for people using Python 2 that want to use some functionality of Python 3 versions.

Comment on lines +11 to +128
def set_module_args(args):
if '_ansible_remote_tmp' not in args:
args['_ansible_remote_tmp'] = '/tmp'
if '_ansible_keep_remote_files' not in args:
args['_ansible_keep_remote_files'] = False

args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(args)


class AnsibleExitJson(Exception):
pass


class AnsibleFailJson(Exception):
pass


def exit_json(*args, **kwargs):
if 'changed' not in kwargs:
kwargs['changed'] = False
raise AnsibleExitJson(kwargs)


def fail_json(*args, **kwargs):
kwargs['failed'] = True
raise AnsibleFailJson(kwargs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should these have been imported from the utils.py folder?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Whenever ansible-test units --python 3.9 --venv is run on my machine, Ansible does not recognize functions from other files/directories, only those from Ansible libraries or libraries found in the standard library. I included the functions in a separate file in case the user would like to have the functions separately.

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.

4 participants