














































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















































Question 1. In GitLab’s hierarchy, which object directly contains projects? A) Instance B) Group C) Subgroup D) Namespace Answer: B Explanation: A Group is the container that can hold multiple projects; Subgroups are nested groups within a group, while an Instance is the entire GitLab installation. Question 2. Which visibility level allows any authenticated GitLab user to view a project but prevents anonymous access? A) Private B) Internal C) Public D) Restricted Answer: B Explanation: Internal projects are visible to any logged-in user, while Private restricts access to members only and Public is open to everyone, including unauthenticated users. Question 3. When configuring a user’s profile, which setting controls email notifications for pipeline failures? A) Notification email B) Notification level C) Notification events → Pipeline failed D) To-Do list preferences
Answer: C Explanation: The “Notification events” section lets users toggle specific events such as “Pipeline failed” to receive email alerts. Question 4. Which Git command creates a new local branch and switches to it in one step? A) git branch new-branch B) git checkout -b new-branch C) git switch new-branch D) git create new-branch Answer: B Explanation: git checkout -b both creates the branch and checks it out. git switch -c also works, but option B is the classic command. Question 5. In GitLab, which feature enables you to view the full commit history of a file without leaving the web UI? A) Repository → Files → History B) Repository → Commits → File view C) Repository → Graph → File timeline D) Repository → Blame → History button Answer: A Explanation: The “History” link on a file’s page shows a list of all commits affecting that file. Question 6. What is the purpose of the “Draft” prefix in a Merge Request title? A) It automatically disables CI pipelines. B) It prevents the MR from being merged until the prefix is removed.
A) /label bug::high B) /add_label bug::high C) /label ~bug::high D) /assign_label bug::high Answer: C Explanation: The syntax /label ~label_name adds an existing label; the tilde denotes a label reference. Question 10. When defining a job in .gitlab-ci.yml, which keyword specifies the Docker image used for that job? A) container B) image C) runtime D) executor Answer: B Explanation: The image: keyword selects the Docker image that the job runs in. Question 11. Which keyword allows you to run a script before every job in a pipeline stage? A) before_script B) pre_script C) init_script D) setup_script Answer: A Explanation: before_script: runs before the script: section of each job that inherits it.
Question 12. In CI/CD, what is the effect of setting cache: paths: for a job? A) Files are uploaded as artifacts after the job finishes. B) Files are stored in the Git repository. C) Files are kept between jobs to speed up subsequent runs. D) Files are encrypted and stored in the database. Answer: C Explanation: Caches are shared between jobs to avoid re-downloading or rebuilding the same data. Question 13. Which runner type is scoped to a specific GitLab group and cannot be used by projects outside that group? A) Shared runner B) Group runner C) Project runner D) Instance runner Answer: B Explanation: Group runners are registered at the group level and are only available to projects within that group. Question 14. Which executor runs jobs inside a Docker container but uses the host’s Docker daemon for image pulling? A) docker B) docker-machine C) shell D) kubernetes Answer: A
Answer: A Explanation: The “Create issue” button opens a pre-filled issue linked to the vulnerability. Question 18. Which License Compliance feature helps you enforce that only approved open-source licenses are used in a project? A) License whitelist B) License blacklist C) License scanning policy D) License approval workflow Answer: A Explanation: A whitelist defines the set of licenses that are allowed; any other license triggers a warning. Question 19. What is the purpose of a GitLab Release? A) To automatically deploy to production. B) To generate a changelog and attach binary assets to a tag. C) To lock the repository for a freeze period. D) To create a snapshot of the CI configuration. Answer: B Explanation: A Release ties a Git tag to a human-readable description, changelog, and optional assets. Question 20. Which environment variable is automatically provided by GitLab CI to indicate the current branch name? A) CI_BRANCH B) CI_COMMIT_REF_NAME C) GIT_BRANCH
Answer: B Explanation: CI_COMMIT_REF_NAME contains the branch or tag name that triggered the pipeline. Question 21. When using the Container Registry, which command pushes a locally built image named myapp to the project’s registry? A) docker push registry.gitlab.com/group/project/myapp B) docker push myapp registry.gitlab.com/group/project C) docker push registry.gitlab.com/group/project/myapp:latest D) docker upload registry.gitlab.com/group/project/myapp Answer: C Explanation: The full image reference includes the registry URL, project path, and tag (often latest). Question 22. Which of the following is a valid way to reference a variable defined at the group level inside .gitlab-ci.yml? A) $GROUP_VAR B) $CI_GROUP_VAR C) $CI_VARIABLE_GROUP_VAR D) $CI_GROUP_VARIABLES_VAR Answer: A Explanation: Group-level variables are exposed as normal environment variables prefixed with $. Question 23. In a Merge Request discussion, what does the “Resolve thread” button do? A) Deletes the comment thread.
Question 26. Which of the following labels would best represent a “blocked” status in a scoped label system? A) status::blocked B) workflow::blocked C) priority::blocked D) block::status Answer: A Explanation: Scoped labels follow the key::value pattern; status::blocked clearly conveys the state. Question 27. In the context of GitLab, what does “Epics” primarily help teams to do? A) Track individual commits across branches. B) Group multiple issues under a higher-level objective. C) Automate merge conflict resolution. D) Manage CI runner capacity. Answer: B Explanation: Epics are containers for related issues, useful for large initiatives. Question 28. Which of the following CI/CD jobs will run only when a tag is pushed? A) job: only: tags B) job: rules: - if: $CI_COMMIT_TAG C) job: when: tag D) job: only: - tags Answer: D
Explanation: only: - tags restricts the job to tag pipelines; rules: can also be used but option D is the classic syntax. Question 29. What is the effect of setting allow_failure: true on a job? A) The job will be skipped if it fails. B) The pipeline will be marked as successful even if the job fails. C) The job will be retried automatically. D) The job will be run on a separate runner. Answer: B Explanation: allow_failure permits the job to fail without causing the whole pipeline to be marked failed. Question 30. Which of the following is a correct way to add an SSH key to your GitLab account via the UI? A) Settings → SSH Keys → “Add key” button B) Profile → Security → “New SSH credential” C) User → Keys → “Import SSH” D) Admin → SSH → “Create key” Answer: A Explanation: The SSH Keys page under Settings lets you paste a public key and give it a title. Question 31. When a Merge Request shows “conflicts” in the UI, what is the recommended first step? A) Click “Resolve conflicts” and use the Web IDE to edit the files. B) Force-push the source branch to overwrite the target. C) Delete the target branch and recreate it. D) Close the MR and open a new one.
C) They cannot be used as a source for MRs. D) They automatically disable CI pipelines. Answer: A Explanation: Protected branches restrict who can push or force-push; Maintainers (or higher) are typically allowed. Question 35. What does the needs: keyword in a .gitlab-ci.yml job definition do? A) Declares a dependency on another job’s artifacts. B) Requests a specific runner tag. C) Sets an environment variable for the job. D) Enables parallel execution of the job. Answer: A Explanation: needs: specifies that a job should start after the listed jobs finish and can access their artifacts. Question 36. When using the Package Registry for Maven, which file must be added to the project’s pom.xml to resolve packages from GitLab? A) element with GitLab URL B) element pointing to GitLab C) element for GitLab Maven plugin D) with GitLab coordinates Answer: A Explanation: Adding a `` entry that points to the GitLab Maven endpoint enables Maven to download packages. Question 37. Which of the following is NOT a valid CI/CD variable scope? A) Project
B) Group C) Instance D) User Answer: D Explanation: Variables can be defined at Project, Group, or Instance (instance-wide) levels; there is no “User” scope. Question 38. In a pipeline graph, what does a diamond-shaped node represent? A) A manual job B) A scheduled job C) A job with needs: dependencies D) A stage separator Answer: A Explanation: Manual jobs are shown with a diamond icon, indicating they require a user click to start. Question 39. Which of the following actions can be performed directly from the “Security Dashboard” without leaving the UI? A) Run a new SAST scan B) Dismiss a vulnerability C) Push a Docker image to the registry D) Create a new group runner Answer: B Explanation: Vulnerabilities can be dismissed, marked as false positive, or turned into issues directly from the dashboard.
Question 43. Which of the following is a correct way to reference an artifact from a previous job in a later job’s script? A) cp $CI_PROJECT_DIR/artifacts/file.txt. B) cp $CI_JOB_ARTIFACTS/file.txt. C) cp $CI_PROJECT_DIR/builds/file.txt. D) cp $CI_DEPENDENCY_PROXY_DIRECT_ENDPOINT/file.txt. Answer: B Explanation: $CI_JOB_ARTIFACTS points to the directory where artifacts from jobs listed in needs: are unpacked. Question 44. What does the “Review Apps” feature primarily provide? A) Automated code style checks. B) Temporary live environments for merge request branches. C) Static analysis of merge request diffs. D) Pre-populated issue templates. Answer: B Explanation: Review Apps spin up a disposable environment (often on Kubernetes) for each MR to preview changes. Question 45. Which of the following is a valid way to mask a CI variable so its value is never shown in job logs? A) Set masked: true in the variable definition. B) Prefix the variable name with SECRET_. C) Store the value in a secret file. D) Use export in the script. Answer: A Explanation: GitLab provides a “Masked” checkbox; when enabled, the variable’s value is hidden in logs.
Question 46. When a project’s “Container Registry” is disabled, which of the following occurs? A) Existing images are deleted automatically. B) New images cannot be pushed, but existing ones remain accessible. C) All CI jobs that reference the registry fail. D) The registry UI is removed, but API access still works. Answer: B Explanation: Disabling the registry prevents new pushes; previously stored images stay available unless manually removed. Question 47. Which of the following is the correct syntax to create a new issue from a comment using Quick Actions? A) /issue create Title: My issue B) /new issue My issue C) /create issue My issue D) /issue new My issue Answer: C Explanation: The /create issue action followed by the title creates a new issue. Question 48. In GitLab, which role can create groups but cannot delete projects? A) Guest B) Reporter C) Developer D) Maintainer Answer: D
Answer: B Explanation: Group runners can be configured with custom executors, images, and permissions specific to the group, unlike shared runners that have stricter policies. Question 52. In a Merge Request, what does the “Remove source branch” option do after merging? A) Deletes the source branch locally on the author’s machine. B) Deletes the source branch on the remote repository. C) Archives the branch for future reference. D) Renames the branch to merged/. Answer: B Explanation: When selected, GitLab removes the source branch from the remote after a successful merge. Question 53. Which of the following is NOT a supported package type in the GitLab Package Registry? A) npm B) Maven C) PyPI D) Composer Answer: C Explanation: As of GitLab 16.x, PyPI (Python) packages are not natively supported; npm, Maven, Composer, NuGet, and others are. Question 54. Which of the following options can be used to enforce that every Merge Request must have at least one approval from a user with the “Security Analyst” role? A) Set a protected branch rule.
B) Add an approval rule with approvers: security_analyst. C) Define a custom workflow rule in .gitlab-ci.yml. D) Enable “Require approval from code owners only”. Answer: B Explanation: Approval rules can specify required approvers by role, such as “Security Analyst”. Question 55. What does the only: changes keyword do in a job definition? A) Runs the job only if files matching the pattern have changed in the commit. B) Triggers the job only when a tag is created. C) Executes the job only on a schedule. D) Prevents the job from running on merge requests. Answer: A Explanation: only: changes checks the diff for specified paths and runs the job if they were modified. Question 56. Which of the following best describes the purpose of a “Milestone” in GitLab? A) To group issues and MRs by a specific target date or release. B) To automatically assign reviewers based on expertise. C) To enforce code style guidelines. D) To create a snapshot of the repository at a point in time. Answer: A Explanation: Milestones are time-boxed containers that help track progress toward a release or goal.