-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRIVERS-2881 Render documentation on ReadTheDocs #1584
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Read the Docs configuration file for MkDocs projects | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
|
||
mkdocs: | ||
configuration: mkdocs.yml | ||
|
||
# Optionally declare the Python requirements required to build your docs | ||
python: | ||
install: | ||
- requirements: source/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
site_name: MongoDB Specifications | ||
docs_dir: source | ||
nav: | ||
- 'index.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Driver Mantras | ||
|
||
When developing specifications -- and the drivers themselves -- we follow the following principles: | ||
|
||
### Strive to be idiomatic, but favor consistency | ||
|
||
Drivers attempt to provide the easiest way to work with MongoDB in a given language ecosystem, while specifications | ||
attempt to provide a consistent behavior and experience across all languages. Drivers should strive to be as idiomatic | ||
as possible while meeting the specification and staying true to the original intent. | ||
|
||
### No Knobs | ||
|
||
Too many choices stress out users. Whenever possible, we aim to minimize the number of configuration options exposed to | ||
users. In particular, if a typical user would have no idea how to choose a correct value, we pick a good default instead | ||
of adding a knob. | ||
|
||
### Topology agnostic | ||
|
||
Users test and deploy against different topologies or might scale up from replica sets to sharded clusters. Applications | ||
should never need to use the driver differently based on topology type. | ||
|
||
### Where possible, depend on server to return errors | ||
|
||
The features available to users depend on a server's version, topology, storage engine and configuration. So that | ||
drivers don't need to code and test all possible variations, and to maximize forward compatibility, always let users | ||
attempt operations and let the server error when it can't comply. Exceptions should be rare: for cases where the server | ||
might not error and correctness is at stake. | ||
|
||
### Minimize administrative helpers | ||
|
||
Administrative helpers are methods for admin tasks, like user creation. These are rarely used and have maintenance costs | ||
as the server changes the administrative API. Don't create administrative helpers; let users rely on "RunCommand" for | ||
administrative commands. | ||
|
||
### Check wire version, not server version | ||
|
||
When determining server capabilities within the driver, rely only on the maxWireVersion in the hello response, not on | ||
the X.Y.Z server version. An exception is testing server development releases, as the server bumps wire version early | ||
and then continues to add features until the GA. | ||
|
||
### When in doubt, use "MUST" not "SHOULD" in specs | ||
|
||
Specs guide our work. While there are occasionally valid technical reasons for drivers to differ in their behavior, | ||
avoid encouraging it with a wishy-washy "SHOULD" instead of a more assertive "MUST". | ||
|
||
### Defy augury | ||
|
||
While we have some idea of what the server will do in the future, don't design features with those expectations in mind. | ||
Design and implement based on what is expected in the next release. | ||
|
||
Case Study: In designing OP_MSG, we held off on designing support for Document Sequences in Replies in drivers until the | ||
server would support it. We subsequently decided not to implement that feature in the server. | ||
|
||
### The best way to see what the server does is to test it | ||
|
||
For any unusual case, relying on documentation or anecdote to anticipate the server's behavior in different | ||
versions/topologies/etc. is error-prone. The best way to check the server's behavior is to use a driver or the shell and | ||
test it directly. | ||
|
||
### Drivers follow semantic versioning | ||
|
||
Drivers should follow X.Y.Z versioning, where breaking API changes require a bump to X. See | ||
[semver.org](https://semver.org/) for more. | ||
|
||
### Backward breaking behavior changes and semver | ||
|
||
Backward breaking behavior changes can be more dangerous and disruptive than backward breaking API changes. When | ||
thinking about the implications of a behavior change, ask yourself what could happen if a user upgraded your library | ||
without carefully reading the changelog and/or adequately testing the change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mkdocs |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to its own file in the source tree since it was referenced from the CMAP spec.