200-901 · Question #595
An engineer clones a repository that contains a Python script from GitLab to a laptop. After modifying the code, the engineer wants to validate the changes. Which command starts the CI/CD pipeline…
The correct answer is D. git push. To trigger a CI/CD pipeline and run automated tests after modifying code in a Git repository, the engineer must push the committed changes to the remote repository.
Question
An engineer clones a repository that contains a Python script from GitLab to a laptop. After modifying the code, the engineer wants to validate the changes. Which command starts the CI/CD pipeline and runs the automated tests?
Options
- Agit commit
- Bgit test
- Cgit fetch
- Dgit push
How the community answered
(22 responses)- A5% (1)
- B5% (1)
- D91% (20)
Why each option
To trigger a CI/CD pipeline and run automated tests after modifying code in a Git repository, the engineer must push the committed changes to the remote repository.
`git commit` records changes in the local repository but does not interact with the remote server or initiate any CI/CD processes.
`git test` is not a standard Git command; testing is typically handled by the CI/CD pipeline itself after a push.
`git fetch` downloads changes from the remote repository to the local repository, but it does not send local changes or trigger CI/CD pipelines.
In modern CI/CD workflows, especially with platforms like GitLab, a `git push` command sends the local commits to the remote repository. This action is configured to trigger the CI/CD pipeline, which then executes automated tests and other defined stages.
Concept tested: Git CI/CD pipeline triggers
Source: https://docs.gitlab.com/ee/ci/pipelines/pipeline_triggers.html
Topics
Community Discussion
No community discussion yet for this question.