nejch on main
fix(api): delete invalid 'proje… (compare)
.gitlab-ci.yml file and then parse it.
import gitlab
gl = gitlab.Gitlab()
owned=True parameter?
https://gitlab.com Secure connection.
owned=True
project.forks.create I get an AttributeError saying forks is not present. And indeed when I dir() the project object, there is no forks attribute. The rest of the attributes for a project seem to be there, including forks_count, so I'm not sure where I've gone wrong. Any suggestions on how to proceed would be welcome
project.forking_access_level says it is enabled
list.
Note
Fetching a list of projects, doesn’t include all attributes of all projects. To retrieve all attributes, you’ll need to fetch a single project
I'm experiencing a strange behavior where I'm executing gitlab within a container's shell, it appears to do the operation and then crashes...
➜ (host shell) $ docker-compose exec service bash
root@c5a79ce8a14d:/code# gitlab -c ${PYTHON_GITLAB_CFG} project list
[{"id": 1, "description": "This project is automatically generated ...",
...
"permissions": {"project_access": null, "group_access": {"access_level": 50, "notification_level": 3}}}]
➜ (host shell) $Any thoughts on what might be happening here?
Hi, all :wave:
Beginner question. I'm not clear as to how to update an existing snippet. This is what I have so far. It succeeds (I see no errors), but the snippet in question is not updated (almost like a no-op). Is this not issuing a PUT call?
gl_project = gl_client.projects.get("my_group/my_project", retry_transient_errors=True)
gl_snippet = gl_project.snippets.get(1234, retry_transient_errors=True)
new_snippet_json_text = json.dumps(new_snippet_json)
gl_snippet.code = new_snippet_json_text
gl_snippet.save(title=gl_snippet.title,
description=gl_snippet.description, file_name=gl_snippet.file_name,
visibility=gl_snippet.visibility,
retry_transient_errors=True)
files, instead of code. This worked! gl_snippet.files = [
{
"action": "update",
"file_path": gl_snippet.files[0]["path"],
"content": new_snippet_json_text
}
]
gl_snippet.save(visibility=gl_snippet.visibility, retry_transient_errors=True)