Gitlab API module - Vidhya Hariharan

module-name: "GitLab API"
area: "Product Knowledge"
gitlab-group: "Create:Ecosystem"
maintainers:
  - TBD

Overview

Goal: Set a clear path for GitLab API training

Tackle stage 1 first and the last stage last, but the others can be completed in any order you prefer.

Stage 0: Create and commit to the module

  1. Create an issue using this template by making the Issue Title: GitLab API -
  2. Add yourself and your trainer as the assignees.
  3. Notify your manager to let them know you've started.
  4. Commit to this by notifying the current experts that they can start routing non-technical API questions to you.
  5. Optional: Set a milestone, if applicable, and a due date to help motivate yourself!

Stage 1: Commit and Become familiar with what GitLab API is

  • Done with Stage 1
  1. Read the GitLab API Overview
  2. Find answers to and understand the following questions:
    1. How are the API routes handled differently from the Rails routes?
    2. What does it mean to Grapify the API?
    3. Where in the code do I look to find which attributes are exposed for an API route (e.g. users)?

Stage 2: Using the GitLab API

  • Done with Stage 2

Remember to contribute to any documentation that needs updating.

  1. Read documentation for 5 different APIs, e.g. for projects, branches, etc. Paste the links here.

    1. https://docs.gitlab.com/ee/api/projects.html#list-user-projects
    2. https://docs.gitlab.com/ee/api/projects.html#list-forks-of-a-project
    3. https://docs.gitlab.com/ee/api/keys.html#get-user-by-fingerprint-of-ssh-key
    4. https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline
    5. https://docs.gitlab.com/ee/api/saml.html#update-extern_uid-field-for-a-saml-identity
  2. Call the API using all the different authentication methods available

    1. OAuth 2 Tokens
    2. Personal/project/group Access Tokens
    3. Session Cookie
  3. Take a look at GitLab's GraphQL explorer. Using the docs (in left sidebar), build the following queries:

    1. List projects for a specific group (such as gitlab-com/support).
    2. List pipelines for a specific project (choose one from the previous query that has more than 100 pipelines).
    3. List the 2nd set of pipelines (since the previous query will be cut off at the first 100).
    4. Take a look at ticket #134208 to check your answers.

Stage 3: Tickets

  • Done with Stage 3
  1. Look for 10 old API tickets and read through them to understand what the issues were and how they were addressed. Paste the links here.
    1. https://gitlab.zendesk.com/agent/tickets/368267
    2. https://gitlab.zendesk.com/agent/tickets/375194
    3. https://gitlab.zendesk.com/agent/tickets/372948
    4. https://gitlab.zendesk.com/agent/tickets/369879
    5. https://gitlab.zendesk.com/agent/tickets/264945
    6. https://gitlab.zendesk.com/agent/tickets/281834
    7. https://gitlab.zendesk.com/agent/tickets/96620
    8. https://gitlab.zendesk.com/agent/tickets/350891
    9. https://gitlab.zendesk.com/agent/tickets/371559
    10. https://gitlab.zendesk.com/agent/tickets/311996
  2. Look for 5 API related issues in the gitlab-org/gitlab issue tracker and paste the links here.
    1. REST API does not include "Require associated issue in Jira" field, despite it being available in the UI
    2. Add new Export API to view/download relation batches
    3. Enable ci_instance_level_variables to be configured via API
    4. User search API not returning existing user
    5. Add a new SeatReconciliationEnabled Graphql endpoint
  3. Answer 5 API tickets and paste the links here. Do this even if a ticket seems too advanced for you to answer. Find the answers from an expert and relay them to the customers.
    1. https://gitlab.zendesk.com/agent/tickets/262199
    2. https://gitlab.zendesk.com/agent/tickets/368267
    3. https://gitlab.zendesk.com/agent/tickets/254906
    4. https://gitlab.zendesk.com/agent/tickets/374629
    5. https://gitlab.zendesk.com/agent/tickets/269565

Stage 4: Pair on Customer Calls (Optional)

  • Done with Stage 4
  1. Pair on two diagnostic calls, where a customer is having trouble with GitLab API.
    1. call with ___
    2. call with ___

Stage 5: GitLab API Project

  • Done with Stage 5
  1. Develop a small GitLab API integration / automation using two or more APIs of your choice, or make an improvement to an existing project. Link the project or MR.
    • Link: ___

Penultimate Stage: Review

You feel that you can now do all of the objectives:

  • Familiar with API
  • Know where to look in the code
  • Make use of the API
  • Can troubleshoot API questions

Any updates or improvements needed? If there are any dead links, out of date or inaccurate content, missing content whether in this module or in other documentation, list it below as tasks for yourself! Once ready, have a maintainer or manager review.

  • Update ...

Final Stage

  1. Have your trainer review your tickets and assessment. If you do not have a trainer, ask an expert to review.
  2. Manager: schedule a call (or integrate into 1:1) to review how the module went.
  3. Submit a MR to update modules and knowledge_areas in the Support Team yaml file with this training module's topic. You will now be listed as an expert in GitLab API topic on Skills by Person page.
Edited by Vidhya Hariharan