Software Engineering
The complete Protobuf platform
Accelerate gRPC adoption with the Buf Schema Registry — built by the world's Protobuf experts.
Accelerate gRPC adoption with the Buf Schema Registry — built by the world's Protobuf experts.
Buf
Build & Deployments
Our build process starts by pushing changes to a repository on GitHub. When code is pushed to a repository through a pull request, it triggers a job to build the changes made to the branch and deploy them in isolation. This worklow happens interactively within the pull request, where the author has visibility of all steps.
So... See more
Our build process starts by pushing changes to a repository on GitHub. When code is pushed to a repository through a pull request, it triggers a job to build the changes made to the branch and deploy them in isolation. This worklow happens interactively within the pull request, where the author has visibility of all steps.
So... See more
How we approach CI/CD · Resend
Shipping to production
Before shipping to production, we think about all the different artifacts that might be affected by a new feature.
Here's a non-exhaustive list of things we ask ourselves:
Before shipping to production, we think about all the different artifacts that might be affected by a new feature.
Here's a non-exhaustive list of things we ask ourselves:
- Does the API need to be updated?
- Is the OpenAPI spec up to date now?
- Have we released all the official SDKs?
- Do we need to write a Changelog post to announce th
How we ship new features · Resend
Using feature flags
It's always a good idea to put new features behind a feature flag.
This contributes to a rollout strategy that can surface user feedback in a much more contained and safe environment.
When thinking about how to rollout a new feature to users, first think about your peers. Many of the Resend team members also use Resend on their ow... See more
It's always a good idea to put new features behind a feature flag.
This contributes to a rollout strategy that can surface user feedback in a much more contained and safe environment.
When thinking about how to rollout a new feature to users, first think about your peers. Many of the Resend team members also use Resend on their ow... See more
How we ship new features · Resend
We ship often
Shipping early is not enough. We also need to keep shipping tiny iterations daily instead of waiting months to ship something big.
Having a strong sense of urgency , and making hard decisions fast is how we enable that process. Our sprints only last 1 week and are quite short when compared to the rest of the industry - this is by desig... See more
Shipping early is not enough. We also need to keep shipping tiny iterations daily instead of waiting months to ship something big.
Having a strong sense of urgency , and making hard decisions fast is how we enable that process. Our sprints only last 1 week and are quite short when compared to the rest of the industry - this is by desig... See more
How we ship new features · Resend
We ship early
We constantly review the scope of a project and work toward a v0, not a v1.
That means identifying the most crucial part of a functionality , and pushing the smallest pull request possible to make that happen. In fact, a PR should always be optimized for the speed with which we can merge it in.
We constantly review the scope of a project and work toward a v0, not a v1.
That means identifying the most crucial part of a functionality , and pushing the smallest pull request possible to make that happen. In fact, a PR should always be optimized for the speed with which we can merge it in.
How we ship new features · Resend
The book Clean Code introduces three laws of TDD [1]:
So, the tests are written before the production code. This leads to the developer ... See more
- Write a failing unit test first before you start writing production code.
- Write not more of a unit test than is sufficient to fail.
- Write not more production code than is sufficient to pass the currently failing test.
So, the tests are written before the production code. This leads to the developer ... See more
How to Write Clean Code in Python
But now we are only logging that error message. It would be better to define a custom Exception that we can then handle in our API in order to return a specific error code to the user:
import pandas as pd
import logging
class DataLoadError(Exception):
"""Exception raised when the data cannot be loaded."""
def __init__(self, message="Data could not be lo... See more
import pandas as pd
import logging
class DataLoadError(Exception):
"""Exception raised when the data cannot be loaded."""
def __init__(self, message="Data could not be lo... See more
How to Write Clean Code in Python
And then, in the primary function of your API:
try:
df = load_data('path/to/data.csv')
# Further processing and model prediction
except DataLoadError as e:
# Return a response to the user with the error message
# For example: return Response({"error": str(e)}, status=400)
Some important formatting rules available in this style guide:
But remember: The formatting rules should make the code more readable. Sometimes, a... See more
- Use four spaces for code indentation
- Limit all lines to a maximum of 79 characters
- Avoid extraneous whitespace in certain situations (i.e., inside brackets, between trailing comma and close parenthesis, ...)
But remember: The formatting rules should make the code more readable. Sometimes, a... See more
How to Write Clean Code in Python
Comments are helpful sometimes. But sometimes, they are just an indication of bad code.The proper use of comments is to compensate for our failure to express ourself in code [1].Whenever you have to add a comment in your code, ask yourself if it is really required or if you could instead put that into a new function and name the function so that it... See more