Skip to main content

3 posts tagged with "Architecture"

Architecture

View All Tags

Create a pull request template

· 2 min read
Daniel Guo
Software Engineer

You can create a pull request template based on Creating a pull request template for your repository from Github:

  • you can put it in the repository's root directory: ./pull_request_template.md
  • you can put it in the repository's docs directory: ./docs/pull_request_template.md
  • you can put it in a hidden directory: ./.github/pull_request_template.md
  • you can put multiple pull request templates in a PULL_REQUEST_TEMPLATE subdirectory in the root director, docs directory, or .github hidden directory.

Benefits

Pull request (PR) templates ensure consistency in PR descriptions, clarify expectations, improve code quality, and ultimately, streamline the review process. By providing a structured format, PR templates reduce back-and-forth communication and save time for both reviewers and contributors.

  • Consistency: PR templates standardize the information included in each PR, making it easier for reviewers to understand the changes and assess their impact.
  • Clarity:: They prompt contributors to provide essential details about their changes, including the problem being solved, the approach taken, and any testing steps. This reduces ambiguity and misunderstandings.
  • Efficiency: By providing a structured format, PR templates reduce the time spent on back-and-forth communication, allowing reviewers to focus on the actual code changes.
  • Quality Control: Templates can include checklists for testing, documentation updates, and other quality-related tasks, ensuring that contributors remember to address these aspects.
  • Improved Documentation: Detailed PR descriptions, guided by the template, serve as valuable documentation for the codebase, making it easier for future developers to understand the rationale behind changes.

Template

Here is a pull request template that I shared within the team:

## Summary

_A brief description of changes and motivation behind them._

## Type of Change

- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Performance improvement
- [ ] Configuration/infrastructure changes

## Changes Made

- _your changes_
- ...

## Checklist

- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Code is properly commented
- [ ] Tests added for new functionality
- [ ] Documentation updated (if needed)
- [ ] No merge conflicts

## Testing

- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
- [ ] N/A (docs etc.)

## Reviewer Notes

_Any specific areas you'd like reviewers to focus on_

Reference

Code Review: Why and How

· 5 min read
Daniel Guo
Software Engineer

What is Code Review?

Code review is a systematic examination of source code by team members other than the original author. It's a collaborative process where developers examine each other's code changes before they're merged into the main codebase. This practice involves reviewing pull requests, discussing implementation approaches, and ensuring code quality standards are met.

Why Code Review Matters

Quality Assurance

Code review acts as a safety net, catching bugs, security vulnerabilities, and performance issues before they reach production. Multiple pairs of eyes on code significantly reduce the likelihood of defects making it to users.

Knowledge Sharing and Learning

Every code review is an opportunity for mutual learning. Senior developers can mentor junior team members, while fresh perspectives often reveal better approaches or highlight assumptions that more experienced developers might overlook. This knowledge transfer strengthens the entire team's capabilities.

Maintaining Code Standards

Reviews ensure consistency in coding style, architectural patterns, and best practices across the codebase. This consistency makes the code more maintainable and reduces the cognitive load when working on different parts of the system.

Risk Mitigation

By having multiple developers familiar with different parts of the codebase through reviews, teams reduce the "bus factor" risk. Knowledge becomes distributed rather than siloed with individual developers.

Builds Team Trust

It promotes a culture of accountability, respect, and shared ownership.

How to Conduct Effective Code Reviews

For Authors

Prepare Quality Pull Requests

  • Write clear, descriptive commit messages and PR descriptions
  • Keep changes focused and reasonably sized
  • Include relevant tests and documentation updates
  • Self-review your code before submitting

Be Open to Feedback

  • View comments as opportunities to improve, not personal attacks
  • Ask for clarification when feedback isn't clear
  • Explain your reasoning when you disagree with suggestions
  • Thank reviewers for their time and insights

For Reviewers

Focus on the Right Things

  • Prioritize logic, architecture, and potential issues over minor style preferences
  • Look for security vulnerabilities, performance bottlenecks, and edge cases
  • Ensure code follows established patterns and conventions
  • Verify that tests adequately cover the changes

