Google Professional Cloud Developer Question 245
Single answerGoogle Cloud PlatformYou are developing a cloud-native application hosted on Google Cloud and need to ensure that your source code management strategy supports continuous integration (CI), branch-based workflows, and version tracing. Which source control practice should you implement?
- A
Use a single 'main' branch for all development and directly commit changes to it.
- B
Implement a Git branching strategy such as Git Flow or trunk-based development.
- C
Store your source code in a Google Cloud Storage bucket for simplicity.
- D
Disable pull requests and enforce direct commits to improve developer speed.
Show answer and explanation
Correct answer: B
Explanation
Git branching strategies such as Git Flow or trunk-based development are essential practices for managing source code in cloud-native applications. They facilitate collaboration, version tracking, and better integration with CI/CD pipelines, ensuring code quality and streamlined workflows. The other options either lack necessary features or compromise good development practices.
- A. Incorrect.
Using a single 'main' branch for all development without proper branching and merging practices can lead to conflicts and make collaborative development and CI pipelines difficult to manage.
- B. Correct.
Git branching strategies like Git Flow or trunk-based development are widely adopted for managing source code in CI/CD pipelines. These strategies support collaboration, effective versioning, and integration.
- C. Incorrect.
Storing source code in a Google Cloud Storage bucket does not provide version control, collaboration tools, or integration capabilities required for CI/CD workflows.
- D. Incorrect.
Disabling pull requests and enforcing direct commits sacrifices code review and quality assurance, making it unsuitable for a professional development environment.