You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ddc427
Browse filesBrowse the repository at this point in the historyBrowse files
docs(contributing): bring the guide up to date and point agents at it
The release section predated the examples project and the module descriptor, and the Javadoc rule contradicted what doclint enforces. AGENTS.md was the only file agents read and never mentioned the guide, so it now links to it and stops restating the release steps.
Copy file name to clipboardExpand all lines: AGENTS.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,9 @@
2
2
3
3
This file provides context for AI coding agents working in this repository.
4
4
5
+
Read [CONTRIBUTING.md](CONTRIBUTING.md) first: it carries the rules a contribution is judged against and the release procedure, and it applies to agents exactly as it does to people.
6
+
This file covers the mechanics of the codebase and does not repeat them.
7
+
5
8
## Project Overview
6
9
7
10
**spotify-web-api-java** is a Java wrapper library for the [Spotify Web API](https://developer.spotify.com/documentation/web-api/). It provides typed request builders and model objects for all Spotify API endpoints.
@@ -98,7 +101,8 @@ It checks that every `SpotifyApi` method has an example, that example file names
98
101
99
102
### Releasing
100
103
101
-
The version lives in `pom.xml`, `README.md` and `examples/pom.xml`, and `ci/check-docs.py` fails if the examples fall behind the library.
104
+
See the release workflow in [CONTRIBUTING.md](CONTRIBUTING.md#release-workflow-maintainers-only).
105
+
Note that the version lives in three files, and `ci/check-docs.py` fails when they disagree.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+35-29Lines changed: 35 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,9 @@ especially because currently only voluntary maintainers and contributors take ca
15
15
At the same time it is strongly recommended to follow certain guidelines when making contributions to open source
16
16
projects like this one. They ensure fast processing times and stable releases.
17
17
18
-
It is mandatory to stay as close to the
19
-
[Web API Endpoint Reference](https://developer.spotify.com/web-api/endpoint-reference/) as possible. Before changing
18
+
It is mandatory to stay as close to Spotify's own API description as possible.
19
+
A copy of it is vendored at `spec/openapi.yaml`, and that copy is what `ci/check-docs.py` checks a request's verb, path and deprecation against, so it is the first place to look rather than the
20
+
[Web API Endpoint Reference](https://developer.spotify.com/documentation/web-api/reference/). Before changing
20
21
anything in the code base, make sure to take one - or more - looks into related files/classes and [the project's
21
22
documentation](https://spotify-web-api-java.github.io/spotify-web-api-java/apidocs/). The whole code follows simple
22
23
and consistent code conventions for naming rules and alike. Those should be easy to grasp by comparing to the online
@@ -37,10 +38,17 @@ A complete contribution includes the following features:
37
38
Make sure that your contribution embeds well into the already existing code. For example, the unified folder/package
38
39
structure must be used wherever possible.
39
40
41
+
The library is an explicit Java module, so a class in a **new** package is unreachable for callers until that package is added to `exports` in `src/main/java/module-info.java`.
42
+
The examples are compiled as a separate module against the built library, which is what turns a forgotten `exports` into a build failure here rather than in someone else's project.
43
+
40
44
### Documentation
41
-
Document your source code! It's easy because one can most likely just stick to the online API reference. This is a
42
-
requirement. Not because your contributed source code is unreadable. Instead, the aim is to keep the Javadoc complete
43
-
and - accompanying this - to keep this project as accessible as possible to developers like yourself.
45
+
Document what a reader of the published API reference needs: types, getters and the methods on `SpotifyApi`.
46
+
Model builder setters and default constructors deliberately carry no prose, because restating the signature adds nothing that the matching getter does not already say, so Javadoc runs with `doclint` set to `all,-missing`.
47
+
48
+
What is still enforced is that every reference resolves: a dead `{@link}` fails the build, and the Javadoc step runs in CI before a tag can publish anything.
49
+
50
+
A new endpoint also needs an example under `examples/` and a link from the index in `README.md`, and a renamed or removed public name needs an entry in `MIGRATION.md`.
51
+
`ci/check-docs.py` fails without them.
44
52
45
53
### Test Coverage
46
54
Unit tests help to assure that functionality works. Due to that contribution approval requires them to be included for
@@ -49,40 +57,38 @@ none below. For arrays the length is to be checked.
49
57
50
58
#### Fixtures
51
59
A unit test builds upon JSON fixtures. For code changes, fixture files must only be updated when...
52
-
- the online examples change
53
-
- the online examples are outdated, compared against the reference description and/or the
54
-
[Web API Object Model](https://developer.spotify.com/web-api/object-model/).
60
+
- the responses Spotify actually returns change
61
+
- a fixture is outdated, compared against the schema for that response in `spec/openapi.yaml`
55
62
56
63
## Contribution Flow
57
64
1. Create a fork from this repository
58
65
2. Create a branch in your fork in which you develop your contribution (one branch per feature/fix)
59
66
3. Create meaningful and well-separated commits
60
67
4. Make sure your contribution follows the contribution guidelines above
61
-
5. Create a pull request from your feature branch to the correct branch of this project
68
+
5. Create a pull request against the branch the change belongs on:
69
+
-`main` carries the current stable line, and is where fixes and dependency updates for the released version go
70
+
-`beta` accumulates the next pre-release, and is where anything that changes the public API belongs, breaking changes and new endpoints alike
71
+
72
+
Nothing reaches `main` from `beta` except through the release pull request, so a change that cannot ship in a patch release belongs on `beta` even when it looks small. Ask in the issue if you are unsure.
62
73
63
74
## Release Workflow (Maintainers Only)
64
75
65
76
Follow these steps to publish a new release:
66
77
67
78
### 1. Update version numbers
68
79
69
-
Update the version string in **three places**:
80
+
The version lives in **three files**:
81
+
82
+
-**`pom.xml`** — the `<version>` element near the top
83
+
-**`README.md`** — two occurrences, the Maven `<version>` snippet and the Gradle `implementation` line
84
+
-**`examples/pom.xml`** — the examples are a separate Maven project, so they carry their own copy
70
85
71
-
-**`pom.xml`** — the `<version>` element near the top of the file:
72
-
```xml
73
-
<version>X.Y.Z</version>
74
-
```
75
-
-**`README.md`** — two occurrences: the Maven `<version>` snippet and the Gradle `implementation` line:
`ci/check-docs.py` fails the build when `examples/pom.xml` falls behind `pom.xml`, so a missed bump is caught rather than shipped.
82
87
83
88
### 2. Regenerate Javadoc
84
89
85
-
The `apidocs/` directory at the project root is the published API documentation and must be regenerated on every release. The `release` Maven profile is configured to delete `apidocs/` and regenerate it.
90
+
The `apidocs/` directory at the project root is the published API documentation and must be regenerated on every release.
91
+
The `release` profile deletes and regenerates it, and because the library is an explicit module, Javadoc writes the pages under `apidocs/se.michaelthelin.spotify/`.
86
92
87
93
Run:
88
94
```bash
@@ -96,23 +102,23 @@ This will:
96
102
97
103
### 3. Commit and tag
98
104
99
-
Commit all changed files (version bumps + regenerated `apidocs/`):
105
+
Pre-releases are cut from `beta` and tagged `X.Y.Z-RCN`; stable releases are cut from `main` and tagged `X.Y.Z`. CI reacts to both patterns and to nothing else.
106
+
107
+
Commit the version bumps together with the regenerated documentation:
Create a lightweight Git tag matching the version exactly (the CI tag pattern is `X.Y.Z` or `X.Y.Z-RCN`):
113
+
Create a lightweight tag matching the version exactly, and push the commit before the tag so CI validates the code before it publishes anything:
106
114
```bash
107
115
git tag X.Y.Z
108
-
```
109
-
110
-
Push the commit and tag:
111
-
```bash
112
116
git push origin <branch>
113
117
git push origin X.Y.Z
114
118
```
115
119
120
+
A pre-release line becomes stable by merging `beta` into `main` through the release pull request and tagging there. That merge is also what publishes the documentation, since GitHub Pages serves from `main`.
121
+
116
122
### 4. Automated release via CI
117
123
118
124
Pushing a tag triggers the GitHub Actions CI workflow (`.github/workflows/ci.yml`), which automatically:
0 commit comments