Skip to content

Commit b6cc3f2

Browse files
Liora Milbaumnejch
Liora Milbaum
authored andcommitted
docs(api): describe the list() and all() runners' functions
1 parent fdd4114 commit b6cc3f2

File tree

6 files changed

+28
-18
lines changed

6 files changed

+28
-18
lines changed

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ repos:
3838
- types-PyYAML==6.0.12
3939
- types-requests==2.28.11
4040
- types-setuptools==64.0.1
41+
- repo: https://github.com/pre-commit/pygrep-hooks
42+
rev: v1.9.0
43+
hooks:
44+
- id: rst-backticks
45+
- id: rst-directive-colons
46+
- id: rst-inline-touching-normal

CONTRIBUTING.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ To run these tests:
9393
9494
When developing tests it can be a little frustrating to wait for GitLab to spin
9595
up every run. To prevent the containers from being cleaned up afterwards, pass
96-
`--keep-containers` to pytest, i.e.:
96+
``--keep-containers`` to pytest, i.e.:
9797

9898
.. code-block:: bash
9999
@@ -116,7 +116,7 @@ The tag must match an exact tag on Docker Hub:
116116

117117
.. code-block:: bash
118118
119-
# run tests against `nightly` or specific tag
119+
# run tests against ``nightly`` or specific tag
120120
GITLAB_TAG=nightly tox -e api_func_v4
121121
GITLAB_TAG=12.8.0-ce.0 tox -e api_func_v4
122122

docs/api-usage-advanced.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ https://requests.readthedocs.io/en/latest/user/advanced/#proxies
5353
SSL certificate verification
5454
----------------------------
5555

56-
python-gitlab relies on the CA certificate bundle in the `certifi` package
56+
python-gitlab relies on the CA certificate bundle in the ``certifi`` package
5757
that comes with the requests library.
5858

5959
If you need python-gitlab to use your system CA store instead, you can provide
60-
the path to the CA bundle in the `REQUESTS_CA_BUNDLE` environment variable.
60+
the path to the CA bundle in the ``REQUESTS_CA_BUNDLE`` environment variable.
6161

6262
Reference:
6363
https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification
@@ -124,7 +124,7 @@ python-gitlab can automatically retry in such case, when
124124
``retry_transient_errors`` argument is set to ``True``. When enabled,
125125
HTTP error codes 500 (Internal Server Error), 502 (502 Bad Gateway),
126126
503 (Service Unavailable), and 504 (Gateway Timeout) are retried. It will retry until reaching
127-
the `max_retries` value. By default, `retry_transient_errors` is set to `False` and an exception
127+
the ``max_retries`` value. By default, ``retry_transient_errors`` is set to ``False`` and an exception
128128
is raised for these errors.
129129

130130
.. code-block:: python

docs/api-usage.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ You can print a Gitlab Object. For example:
200200
# Or in a prettier format.
201201
project.pprint()
202202
203-
# Or explicitly via `pformat()`. This is equivalent to the above.
203+
# Or explicitly via ``pformat()``. This is equivalent to the above.
204204
print(project.pformat())
205205
206206
You can also extend the object if the parameter isn't explicitly listed. For example,
@@ -217,16 +217,16 @@ the value on the object is accepted:
217217
You can get a dictionary representation copy of the Gitlab Object. Modifications made to
218218
the dictionary will have no impact on the GitLab Object.
219219

220-
* `asdict()` method. Returns a dictionary representation of the Gitlab object.
221-
* `attributes` property. Returns a dictionary representation of the Gitlab
220+
* ``asdict()`` method. Returns a dictionary representation of the Gitlab object.
221+
* ``attributes`` property. Returns a dictionary representation of the Gitlab
222222
object. Also returns any relevant parent object attributes.
223223

224224
.. note::
225225

226-
`attributes` returns the parent object attributes that are defined in
227-
`object._from_parent_attrs`. What this can mean is that for example a `ProjectIssue`
228-
object will have a `project_id` key in the dictionary returned from `attributes` but
229-
`asdict()` will not.
226+
``attributes`` returns the parent object attributes that are defined in
227+
``object._from_parent_attrs``. What this can mean is that for example a ``ProjectIssue``
228+
object will have a ``project_id`` key in the dictionary returned from ``attributes`` but
229+
``asdict()`` will not.
230230

231231

232232
.. code-block:: python
@@ -244,7 +244,7 @@ You can get a JSON string represenation of the Gitlab Object. For example:
244244
245245
project = gl.projects.get(1)
246246
print(project.to_json())
247-
# Use arguments supported by `json.dump()`
247+
# Use arguments supported by ``json.dump()``
248248
print(project.to_json(sort_keys=True, indent=4))
249249
250250
Base types

docs/cli-usage.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Example for a `pass <https://www.passwordstore.org>`_ helper with a wrapper scri
219219
private_token = helper: /path/to/helper.sh
220220
timeout = 1
221221
222-
In `/path/to/helper.sh`:
222+
In ``/path/to/helper.sh``:
223223

224224
.. code-block:: bash
225225
@@ -332,7 +332,7 @@ tcsh
332332

333333
.. code-block:: console
334334
335-
eval `register-python-argcomplete --shell tcsh gitlab`
335+
eval ``register-python-argcomplete --shell tcsh gitlab``
336336
337337
fish
338338
----

docs/gl_objects/runners.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,20 @@ Reference
2828
Examples
2929
--------
3030

31-
Use the ``list()`` and ``all()`` methods to list runners.
31+
Use the ``runners.list()`` and ``runners_all.list()`` methods to list runners.
32+
``runners.list()`` - Get a list of specific runners available to the user
33+
``runners_all.list()`` - Get a list of all runners in the GitLab instance
34+
(specific and shared). Access is restricted to users with administrator access.
35+
3236

3337
Both methods accept a ``scope`` parameter to filter the list. Allowed values
3438
for this parameter are:
3539

3640
* ``active``
3741
* ``paused``
3842
* ``online``
39-
* ``specific`` (``all()`` only)
40-
* ``shared`` (``all()`` only)
43+
* ``specific`` (``runners_all.list()`` only)
44+
* ``shared`` (``runners_all.list()`` only)
4145

4246
.. note::
4347

0 commit comments

Comments
 (0)