20. A group of DevOps engineers adopted the network as code methodology to manage network infrastructure. During a code release, the engineers find a bug that is causing issues on production. Which safeguard will allow the engineers to restore functionality to the production site?

Answer: C

Explanation:

Rollback

Rollback is the safeguard that allows the engineers to restore functionality to the production site after discovering a bug during a code release. By reverting to a previous stable version of the code, the engineers can ensure that the production environment continues to operate smoothly.

A) Code review

Code review is a process of examining the source code before it is merged into the main codebase. While it helps in identifying potential issues early in the development process, it does not provide a mechanism to restore functionality once a bug has already been deployed to production.

B) Code testing

Code testing involves assessing the code for bugs and errors before it is released. Although thorough testing can reduce the likelihood of bugs reaching production, it does not offer a solution for restoring the production environment after a faulty release has occurred.

C) Rollback

Rollback is a critical process that allows developers to revert to a previous version of the code that was functioning correctly. This is the most effective method for quickly addressing issues in production, thereby restoring the service without significant downtime or disruption.

D) Staging

Staging refers to the practice of testing code in an environment that simulates production before actual deployment. While staging helps catch issues prior to release, it does not provide a direct method for fixing problems once code is already live in production.

Conclusion

Rollback is the definitive safeguard in this scenario, as it directly addresses the need to restore functionality after a bug has been identified in production. Other options, such as code review and testing, are preventive measures that do not solve the immediate problem, while staging is a preparatory step that does not impact the live environment. Therefore, only rollback provides a practical solution for quickly rectifying production issues.