python-gerrit-api | Python wrapper for the Gerrit REST API | REST library
kandi X-RAY | python-gerrit-api Summary
kandi X-RAY | python-gerrit-api Summary
Python wrapper for the Gerrit REST API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- List gerrit files
- Return a list of all keys
- Iterate over the keys in the cache
- Create parameters from tuples
- Perform a query
- Returns a GerritAccount object
- Delete a vote
- Delete the object from Gerrit
- Delete vote
- Delete the gist
- Get all draft revisions
- Get a list of GPG keys
- List all available caches
- List the groups
- Retrieve a list of gist members
- Return a list of changelog changes
- Get a list of all accounts
- Unmark this gist
- Remove an attachment from an attachment
- Returns a GerritChangeRevision object
- Decorator function to check arguments and return types
- Search gerritically
- Get webhooks
- Retrieve a list of genomes
- Return a list of gerrits
- Get the diff between old and old
python-gerrit-api Key Features
python-gerrit-api Examples and Code Snippets
Community Discussions
Trending Discussions on python-gerrit-api
QUESTION
URL for Documentation:
https://python-gerrit-api.readthedocs.io/en/latest/index.html
How to find the latest patch set no for a particular gerrit change using this package?
...ANSWER
Answered 2021-Mar-15 at 13:14Giving the literal "current" as Revision would suffice to get the latest patch no for a particular gerrit change. Need not use any function from this package.
QUESTION
Link to the documentation of package python-gerrit-api:
Code:
input_ = { "message": "New Commit message \n\nChange-Id: xxxxxxxxx\n" }
change = gerrit.changes.get('xxxxxxxxx')
result = change.set_commit_message(input_)
Error:
I get "gerrit.utils.exceptions.NotFoundError: 404 Client Error: Not Found" as error when I try to set a commit message using the above package.
...ANSWER
Answered 2021-Mar-03 at 12:37This is the same issue as you asked in your other question. If you have a child parent project it will try to access the project as parent/child instead of parent%2Fchild. This will result in error 404
For a fix see the pull request. See: https://github.com/shijl0925/python-gerrit-api/pull/5
An example of a parent and child relation is the code-owners plugin at gerrit. The plugin repository does not contain any code, it is more like a folder that contains sub repositories and these child repositories normally will inherit the access rights from the parent.
If you look at the below url you can see that the url uses %2F and not the forward slash. That is what is not working in the gerrit-python-api
https://gerrit-review.googlesource.com/q/project:plugins%252Fcode-owners+status:open
This example works for me with the above pull request
QUESTION
Link to the documentation of the package(Python-gerrit-api):
https://python-gerrit-api.readthedocs.io/en/latest/index.html
Can I set code review like this ssh query
("gerrit review --code-review +2 --verified +1 --submit")
with this package ?
...ANSWER
Answered 2021-Mar-03 at 09:58Set_review function of the Python-gerrit-api package can be used for adding labels like verified +1 and code-review +2.
Link for the above function:
QUESTION
Documentation: https://python-gerrit-api.readthedocs.io/en/latest/
Code
gerrit = GerritClient(base_url="https://gerrit.xx.com",username='xxx',password='xxx')
change = gerrit.changes.get("xxx")
ab=change.get_revision("32423")
print(ab.get_commit().list_change_files())
Question
For some endpoints, I am able to send get responses from the rest api but via this package I get this error(gerrit.utils.exceptions.NotFoundError: 404 Client Error). I am able to get response from Get Rest api for this url: gerrit.xx.xx.com/a/projects/xxxx/commits/xxxx/files via postman. But error with above code.
...ANSWER
Answered 2021-Feb-25 at 08:26Looks like this is a bug, I have fixed it and made a pull request. See: https://github.com/shijl0925/python-gerrit-api/pull/5
QUESTION
Documentation link:https://python-gerrit-api.readthedocs.io/en/latest/index.html
Code:
gerrit=GerritClient(base_url="https://gerrit.xx.xxx.com",username='xxx',password='xxx')
change = gerrit.changes.get("xxx")
Question
I get the GerritChange object(change) from the above code and how do I print status, branch, project, etc.. from this object?
...ANSWER
Answered 2021-Feb-17 at 07:19This is a simple test I just did. Looks like a nice api. Thanks, may use it myself.
See: https://python-gerrit-api.readthedocs.io/en/latest/_modules/gerrit/changes/change.html#GerritChange
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install python-gerrit-api
You can use python-gerrit-api like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page