Skip to content

Commit 6018809

Browse files
committed
add AGENTS.md and a basic readme for the SDK
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 61b3701 commit 6018809

3 files changed

Lines changed: 79 additions & 2 deletions

File tree

.github/pull_request_template.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<!--
2-
32
Thanks for creating a pull request!
43
If this is your first time, please make sure to review CONTRIBUTING.md.
5-
64
-->
75

86
## Summary

AGENTS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AI Agent Configuration
2+
3+
## Development
4+
5+
* Use `make imports` before committing any change to Go code.
6+
* Use `go mod tidy` after any change to a `go.mod`.
7+
* Run `make lint` and fix all reported issues before submitting a pull request.
8+
* Run the e2e tests before submitting a pull request.
9+
* When possible, try to keep pull requests small and self-contained to make reviews easier. Follow
10+
the repository's `.github/pull_request_template.md` and make sure to focus more on the reasons,
11+
background and encountered problems that motivated the change and less on reiterating code
12+
changes.
13+
14+
## Documentation
15+
16+
* Lines in Markdown files should not exceed 100 characters (use explicit line breaks).
17+
18+
## Testing Instructions
19+
20+
* Use `make clean build test-e2e` for running e2e tests.
21+
* To run a specific test package, use the `WHAT` environment variable, like
22+
`WHAT=./test/e2e/apiexport make test-e2e`, or the `TEST_FLAGS` variable like
23+
`TEST_FLAGS="-v -run NameOfTheTestFunction" make test-e2e`.
24+
25+
## Changelogs
26+
27+
* When generating a changelog for a new release, group all relevant pull requests based on their
28+
`kind/...` label. Output these groups in descending order of importance.
29+
* Only include pull requests in the changelog that have a `release-note` block in their descriptions
30+
on GitHub that is not empty or `NONE`.
31+
* List each pull request in the following form: `#<number>: <release note> (by @<author>)`

sdk/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# API Sync-Agent SDK
2+
3+
This directory contains the syncagent's SDK: re-usable Go API types and generated functions for
4+
integrating the syncagent into 3rd-party applications.
5+
6+
## Usage
7+
8+
To install the SDK, simply `go get` it:
9+
10+
```bash
11+
go get github.com/kcp-dev/api-syncagent/sdk@latest
12+
```
13+
14+
and then in your code import the desired types:
15+
16+
```go
17+
package main
18+
19+
import apisyncagentv1alpha1 "github.com/kcp-dev/api-syncagent/sdk/apis/syncagent/v1alpha1"
20+
21+
func createPublishedResource() *apisyncagentv1alpha1.PublishedResource {
22+
pr := &apisyncagentv1alpha1.PublishedResource{}
23+
pr.Name = "publish-crontabs"
24+
pr.Namespace = "default"
25+
26+
return pr
27+
}
28+
```
29+
30+
## SDK Design
31+
32+
The SDK comes as a standalone Go module: `github.com/kcp-dev/api-syncagent/sdk`
33+
34+
The module reduces the transitive dependencies that consumers have to worry about when they want to
35+
integrate the syncagent. To that end, the SDK is meant to provide the broadest possible
36+
compatibility: dependencies are on the *lowest* version that is usable by the syncagent. This drift
37+
between the syncagent's dependencies and those of the SDK is an intended feature of the SDK.
38+
39+
The actual dependency versions used in the syncagent binaries are controlled exclusively via the
40+
root directory's `go.mod`. Specifically, the SDK is not meant to propagate security fixes to
41+
consumers and force them to upgrade when it might be inconvenient to them.
42+
43+
## Development Guidelines
44+
45+
* Do not update the `go` constraint in the `go.mod` file manually, let `go mod tidy` update it only
46+
when necessary. The `go` constraint has no influence on what Go version the syncagent is actually
47+
built with. It can, however, cause serious annoyances for downstream consumers.
48+
* Likewise, only bump dependencies to keep the SDK compatible with the main module.

0 commit comments

Comments
 (0)