Skip to content

Commit 34f8fb1

Browse files
authored
Add development principles (GoogleCloudPlatform#56)
1 parent be65dd1 commit 34f8fb1

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

Diff for: CONTRIBUTING.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
We'd love to accept your patches and contributions to this project. There are
44
just a few small guidelines you need to follow.
55

6+
## Development Principles (for Googlers)
7+
8+
There are a few principles for developing or refactoring the service
9+
implementations. Read the [Development Principles
10+
Guide](./docs/development-principles.md).
11+
612
## Contributor License Agreement
713

814
Contributions to this project must be accompanied by a Contributor License

Diff for: docs/development-principles.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Development Principles
2+
3+
> **Note:** This document outlines guidances behind some development decisions
4+
> behind the Hipster Shop demo application.
5+
6+
### Minimal configuration
7+
8+
Running the demo locally or on GCP should not require minimal to no
9+
configuration unless absolutely necessary to run critical parts of the demo.
10+
11+
Configuration that takes multiple steps, especially such as creating service
12+
accounts should be avoided.
13+
14+
### App must work well outside GCP
15+
16+
Demo application should work reasonably well when it is not deployed to GCP
17+
services. The experience of running the application locally or on GCP should
18+
be close.
19+
20+
For example:
21+
- OpenCensus prints the traces to stdout when it cannot connect to GCP.
22+
- Stackdriver Debugging tries connecting to GCP multiple times, eventually gives
23+
up.
24+
25+
### Running on GCP must not reduce functionality
26+
27+
Running the demo on the GCP must not reduce/lose any of the capabilities
28+
developers have when running locally.
29+
30+
For example: Logs should still be printed to stdout/stderr even though logs are
31+
uploaded to Stackdriver Logging when on GCP, so that developers can use "kubectl
32+
logs" to diagnose each container.
33+
34+
### Microservice implementations should not be complex
35+
36+
Each service should provide a minimal implementation and try to avoid
37+
unnecessary code and logic that's not executed.
38+
39+
Keep in mind that any service implementation is a decent example of “a GRPC
40+
application that runs on Kubernetes”. Keeping the source code short and
41+
navigable will serve this purpose.
42+
43+
It is okay to have intentional inefficiencies in the code as they help
44+
illustrate the capabilities of profiling and diagnostics offerings.

0 commit comments

Comments
 (0)