### Get started page format Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/documentation/topic_types/get_started.md This markdown structure outlines the recommended format for a Get started page, including title, introduction, workflow diagram, steps, and external links. ```markdown title: Get started with abc --- These features work together in this way. You can use them to achieve these goals. Include a paragraph that ties together the features without describing what each individual feature does. Then add this sentence and a diagram. Details about the diagram file are below. The process of is part of a larger workflow: ![Workflow](img/workflow diagram.png) ## Step 1: Do this thing Each step should group features by workflow. For example, step 1 might be: `## Step 1: Determine your release cadence` Then the content can explain milestones, iterations, labels, etc. The terms can exist elsewhere in the docs, but the descriptions on this page should be relatively brief. Finally, add links, in this format: For more information, see: - [Create your first abc](link.md). - [Learn more about abc](link.md). ## Step 2: The next thing Don't link in the body content. Save links for the `for more information` area. For more information, see: - [Create your first abc](link.md). - [Learn more about abc](link.md). ``` -------------------------------- ### Example hooks.json Configuration Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/gitlab_duo_cli/_index.md This example demonstrates how to configure a 'SessionStart' hook that runs a command to read a preferences file when the session starts. ```json { "hooks": { "SessionStart": [ { "matcher": "startup", "hooks": [ { "type": "command", "command": "cat ~/.my-coding-preferences.md", "timeout": 10 } ] } ] } } ``` -------------------------------- ### Example: Ruby Style Guide Instructions Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/duo_agent_platform/customize/review_instructions.md This example configures instructions specifically for Ruby files, excluding test files. It emphasizes documentation and adherence to style conventions. ```yaml instructions: - name: Ruby Style Guide fileFilters: - "*.rb" # Ruby files in the root directory - "lib/**/*.rb" # Ruby files in lib and its subdirectories - "!spec/**/*.rb" # Exclude test files instructions: | 1. Ensure all methods have proper documentation 2. Follow Ruby style guide conventions 3. Prefer symbols over strings for hash keys ``` -------------------------------- ### Example Request for Public Key Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/web_commits.md Example of how to make a GET request to retrieve the public signing key for web commits. ```shell curl --request GET \ --url "https://gitlab.example.com/api/v4/web_commits/public_key" ``` -------------------------------- ### Install go-is-svg Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/workhorse/internal/utils/svg/README.md Use 'go get' to install the latest version of the go-is-svg package. ```bash go get -u github.com/h2non/go-is-svg ``` -------------------------------- ### Setup Development Environment Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/gitlab-database-lock_retries/README.md Commands to set up the development environment for the gem, including installing dependencies and running tests. ```bash run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. ``` -------------------------------- ### Example Request to List Group Service Accounts Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/service_accounts.md This example demonstrates how to make a GET request to the API to list service accounts for a group, including authentication. ```shell curl --request GET \ --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/groups/345/service_accounts" ``` -------------------------------- ### Full devfile configuration with postStart events Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/workspace/_index.md This example demonstrates a complete devfile configuration including components, commands, and postStart events. It shows how to define commands that run in different components and with specified working directories, and then lists them under the `postStart` event. ```yaml schemaVersion: 2.2.0 variables: registry-root: registry.gitlab.com components: - name: tooling-container attributes: gl/inject-editor: true container: image: "{{registry-root}}/gitlab-org/remote-development/gitlab-remote-development-docs/ubuntu:22.04" env: - name: KEY value: VALUE endpoints: - name: http-3000 targetPort: 3000 - name: database-container attributes: overrideCommand: false container: image: mysql command: ["echo"] args: ["-n", "user-defined entrypoint command"] env: - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" commands: # Command 1: Container 1, no working directory (uses project directory) - id: install-dependencies exec: component: tooling-container commandLine: "npm install" # Command 2: Container 1, with working directory - id: setup-environment exec: component: tooling-container commandLine: "echo 'Setting up development environment'" workingDir: "/home/gitlab-workspaces" # Command 3: Container 2, no working directory (uses container default) - id: init-database exec: component: database-container commandLine: "echo 'Database initialized' > db-init.log" # Command 4: Container 2, with working directory - id: setup-database exec: component: database-container commandLine: "mkdir -p /var/lib/mysql/logs && echo 'DB setup complete' > setup.log" workingDir: "/var/lib/mysql" events: postStart: - install-dependencies - setup-environment - init-database - setup-database ``` -------------------------------- ### GDK Setup and Migration Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/data_seeder.md Starts the necessary GDK services (PostgreSQL, Redis), installs bundle, and runs database migrations. ```shell $ gdk start db ok: run: services/postgresql: (pid n) 0s, normally down ok: run: services/redis: (pid n) 74s, normally down $ bundle install Bundle complete! $ bundle exec rake db:migrate main: migrated ci: migrated ``` -------------------------------- ### Configure and Use ErrorsApi Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/README.md Example of loading the gem, configuring API key authorization, and making a request to get error information. ```ruby # Load the gem require 'error_tracking_open_api' # Setup authorization ErrorTrackingOpenAPI.configure do |config| # Configure API key authorization: internalToken config.api_key['internalToken'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) # config.api_key_prefix['internalToken'] = 'Bearer' end api_instance = ErrorTrackingOpenAPI::ErrorsApi.new project_id = 56 # Integer | ID of the project where the error was created fingerprint = 56 # Integer | ID of the error that needs to be updated deleted begin #Get information about the error result = api_instance.get_error(project_id, fingerprint) p result rescue ErrorTrackingOpenAPI::ApiError => e puts "Exception when calling ErrorsApi->get_error: #{e}" end ``` -------------------------------- ### Install and Start Jenkins with Homebrew Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/integrations/jenkins.md Use Homebrew to install Jenkins and then start the Jenkins service. Ensure Homebrew is installed and configured on your macOS system. ```shell brew install jenkins brew services start jenkins ``` -------------------------------- ### API Introduction Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/documentation/restful_api_styleguide.md Start the API introduction with a consistent phrase that directs users to related UI documentation. Use a verb followed by the feature and a link. ```markdown Use this API to manage [Git branches](path/to/file). ``` ```markdown Use this API to interact with the [Maven package manager client](path/to/file). ``` ```markdown Use this API to interact with namespaces, a special resource category used to organize users and groups. For more information, see [namespaces](path/to/file). ``` -------------------------------- ### Run SVG Check Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/workhorse/internal/utils/svg/README.md Execute the Go example program to test SVG file verification. ```bash go run _example/example.go ``` -------------------------------- ### Install Gitlab::Database::LockRetries Gem (without Bundler) Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/gitlab-database-lock_retries/README.md Instructions for installing the gem using the `gem install` command if bundler is not managing dependencies. ```bash $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG ``` -------------------------------- ### Run Duo Workflow Service Server Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/vendor/gems/gitlab-duo-workflow-service-client/README.md Starts the Duo Workflow Service server locally. Ensure Python and Poetry are installed. ```shell poetry run python -m duo_workflow_service.server ``` -------------------------------- ### Example: Excluding Terms Starting With a Pattern Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/search/advanced_search.md This example shows how to find results that do not start with a specified pattern. ```text RSpec.describe Resolvers -*builder ``` -------------------------------- ### Implement Early Return with `ready?` Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/api_graphql_styleguide.md Use the `ready?(**args)` method to perform setup or return early with data without invoking `#resolve`, useful for conditions where no results are possible. ```ruby def ready?(**args) [false, 'have this instead'] end ``` -------------------------------- ### Build and Install Ruby Gem Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/README.md Commands to build the Ruby gem from its source and install it locally. ```shell gem build error_tracking_open_api.gemspec ``` ```shell gem install "./error_tracking_open_api-1.0.0.gem" ``` -------------------------------- ### Install curl for repository setup Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/install/package/suse.md Installs the curl utility, which is required to download the repository setup script. ```shell sudo zypper install curl ``` -------------------------------- ### Example: Database Migration Instructions Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/duo_agent_platform/customize/review_instructions.md This example provides instructions for database migration files, referencing external guidelines and checklists for safety and best practices. ```yaml instructions: - name: Database Migrations fileFilters: - "db/migrate/**/*.rb" - "db/post_migrate/**/*.rb" instructions: | 1. Follow the migration safety guidelines in https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/development/database/avoiding_downtime_in_migrations.md 2. Apply the team checklist in docs/migrations-checklist.md ``` -------------------------------- ### Start Rails Console Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/topics/autodevops/stages.md Example of starting a Rails console from the application root directory using the launcher. ```shell /cnb/lifecycle/launcher procfile exec bin/rails c ``` -------------------------------- ### Check Apache Bench Installation Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/qa/perf/ai/README.md Verify if the Apache Bench (ab) tool is installed on your system. This command shows the path if it's available. ```shell $ which ab /usr/sbin/ab ``` -------------------------------- ### Example Output for Executing Specific Migration Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc-locale/ja-jp/update/background_migrations.md This is an example of the output you might see when executing a specific background migration. It includes a confirmation prompt and the execution status. ```plaintext Are you sure you want to execute this migration? yes Executing background migration `ci_10`... Done. ``` -------------------------------- ### RPM 'package is already installed' Error Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/update/convert_to_ee/package_troubleshooting.md This is an example of the error message you might see when trying to install an RPM package that is considered older than an already installed version. ```shell package gitlab-7.5.2_omnibus.5.2.1.ci-1.el7.x86_64 (which is newer than gitlab-7.5.2_ee.omnibus.5.2.1.ci-1.el7.x86_64) is already installed ``` -------------------------------- ### Example: Instructions for All Files Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/duo_agent_platform/customize/review_instructions.md This configuration applies a general instruction to all files in the repository, focusing on explaining the reasoning behind suggestions. ```yaml instructions: - name: All Files fileFilters: - "**/*" # All files in the repository instructions: | 1. Explain the "why" behind each suggestion ``` -------------------------------- ### Keyset Pagination Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/database/pagination_guidelines.md Demonstrates how to use the keyset pagination library to fetch the first page and subsequent pages. ```ruby # first page paginator = Project.order(:created_at, :id).keyset_paginate(per_page: 20) puts paginator.to_a # records # next page cursor = paginator.cursor_for_next_page paginator = Project.order(:created_at, :id).keyset_paginate(cursor: cursor, per_page: 20) puts paginator.to_a # records ``` -------------------------------- ### Start GitLab Rails Console (Source Installation) Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/administration/feature_flags/_index.md Use this command to start a GitLab Rails console session for installations from source. ```shell sudo -u git -H bundle exec rails console -e production ``` -------------------------------- ### Example Output for Executing All Migrations Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc-locale/ja-jp/update/background_migrations.md This is an example of the output when executing all unfinished background migrations. It shows the progress and completion status for each migration across different groups. ```plaintext Are you sure you want to execute all unfinished migrations? yes [main] Executing 6 background migrations... [main_85]: Start. [main_85]: Done. [main_86]: Start. [main_86]: Done. [main_87]: Start. [main_87]: Done. [main_88]: Start. [main_88]: Done. [main_89]: Start. [main_89]: Done. [main_90]: Start. [main_90]: Done. [ci] Executing 3 background migrations... [ci_8]: Start. [ci_8]: Done. [ci_9]: Start. [ci_9]: Done. [ci_10]: Start. [ci_10]: Done. ``` -------------------------------- ### Run a Specific Test Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/workhorse/AGENTS.md Example of running a single test for the AI assist duoworkflow package. ```bash go test ./internal/ai_assist/duoworkflow -count=1 ``` -------------------------------- ### Start IMAP Service Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/administration/reply_by_email_postfix_setup.md Start the IMAP service after installing courier-imap. ```shell imapd start ``` -------------------------------- ### Query.runnerSetup Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/graphql/reference/_index.md Provides runner setup instructions based on architecture and platform. This query is deprecated and no longer used. ```APIDOC ## Query.runnerSetup ### Description Runner setup instructions. This query is deprecated and no longer used. Use gitlab-runner documentation for runner registration commands. ### Arguments #### Path Parameters - **architecture** (String!) - Description: Architecture to generate the instructions for. - **platform** (String!) - Description: Platform to generate the instructions for. #### Query Parameters - **groupId** (GroupID) - Deprecated in GitLab 13.11. No longer used. - **projectId** (ProjectID) - Deprecated in GitLab 13.11. No longer used. ``` -------------------------------- ### Install Mail::SMTPPool Manually Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/mail-smtp_pool/README.md Alternatively, install the gem directly using the gem install command. ```shell gem install mail_smtp_pool ``` -------------------------------- ### Get Debian Installer Packages Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/auth/tokens/fine_grained_access_tokens_rest.md Retrieves Debian installer packages for a group. ```APIDOC ## GET /groups/:id/-/packages/debian/dists/*distribution/:component/debian-installer/binary-:architecture/Packages ### Description Retrieves Debian installer packages for a group. ### Method GET ### Endpoint /groups/:id/-/packages/debian/dists/*distribution/:component/debian-installer/binary-:architecture/Packages ``` -------------------------------- ### Complete Example Workspace Configuration Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/workspace/settings.md An example of a complete configuration including all available workspace settings. ```yaml remote_development: enabled: true dns_zone: workspaces.dev.test gitlab_workspaces_proxy: namespace: "gitlab-workspaces" network_policy: enabled: true egress: - allow: "0.0.0.0/0" except: - "10.0.0.0/8" - "172.16.0.0/12" - "192.168.0.0/16" default_resources_per_workspace_container: requests: cpu: "0.5" memory: "512Mi" limits: cpu: "1" memory: "1Gi" max_resources_per_workspace: requests: cpu: "1" memory: "1Gi" limits: cpu: "2" memory: "4Gi" workspaces_quota: 10 workspaces_per_user_quota: 3 use_kubernetes_user_namespaces: false default_runtime_class: "standard" allow_privilege_escalation: false image_pull_secrets: - name: "registry-secret" namespace: "default" annotations: environment: "production" team: "engineering" labels: app: "workspace" tier: "development" max_active_hours_before_stop: 60 max_stopped_hours_before_termination: 4332 shared_namespace: "" ``` -------------------------------- ### Install Gem Locally Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/gitlab-database-lock_retries/README.md Command to install the gem onto your local machine for development purposes. ```bash bundle exec rake install ``` -------------------------------- ### Install Mail::SMTPPool via Bundler Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/mail-smtp_pool/README.md Execute the bundle command after adding the gem to your Gemfile to install it. ```shell bundle ``` -------------------------------- ### Get Project Information for Manual Indexing Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/gitlab-active-context/doc/code_embeddings_indexing_pipeline.md Retrieves a Project object by its full path and returns its repository's relative path, used for manual indexing setup. ```ruby p = Project.find_by_full_path('gitlab-org/gitlab-test') p.repository.relative_path # => "@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git" ``` -------------------------------- ### Install Gem from Git Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/README.md Instructions for adding the gem to your Gemfile if it's hosted in a Git repository. ```ruby gem 'error_tracking_open_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ``` -------------------------------- ### Instantiating ErrorV2 Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/docs/ErrorV2.md An example demonstrating how to instantiate the ErrorV2 object with various properties. ```APIDOC ## Example Usage ### Instantiate ErrorV2 ```ruby require 'error_tracking_open_api' instance = ErrorTrackingOpenAPI::ErrorV2.new( id: null, project: null, title: 'ActionView::MissingTemplate', actor: 'PostsController#edit', count: null, user_count: null, last_seen: null, first_seen: null, status: null ) ``` ``` -------------------------------- ### TerraformModuleMetadataExample Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/graphql/reference/_index.md Represents an example for a Terraform module's metadata. ```APIDOC ## TerraformModuleMetadataExample ### Description Terraform module metadata example. ### Fields - **inputs** ([TerraformModuleMetadataInput!]) - Required - Inputs of the module. - **name** (String!) - Required - Name of the example. - **outputs** ([TerraformModuleMetadataOutput!]) - Required - Outputs of the module. - **readme** (String) - Optional - Readme data. - **readmeHtml** (String) - Optional - GitLab Flavored Markdown rendering of `readme`. ``` -------------------------------- ### Install Microsoft Graph Mailer Gem Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/vendor/gems/microsoft_graph_mailer/README.md Execute bundle to install the gem after adding it to the Gemfile, or install it directly using the gem install command. ```shell bundle ``` ```shell gem install microsoft_graph_mailer ``` -------------------------------- ### Install Maven package with dependency:get Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/packages/maven_repository/_index.md Use the Maven 'dependency:get' command to directly install a specific artifact from a remote repository, specifying the GitLab endpoint and settings file. ```shell mvn dependency:get -Dartifact=com.nickkipling.app:nick-test-app:1.1-SNAPSHOT -DremoteRepositories=gitlab-maven:::: -s ``` -------------------------------- ### Install libraries and run migrations Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/update/patch_versions.md Configure bundle for deployment, install gems, clean up old gems, run database migrations, and compile assets. Ensure you are in the GitLab installation directory. ```shell cd /home/git/gitlab # If you haven't done so during installation or a previous upgrade already sudo -u git -H bundle config set --local deployment 'true' sudo -u git -H bundle config set --local without 'development test kerberos' # Update gems sudo -u git -H bundle install # Optional: clean up old gems sudo -u git -H bundle clean # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production # Clean up assets and cache sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production NODE_ENV=production NODE_OPTIONS="--max_old_space_size=4096" ``` -------------------------------- ### Production JSON Log Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc-locale/ja-jp/administration/logs/_index.md This is an example of a log entry from `production_json.log` which includes controller and middleware call stacks. ```json { "message": "Processing by ApplicationController#index as HTML", "time": "2023-10-27T10:00:00.123Z", "severity": "INFO", "pid": 12345, "thread_id": "abcdef123456", "correlation_id": "xyz789", "exception": null, "exception_backtrace": null, "duration": 0.5, "view": 0.2, "db": 0.1, "details": { "controller": "ApplicationController", "action": "index", "format": "html", "method": "GET", "path": "/", "user_id": null, "username": null }, "source_location": [ "app/controllers/application_controller.rb:444:in `set_locale'", "ee/lib/gitlab/jira/middleware.rb:19:in `call'" ] } ``` -------------------------------- ### ErrorUpdatePayload Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/docs/ErrorUpdatePayload.md An example of how to instantiate the ErrorUpdatePayload object. ```APIDOC ## Example ```ruby require 'error_tracking_open_api' instance = ErrorTrackingOpenAPI::ErrorUpdatePayload.new( status: null, updated_by_id: null ) ``` ``` -------------------------------- ### Example: General Instructions for All Files (Excluding Tests) Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/user/duo_agent_platform/customize/review_instructions.md This example applies general instructions to all files except those matching test patterns. It promotes consistent code style and commenting. ```yaml instructions: - name: All Files Except Tests fileFilters: - "!**/*.test.*" # Exclude all test files - "!**/*.spec.*" # Exclude all spec files - "!test/**/*" # Exclude test directories - "!spec/**/*" # Exclude spec directories instructions: | 1. Follow consistent code style 2. Add meaningful comments for complex logic 3. Ensure proper error handling ``` -------------------------------- ### Install curl Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/install/package/amazonlinux_2023.md Installs the curl utility, which is required for downloading the repository setup script. ```shell sudo dnf install -y curl ``` -------------------------------- ### Error Object Instantiation Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/docs/Error.md An example demonstrating how to instantiate an Error object using Ruby. ```APIDOC ## Example Usage (Ruby) ```ruby require 'error_tracking_open_api' instance = ErrorTrackingOpenAPI::Error.new( fingerprint: null, project_id: null, name: ActionView::MissingTemplate, description: Missing template posts/edit, actor: PostsController#edit, event_count: null, approximated_user_count: null, last_seen_at: null, first_seen_at: null, status: null, stats: null ) ``` ``` -------------------------------- ### Example Mutation Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/graphql/reference/_index.md This is a general example of how to structure a GraphQL mutation request. It shows how to pass arguments and specify return fields. ```graphql mutation($id: NoteableID!, $body: String!) { createNote(input: { noteableId: $id, body: $body }) { errors } } ``` -------------------------------- ### List Project Deploy Keys Response Example Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/api/deploy_keys.md Example JSON response when listing project deploy keys for a user. ```json [ { "id": 1, "title": "Key A", "created_at": "2022-05-30T12:28:27.855Z", "expires_at": "2022-10-30T12:28:27.855Z", "key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILkYXU2fVeO4/0rDCSsswP5iIX2+B6tv15YT3KObgyDl Key", "fingerprint": "40:8e:fa:df:70:f7:a7:06:1e:0d:6f:ae:f2:27:92:01", "fingerprint_sha256": "SHA256:Ojq2LZW43BFK/AMP81jBkDGn9YpPWYRNcViKBB44LPU" } ] ``` -------------------------------- ### Identify Unavailable Repositories with Example Output Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/administration/gitaly/praefect/recovery.md This example shows the output format when repositories are unavailable. It details the primary, in-sync, and outdated storages for each repository. ```shell Virtual storage: default Outdated repositories: @hashed/3f/db/3fdba35f04dc8c462986c992bcf875546257113072a909c162f7e470e581e278.git (unavailable): Primary: gitaly-1 In-Sync Storages: gitaly-2, assigned host, unhealthy Outdated Storages: gitaly-1 is behind by 3 changes or less, assigned host gitaly-3 is behind by 3 changes or less ``` -------------------------------- ### Start Courier Authentication Daemon Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/administration/reply_by_email_postfix_setup.md Start the courier-authdaemon service, which is necessary for IMAP authentication. This service might not start automatically after installation. ```shell sudo service courier-authdaemon start ``` -------------------------------- ### Instantiate ErrorV2 Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/gems/error_tracking_open_api/docs/ErrorV2.md Example of how to create a new instance of the ErrorV2 class. All properties are optional. ```ruby require 'error_tracking_open_api' instance = ErrorTrackingOpenAPI::ErrorV2.new( id: null, project: null, title: ActionView::MissingTemplate, actor: PostsController#edit, count: null, user_count: null, last_seen: null, first_seen: null, status: null ) ``` -------------------------------- ### Install Curl Package Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/install/package/amazonlinux_2.md Installs the curl utility, which is required for downloading repository setup scripts. ```shell sudo yum install -y curl ``` -------------------------------- ### Initialize slice with capacity (Do) Source: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/development/go_guide/_index.md Demonstrates the recommended way to initialize a slice by providing an initial capacity using `make`. This optimizes performance by minimizing reallocations. ```go s2 := make([]string, 0, len(s1)) for _, val := range s1 { s2 = append(s2, val) } ```