Provide Constructive Feedback

  • Be specific about issues and suggest solutions when possible
  • Use "we" language instead of "you" to foster collaboration
  • Prefer “Could we consider…” or “What do you think about…” instead of “This is wrong.”
  • Suggest improvements with reasoning, not authority.
  • Acknowledge good practices and clever solutions

Be Thorough but Timely

  • Review code promptly to avoid blocking team progress
  • Take time to understand the context and requirements
  • Don't rush through reviews, but don't let them drag on unnecessarily

Best Practices

Create a Positive Review Culture

Build Trust, Not Blame Code review should never be about pointing fingers or assigning blame when issues are found. Instead, it's about collective ownership of code quality. When bugs slip through review, the focus should be on improving the process, not finding who to blame.

Foster Learning and Growth Encourage questions and discussions during reviews. Junior developers should feel comfortable asking about unfamiliar patterns, while senior developers should be open to learning new approaches. Every review is a chance to share knowledge and grow together.

Maintain Team Unity Remember that everyone is working toward the same goal: building great software. Reviews should strengthen team bonds, not create division. Celebrate good code and creative solutions, and approach problems as challenges to solve together.

Technical Best Practices

Review Strategy

  • Review code in small, manageable chunks rather than massive changes
  • Focus on one logical change per pull request
  • Use automated tools for style and simple rule checking
  • Prioritize human review time for complex logic and architecture decisions

Communication Guidelines

  • Use clear, actionable language in comments
  • Distinguish between "must fix" issues and suggestions for improvement
  • Provide context for your feedback, especially when suggesting alternatives
  • Follow up on discussions to ensure resolution

Process Efficiency

  • Establish clear criteria for when code is ready to merge
  • Define who needs to review what types of changes
  • Set expectations for review turnaround times
  • Use draft PRs for early feedback on work in progress

Handling Disagreements

Embrace Healthy Debate Disagreements about implementation approaches are natural and valuable. When they arise, focus on the technical merits of different solutions rather than personal preferences. Document the reasoning behind decisions for future reference.

Escalation Path When reviewers and authors can't reach consensus, have a clear process for escalation. This might involve bringing in a senior developer, architect, or having a team discussion to make the final decision.

Building a Strong Review Culture

Psychological Safety

Create an environment where team members feel safe to make mistakes and learn from them. Code review should be a supportive process that helps everyone improve, not a gatekeeping mechanism that creates anxiety.

Continuous Improvement

Regularly discuss and refine your review process. What's working well? What could be improved? Are reviews helping the team learn and grow? Use retrospectives to evolve your practices.

Recognition and Appreciation

Acknowledge good reviews and thoughtful feedback. Recognize team members who consistently provide helpful insights or who have improved significantly through the review process.

Conclusion

Code review is far more than a quality control mechanism—it's a cornerstone of effective software development that builds stronger teams, better code, and shared understanding. When approached with the right mindset, code reviews become opportunities for learning, knowledge sharing, and collective growth.

Remember: we're all on the same team, working toward the same goals. Code review is how we support each other in building software we can all be proud of. Every comment, every suggestion, and every discussion makes us stronger as developers and as a team.

The goal isn't perfection in every line of code—it's continuous improvement, shared learning, and building software that serves our users well. When code review is done with trust, respect, and a commitment to collective success, it becomes one of the most valuable practices a development team can embrace.

References

Introduction to ADR

· 3 min read
Daniel Guo
Software Engineer

What and why

Architecture Decision Record (ADR) is a document that captures an important architecture decision made along with its context and consequences.

Architecture decision logs are answering the why? questions which are important in your designs, for example:

  • Why did you decide for Trunk-based branching strategy, rather than GitFlow?
  • Why do we use Plumi for infrastructure as code, while Terraform seems more popular and widely adopted?
  • Shouldn't we use a relational database instead of DynamoDB(NoSQL) as the source of truth for this system? ...

There are no reasons not to document the key decisions and provide short but solid justifications for your options (patterns, tech stacks etc.) chosen.