You are responsible for creating and modifying the Terraform templates that define your Infrastructure. Because two new engineers will also be working on the same code, you need to define a process and adopt a tool that will prevent you from overwriting each other’s code. You also want to ensure that you capture all updates in the latest version. What should you do?
A. Store your code in a Git-based version control system. Establish a process that allows developers to merge their own changes at the end of each day. Package and upload code to a versioned Cloud Storage basket as the latest master version.
B. Store your code in a Git-based version control system. Establish a process that includes code reviews by peers and unit testing to ensure integrity and functionality before integration of code. Establish a process where the fully integrated code in the repository becomes the latest master version.
C. Store your code as text files in Google Drive in a defined folder structure that organizes the files. At the end of each day, confirm that all changes have been captured in the files within the folder structure. Rename the folder structure with a predefined naming convention that increments the version.
D. Store your code as text files in Google Drive in a defined folder structure that organizes the files. At the end of each day, confirm that all changes have been captured in the files within the folder structure and create a new .zip archive with a predefined naming convention. Upload the .zip archive to a versioned Cloud Storage bucket and accept it as the latest version.
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
B
Explanation
The important thing here is to avoid overwriting the code, not unit testing and other things.
A. Store your code in a Git-based version control system. Establish a process that allows developers to merge their own changes at the end of each day. Package and upload code to a versioned Cloud Storage basket as the latest master version.
(The code is already stored in a got repo, so there is no need to upload the code to the cloud storage bucket.)
B. Store your code in a Git-based version control system. Establish a process that includes code reviews by peers and unit testing to ensure integrity and functionality before integration of code. Establish a process where the fully integrated code in the repository becomes the latest master version.
(Using a Git-based version control system such as GitHub or GitLab is a best practice for managing code in a collaborative environment. It provides a central repository where all changes are tracked and versioned, and it also allows for concurrent development by multiple team members. Establishing a process that includes code reviews by peers and unit testing before merging changes ensures the integrity and functionality of the code, and it also helps to prevent conflicts and errors. Once the changes are fully integrated and tested, the latest version of the code in the repository should be considered the master version, and this should be the version that is used for deployment.)
C. Store your code as text files in Google Drive in a defined folder structure that organizes the files. At the end of each day, confirm that all changes have been captured in the files within the folder structure. Rename the folder structure with a predefined naming convention that increments the version.
(Google Drive is not a Version Control System. So, ruled out.)
D. Store your code as text files in Google Drive in a defined folder structure that organizes the files. At the end of each day, confirm that all changes have been captured in the files within the folder structure and create a new .zip archive with a predefined naming convention. Upload the .zip archive to a versioned Cloud Storage bucket and accept it as the latest version.
(Google Drive is not a Version Control System. So, ruled out.)