* docs: standardize Java code style rules AGENTS.md becomes the canonical Code Style source, regrouped into General, Types and names, Imports, conventions the codebase already follows, and Tests. Two new rules: write explicit types rather than var, and import classes rather than writing fully-qualified names inline. Both are stated with the reason they matter here, that the concrete type at a call site is usually what a wire contract reviewer needs to see, and with the one exception each: record deconstruction patterns for var, and genuine same-file name collisions for qualified names. The rest is existing practice written down so it stays true. Each claim was measured against src/main and src/test: no printStackTrace, no logger field named anything but LOG, no Calendar and no SimpleDateFormat. The System.out rule exempts CLI entry points under tools/, which is its one real use. The empty-catch rule now blesses naming the variable ignored or expected, the convention the code already uses. Two conventions are stated with the exceptions the tree actually contains rather than as absolutes. java.util.Date survives where a third-party signature forces it, in the BouncyCastle certificate builder and the JAX-RS HttpHeaders.getDate() override, so the rule is java.time on Floci's side and conversion at that boundary. Tab indentation is banned as such, since a JSON text block may legitimately contain a tab as string content. CONTRIBUTING.md and docs/contributing.md had no code style section at all, and copilot-instructions.md had no code style content, so PR review could not flag either new rule. The Copilot entry also lists the collisions it must not flag. Existing code does not satisfy these everywhere. The rules are documentation only: nothing in CI enforces them, and no Java file changes here. * docs: correct the measured claims in the code style section Review on #3451 caught that System.out is not confined to the tools CLI: four test files print too. Checking the rest of the section the same way found five more claims that do not survive a measurement, so this corrects all six rather than only the reported one. The section's whole value is that a reader can trust it without re-measuring. System.out and System.err are now scoped to src/main, the way the wildcard import rule already splits src/main from tests. The exception is named by its real coordinates: AmiImageTool sits in the Java package io.github.hectorvent.floci.tools.ami, not in the top-level tools/ directory, which holds only tools/docs. printStackTrace stays absolute, since that one holds: zero in src/main and src/test. The Date rule listed two forced boundaries and there are three. BouncyCastle's certificate builder and the JAX-RS HttpHeaders.getDate() override are joined by JDBC's java.sql.Date, which extends java.util.Date and which the old wording read as prohibiting, in RdsDataFieldMapper and RdsDataSqlParameters. Optional is split, because half the claim was true. Never a field is exact, there are none. Never a parameter was wrong: Quarkus threads @ConfigProperty Optional<T> values through parameters in ResolvedServiceCatalog, ContainerBuilder, DockerClientProducer and LaunchedContainerAwsEnv. The three Tests rules each asserted something false. testX is not absent, it names 291 methods across 52 files, so it is described as the older pattern not to copy rather than as something that never happens. AssertJ is not absent either, it is a declared test dependency used by the six Lambda launcher tests. @DisplayName is genuinely rare in src/test, 13 files of 1455, but it is the norm in compatibility-tests at 183 of 208, as is AssertJ at 197 of 208. That module has the opposite idiom, so the Tests rules now say they describe src/test and point a contributor at the module they are in. Documentation only. No Java file changes here.
6.0 KiB
Contributing
Floci is MIT licensed and welcomes contributions of all kinds.
Join us on Slack: the fastest way to reach maintainers for questions, design tradeoffs, or feedback on an approach before you build it.
Ways to Help
- Bug reports: open a GitHub issue with a minimal reproduction
- Missing API actions: open a feature request
- Pull requests: new service actions, bug fixes, documentation improvements
Development Setup
# Clone
git clone https://github.com/floci-io/floci.git
cd floci
# Run in dev mode (hot reload, port 4566)
mvn quarkus:dev
# Run all tests
mvn test
# Run a specific test
mvn test -Dtest=SsmIntegrationTest
mvn test -Dtest=SsmIntegrationTest#putParameter
Commit Message Format
This project uses Conventional Commits, required for semantic-release to generate the changelog and version bumps automatically.
The PR title is validated automatically by CI and must follow this format, since it becomes the squash-merge commit message that semantic-release reads.
Format
<type>[optional scope]: <description>
| Type | Effect |
|---|---|
feat |
New feature → minor version bump |
fix |
Bug fix → patch version bump |
perf |
Performance improvement → patch |
revert |
Reverts a previous commit → patch |
docs |
Documentation only → no version bump |
style |
Formatting, whitespace → no version bump |
chore |
Build/CI/housekeeping → no version bump |
refactor |
Code restructure → no version bump |
test |
Adding/updating tests → no version bump |
build |
Build system changes → no version bump |
ci |
CI workflow changes → no version bump |
feat!: or BREAKING CHANGE: |
Breaking change → major bump |
Valid examples ✅
feat(dynamodb): add PartiQL ExecuteStatement support
fix(s3): make us-east-1 bucket creation idempotent
chore: release 1.5.16
feat!: remove legacy v1 endpoint
ci: add conventional commits lint workflow
Invalid examples ❌
Add PartiQL support # missing type
Feature: add something # not a valid type
feat : space before colon # space before colon
FIX(s3): uppercase type # type must be lowercase
feat(my scope): spaces in scope # scope cannot contain spaces
wip: still working on this # not a recognised type
Adding a New AWS Service
See AGENTS.md for the full architecture guide. AGENTS.md is the canonical agent instructions file for this repository, following the AGENTS.md standard. If your coding agent expects a different filename, create a local symlink to AGENTS.md instead of copying it.
ln -s AGENTS.md CLAUDE.md
ln -s AGENTS.md GEMINI.md
ln -s AGENTS.md COPILOT.md
Quick summary:
- Create
src/main/java/.../services/<service>/with a Controller, Service, andmodel/package - Pick the right protocol (see the protocol table in
AGENTS.md) - Register a
ServiceDescriptorinResolvedServiceCatalog(ServiceRegistryonly reads the catalog) - Add config in
EmulatorConfig.javaand in both the main and testapplication.yml - Add
*ServiceTest.javaand*IntegrationTest.javatests - Add the docs page, its
mkdocs.ymlnav entry, a Service Matrix row and a README row (make docs-checkgates the matrix)
Code Style
AGENTS.md carries the full list. The ones worth knowing before your first PR:
- Write explicit types. Do not use
var. Floci reproduces AWS wire contracts, so the concrete type at a call site is usually what a reviewer needs to see. The one exception is a record deconstruction pattern. - Import the classes you use. No fully-qualified names inline.
new ArrayList<>(), nevernew java.util.ArrayList<>(). Qualify only for a real name collision in that file, and say in a comment what collides. - No wildcard imports in
src/main. Static wildcards are fine in tests. - Never leave a
catchblock empty. If swallowing is correct, name the variableignoredorexpectedand say why in a comment. - Always use braces in conditionals, and use constructor injection.
- Tests: JUnit 5 with Hamcrest and RestAssured. Name methods as a camelCase
sentence or
method_scenario_expectation, nevertestX.
Existing code does not yet satisfy all of these everywhere. Match them in code you add or change, and leave unrelated cleanups for their own PR.
Pull Request Checklist
mvn testpasses- New or updated integration test added
- Commit messages follow Conventional Commits
- Code follows the style rules above
Please keep at most 5 open PRs at a time. A bot leaves an advisory note (label over-pr-limit) on PRs opened beyond that. See CONTRIBUTING.md for details.
Releases
Stable releases ship on the 1st and 3rd Tuesday of each month. Merging to main does not cut a release: the change rides the next train, and reaches the nightly image on the next nightly build.
Maintainers cut releases from main with the Release Cut workflow, which runs semantic-release over the Conventional Commits since the last tag. That is why the commit type matters: feat: and fix: move the version, docs: and chore: do not. CHANGELOG.md is generated from those messages and is not edited by hand; a genuine correction goes in a PR carrying the changelog-edit label.
Reporting Security Issues
Do not open public issues for security vulnerabilities. Use GitHub private vulnerability reporting instead.