Skip to content

Commit 04b0399

Browse files
add CONTRIBUTING and SECURITY
1 parent 81fda8f commit 04b0399

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Contributing to testingbot-java
2+
3+
Thanks for considering a contribution. This is a small library wrapping
4+
the TestingBot REST API; PRs that improve correctness, add missing
5+
endpoints, or tighten the documentation are welcome.
6+
7+
## Building locally
8+
9+
The project targets **Java 1.7 bytecode** so it remains usable by older
10+
consumers, but it requires a JDK that still supports `-target 1.7`
11+
(JDK 8, 11, or 17 — JDK 20+ dropped support).
12+
13+
```bash
14+
export JAVA_HOME=$(/usr/libexec/java_home -v 11) # macOS
15+
mvn install -Dgpg.skip=true -B -V # what CI runs
16+
```
17+
18+
## Running tests
19+
20+
There are three test classes:
21+
22+
- **`TestingbotRestOfflineTest`** — unit tests; no credentials needed.
23+
- **`TestingbotRestMockTest`** — every endpoint, against a local
24+
`HttpServer`; no credentials needed.
25+
- **`TestingBotRestTest`****live integration tests** against the real
26+
TestingBot API. Requires `TB_KEY` and `TB_SECRET` environment
27+
variables for a valid TestingBot account, and depends on real account
28+
state (e.g. `testGetTests` expects ≥10 existing tests).
29+
30+
Run only the offline tests:
31+
32+
```bash
33+
mvn -Dtest='TestingbotRestOfflineTest,TestingbotRestMockTest' \
34+
-DfailIfNoTests=false test
35+
```
36+
37+
Run a single test method:
38+
39+
```bash
40+
mvn test -Dtest=TestingBotRestTest#testGetTest
41+
```
42+
43+
## Coding guidelines
44+
45+
- **Keep new code Java 1.7-compatible** (try-with-resources is fine; no
46+
`var`, no `Optional`, no `java.util.Base64`, no Map.of).
47+
- **SpotBugs** runs at the compile phase with effort=Max / threshold=Low
48+
and **fails the build** on findings. Suppressions live in
49+
`findbugs-exclude.xml` — only add a `<Match>` for genuine false
50+
positives, not to mask new issues.
51+
- **Backward compatibility.** This is a published Maven Central library;
52+
do not change existing public method signatures, field types, or model
53+
field names. Add new methods/fields rather than altering old ones.
54+
- **Tests for every new endpoint.** New public methods should land with
55+
a matching test in `TestingbotRestMockTest` asserting the HTTP method,
56+
path, and any form/query encoding.
57+
58+
## Submitting a PR
59+
60+
1. Open an issue first for anything beyond a small fix, so we can agree
61+
on the approach.
62+
2. Keep PRs focused — one logical change per PR.
63+
3. Update `README.md` if you add or change public methods.
64+
65+
## Releasing (maintainers only)
66+
67+
Releases are tag-driven via `.github/workflows/release.yml`. Push a tag
68+
(`v1.x.y` or `testingbotrest-1.x.y`) and the workflow sets the version,
69+
runs the live test suite, signs and publishes to Maven Central via the
70+
Sonatype Central Portal, and creates a GitHub Release with the jars
71+
attached. See `CLAUDE.md` for the list of required GitHub secrets.

SECURITY.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Security Policy
2+
3+
## Reporting a vulnerability
4+
5+
If you believe you've found a security issue in `com.testingbot:testingbotrest`
6+
or in the TestingBot service it talks to, please report it privately rather
7+
than opening a public GitHub issue.
8+
9+
**Email:** `info@testingbot.com` (subject line: "Security:
10+
testingbot-java <short description>")
11+
12+
If you'd like to use PGP, the maintainer's public key is published on the
13+
common keyservers under the email above.
14+
15+
Please include:
16+
17+
- The version of `testingbotrest` you tested against
18+
- A minimal reproduction (code snippet, request/response, etc.)
19+
- Your assessment of impact and any suggested mitigation
20+
21+
We aim to acknowledge new reports within 3 business days and provide a fix
22+
or mitigation plan within 30 days. Disclosure timing will be coordinated
23+
with you.
24+
25+
## Supported versions
26+
27+
Only the latest minor release line of `testingbotrest` is supported with
28+
security fixes. Older versions may receive backports at the maintainer's
29+
discretion.

0 commit comments

Comments
 (0)