Skip to content
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

add -p / --project to add a github project #11

Open
Miou-zora opened this issue Mar 8, 2023 · 1 comment
Open

add -p / --project to add a github project #11

Miou-zora opened this issue Mar 8, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Miou-zora
Copy link
Owner

Miou-zora commented Mar 8, 2023

Add -p / --project flag to create automatically a github project and link it to the mirror like this:

./main.py -p project_name

or

./main.py --project=project_name
@Miou-zora Miou-zora added enhancement New feature or request good first issue Good for newcomers labels Mar 8, 2023
@Miou-zora Miou-zora changed the title feature: add -p / --github-project to add a github project add -p / --github-project to add a github project Mar 16, 2023
@Miou-zora Miou-zora self-assigned this Jul 10, 2023
@Miou-zora Miou-zora changed the title add -p / --github-project to add a github project add -p / --project to add a github project Jul 10, 2023
@Miou-zora
Copy link
Owner Author

Miou-zora commented Jul 10, 2023

Currently pygithub is unable to create github project from repository or user, when I try to do these, I got this:
for user:

Traceback (most recent call last):
  File "/home/miouzora/Replic/main.py", line 91, in <module>
    main()
  File "/home/miouzora/Replic/main.py", line 82, in main
    generate_mirror(sshParser.organizationName, sshParser.repositoryName, github, mirror_name, args.project)
  File "/home/miouzora/Replic/src/generate_mirror.py", line 42, in generate_mirror
    user.create_project(project)
  File "/home/miouzora/Replic/src/Github/User.py", line 58, in create_project
    return self.user.create_project(name, body=body)
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/AuthenticatedUser.py", line 610, in create_project
    headers, data = self._requester.requestJsonAndCheck(
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Requester.py", line 401, in requestJsonAndCheck
    *self.requestJson(
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Requester.py", line 501, in requestJson
    return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Requester.py", line 571, in __requestEncode
    requestHeaders["Content-Type"], encoded_input = encode(input)
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Requester.py", line 499, in encode
    return "application/json", json.dumps(input)
  File "/usr/lib/python3.10/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type _NotSetType is not JSON serializable

for repository:

Traceback (most recent call last):
  File "/home/miouzora/Replic/main.py", line 91, in <module>
    main()
  File "/home/miouzora/Replic/main.py", line 82, in main
    generate_mirror(sshParser.organizationName, sshParser.repositoryName, github, mirror_name, args.project)
  File "/home/miouzora/Replic/src/generate_mirror.py", line 42, in generate_mirror
    mirror.create_project(project)
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Repository.py", line 1382, in create_project
    headers, data = self._requester.requestJsonAndCheck(
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Requester.py", line 400, in requestJsonAndCheck
    return self.__check(
  File "/home/miouzora/.local/lib/python3.10/site-packages/github/Requester.py", line 425, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 410 {"message": "Projects are disabled for this repository", "documentation_url": "https://docs.github.com/v3/projects"}

Please look at this issue from pygithub that talk about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant