all-repos icon indicating copy to clipboard operation
all-repos copied to clipboard

gitlab source

Open asottile opened this issue 6 years ago • 9 comments

asottile avatar Oct 19 '18 00:10 asottile

im looking into getting a time allocation for doing this

RonnyPfannschmidt avatar Dec 03 '18 15:12 RonnyPfannschmidt

someone expressed interest in this on stream, I believe the api is https://docs.gitlab.com/ee/api/projects.html#list-user-projects

asottile avatar Aug 10 '20 22:08 asottile

atm #109 is stalled for personal reasons

RonnyPfannschmidt avatar Aug 11 '20 06:08 RonnyPfannschmidt

yep no problem -- don't feel obligated <3 real life always takes precedence!

asottile avatar Aug 11 '20 06:08 asottile

thanks, i don't feel obligated, but i do consider it my duty to at least inform of the state ^^

RonnyPfannschmidt avatar Aug 11 '20 06:08 RonnyPfannschmidt

Is this thread still updated? i was think if it's possible to clone from my company gitlab org site, however, it came up with error:

Traceback (most recent call last): File "~/envs/python3_venv/bin/all-repos-clone", line 8, in sys.exit(main()) File "~/envs/python3_venv/lib/python3.8/site-packages/all_repos/clone.py", line 106, in main config = load_config(args.config_filename) File "~/envs/python3_venv/lib/python3.8/site-packages/all_repos/config.py", line 55, in load_config source_module: Any = import(contents['source'], fromlist=['__trash']) ValueError: Empty module name

with below all-repos.json:

{ "output_dir": "output", "source": "", "source_settings": { "api_key": "encrypted_content", "username": "Chilvery", "org": "www.encrypted.com" } }

Ericwonne avatar Oct 24 '22 12:10 Ericwonne

the part i needed was fixed (with the gitlab org source)

RonnyPfannschmidt avatar Oct 24 '22 13:10 RonnyPfannschmidt

I'm getting a 403 Forbidden error code when running the all-repos sed command against an internal gitlab org. It creates the branch and pushes the changes, but doesn't seem to have permissions to create the merge request. Just wondering if this is known, or if I might have something misconfigured?

Traceback (most recent call last):
  File "/Users/bfalk/.local/pipx/venvs/all-repos/lib/python3.10/site-packages/all_repos/autofix_lib.py", line 165, in repo_context
    yield
  File "/Users/bfalk/.local/pipx/venvs/all-repos/lib/python3.10/site-packages/all_repos/autofix_lib.py", line 258, in _fix_inner
    config.push(config.push_settings, branch_name)
  File "/Users/bfalk/.local/pipx/venvs/all-repos/lib/python3.10/site-packages/all_repos/push/gitlab_pull_request.py", line 58, in push
    resp = gitlab_api.req(
  File "/Users/bfalk/.local/pipx/venvs/all-repos/lib/python3.10/site-packages/all_repos/gitlab_api.py", line 31, in req
    resp = urllib.request.urlopen(urllib.request.Request(url, **kwargs))
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

falkben avatar Mar 02 '23 22:03 falkben

I figured out the source of my error. I needed the api scope in order to open Merge Requests in a group namespace that I belong to. The scope description indicates this:

Grants complete read/write access to the API, including all groups and projects, the container registry, and the package registry.

It's a bit unfortunate the scopes aren't a bit more fine grained. It might be worth mentioning on the readme? If you agree, I can open a PR.

falkben avatar Mar 07 '23 03:03 falkben