Skip to content

Commit 522ecff

Browse files
nejchJohnVillalovos
authored andcommitted
docs(projects): document 404 gotcha with unactivated integrations
1 parent 194b6be commit 522ecff

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

docs/gl_objects/projects.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,23 @@ Reference
628628
Examples
629629
---------
630630

631-
Get a service::
631+
.. danger::
632+
633+
Since GitLab 13.12, ``get()`` calls to project services return a
634+
``404 Not Found`` response until they have been activated the first time.
635+
636+
To avoid this, we recommend using `lazy=True` to prevent making
637+
the initial call when activating new services unless they have
638+
previously already been activated.
639+
640+
Configure and enable a service for the first time::
641+
642+
service = project.services.get('asana', lazy=True)
643+
644+
service.api_key = 'randomkey'
645+
service.save()
646+
647+
Get an existing service::
632648

633649
service = project.services.get('asana')
634650
# display its status (enabled/disabled)
@@ -642,11 +658,6 @@ List the code names of available services (doesn't return objects)::
642658

643659
services = project.services.available()
644660

645-
Configure and enable a service::
646-
647-
service.api_key = 'randomkey'
648-
service.save()
649-
650661
Disable a service::
651662

652663
service.delete()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy