Git & Github Code review where it fits in the SDLC cycle

This does not relate to a specific project but general practices in Git.
When developing code in a branch at what point is a generate pull request made? Below I have listed stages in a typical development cycle:

  • Development stage (sanbox)

  • QA stage.

  • Final approval.

Final approval may not be an official stage but one of my former employers would have a meeting after all of the testing to review the code. This included discussion design decision. If a design change was mandated, it was back to stage one.

The dilema here is one wants a “review” before" deployment but any design or “bigger” issues should be resolved earlier. Where does the Pull request and approval come into play? Is is tempting to say right after the dev stage, but the main branch should represent production (correct?). If that is the case, the pull request should happen at deployment.

Any thoughts.

General workflow (can vary depending on situation):

Develop and test locally, test data may use dev instances of databases and environment variables.

Make a PR to merge to dev after some code review, before merging there might be some test units and static analysis that your code has to pass.

If nothing breaks in dev, merge to QA/staging branch (this can sometimes be done in bulk, meaning not just your change but everyone contributing to dev).

If qa testing brings up no issues merge to production branch where its live.