Skip to content

Commit 667d77e

Browse files
authored
chore: add AGENTS.md (#3579)
1 parent b4ecd7d commit 667d77e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

AGENTS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# OpenMeter
2+
3+
## Tips for working with the codebase
4+
5+
Development commands are run via `Makefile`, it contains all commonly used commands during development. `Dagger` and `justfile` are also present but seldom used. Use the Makefile commands for common tasks like running tests, generating code, linting, etc.
6+
7+
## Testing
8+
9+
To run all tests, invoke `make test` or `make test-nocache` if you want to bypass the test cache.
10+
11+
When running tests for a single file or testcase (invoking directly and not with Make), make sure the environment is set correctly. Examples of a correct setup can be found in the `Makefile`'s `test` command, or in `.vscode/settings.json` `go.testEnvVars`. Example command would be:
12+
13+
E2E tests are run via `make etoe`, they are API tests that need to start dependencies via docker compose, always invoke them via Make.
14+
15+
## Code Generation
16+
17+
Some directories are generated from code, never edit them manually. A non-exhaustive list of them is:
18+
- `make gen-api`: generates from TypeSpec
19+
- the clients in `api/client`
20+
- the OAPI spec in `api/openapi.yaml`
21+
- `make generate`: runs go codegen steps
22+
- database access in `**/ent/db` from the ent schema in `**/ent/schema`
23+
- dependency injection with wire in `**/wire_gen.go` from `**/wire.go`
24+
- `atlas migrate --env local diff <migration-name>`: generates a migration diff from changes in the generated ent schema (in `tools/migrate/migrations`)
25+

0 commit comments

Comments
 (0)