Skip to content

Commit d6c2783

Browse files
authored
docs: refresh contributor flow + add OSS-standard templates (#16)
CONTRIBUTING.md edits (targeted, preserve existing structure): - Add Java 17 baseline section near top — explicit list of Java 21+ APIs / language features to avoid (List.getFirst/getLast, Thread.threadId, switch type/deconstruction patterns, case null+default, List.reversed) so contributors don't get surprised by Linux CI on JDK 17. - Update branch-naming hint to also accept issue-prefixed names like 42/fix/short-description. - Refresh "Required CI checks" list to reflect post-v1.6 reality: JDK 17/21/25 matrix on Build and run tests, plus the new Examples Generation Smoke Test and the PR-only Performance Smoke Check. - Rewrite the Release flow subsection so it matches what cut-release.ps1 actually does today: bumps in *all three* POMs (root + examples + benchmarks), README install snippets intentionally pinned to the previously published tag until JitPack BUILD SUCCESS confirms the new build, tag from develop (not main), post-release commit flips snippets after the publish window closes. - Replace dead test references (BuiltInTemplateRenderTest, CvTemplateV1LayoutSnapshotTest — both deleted with Templates v2 in v1.6.0) with the v2 PresetVisualParityTest / PresetLayoutSnapshotTest pair. - Drop reference to LivePreviewProvider (file no longer in tree). New files (OSS-standard, missing until now): - .github/pull_request_template.md — checklist a contributor sees on every "New PR" page: targets develop, branch convention, Java 17 compat, CHANGELOG entry hint, README guard reminder, examples gallery row count. - .github/ISSUE_TEMPLATE/bug_report.md — repro template with canonical API skeleton + environment block. - .github/ISSUE_TEMPLATE/feature_request.md — use case + proposed API + ADR-worthy gate. - CODE_OF_CONDUCT.md — Contributor Covenant 2.1 verbatim with the maintainer email pointed at the published gmail in pom.xml. Local verification: - ./mvnw -B -ntp test -Dtest='CanonicalSurfaceGuardTest,DocumentationCoverageTest,DocumentationExamplesTest' → 25/0/0/0
1 parent 50bab91 commit d6c2783

5 files changed

Lines changed: 201 additions & 11 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Report a defect in GraphCompose
4+
title: "[BUG] "
5+
labels: bug
6+
---
7+
8+
## What I expected
9+
10+
<!-- Describe the rendered output, layout behaviour, or API contract you expected. -->
11+
12+
## What actually happened
13+
14+
<!-- Stack trace, rendered output, layout snapshot diff, mismatched pixel count, etc. Attach the produced PDF if relevant. -->
15+
16+
## How to reproduce
17+
18+
```java
19+
// Minimal, runnable Java code that triggers the issue.
20+
// Prefer the canonical `GraphCompose.document(...)` API.
21+
DocumentSession document = GraphCompose.document(Path.of("repro.pdf"))
22+
.pageSize(DocumentPageSize.A4)
23+
.create();
24+
// ...
25+
```
26+
27+
## Environment
28+
29+
- GraphCompose version: <!-- e.g. v1.6.1 -->
30+
- Java: <!-- e.g. Temurin 17.0.10 -->
31+
- OS: <!-- e.g. Windows 11 / macOS 14 / Ubuntu 24.04 -->
32+
- PDFBox: <!-- 3.0.7 unless overridden -->
33+
34+
## Additional context
35+
36+
<!-- Optional. Related issues, prior art, screenshots, layout snapshot JSON, etc. -->
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Feature request
3+
about: Propose a new feature, public API addition, or template
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
---
7+
8+
## Use case
9+
10+
<!-- What document-authoring scenario is harder than it should be today?
11+
Be concrete: a sentence or two about the document being produced and
12+
where the friction is (e.g. "invoices need a watermarked total cell
13+
that wraps long currency strings — currently I have to compose two
14+
separate cells and merge them by hand"). -->
15+
16+
## Proposed API
17+
18+
```java
19+
// Sketch the public-API shape you'd like to use.
20+
// Stick to the canonical surface: GraphCompose.document(...), DocumentSession,
21+
// document.pageFlow(...), DocumentNode + NodeDefinition, BusinessTheme.
22+
document.pageFlow().add???(...);
23+
```
24+
25+
## Alternatives considered
26+
27+
<!-- Workarounds you've tried, related issues, prior art in iText / JasperReports / openhtmltopdf, etc. -->
28+
29+
## Would this be a breaking change?
30+
31+
- [ ] No — additive only (new node, new builder method, new template preset).
32+
- [ ] Possibly — affects public-record shape, deprecates an existing API, or changes default rendering behaviour.
33+
34+
## Optional: ADR-worthy?
35+
36+
If this is a structural change (sealed hierarchy, new sub-package, new SPI), please describe the architectural impact briefly. The maintainer may ask for a draft ADR under `docs/adr/` before implementation.

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Summary
2+
3+
<!-- 1–3 sentences: what changed and why. Reference any related issue. -->
4+
5+
## Type of change
6+
7+
- [ ] Bug fix (no public API change)
8+
- [ ] New feature / public API addition
9+
- [ ] Documentation only
10+
- [ ] CI / build / tooling
11+
- [ ] Refactor (no behavioural change)
12+
13+
## Checklist
14+
15+
- [ ] **PR targets `develop`** (the integration branch); **not `main`**.
16+
- [ ] Branch name follows `<type>/<short-description>` (e.g. `feature/canvas-clip`, `fix/table-overflow`, `docs/recipe-themes`); issue-prefixed names like `42/fix/short-description` are also fine.
17+
- [ ] `./mvnw -B -ntp clean verify` passes locally.
18+
- [ ] **Java 17 compatible** &mdash; no `List.getFirst()` / `getLast()`, no `Thread.threadId()`, no switch type / deconstruction patterns, no `case null, default ->`. CI matrices Temurin 17 / 21 / 25 and will catch JDK regressions.
19+
- [ ] **Public API change** (if any): `CHANGELOG.md` entry added under the next `## v<X.Y.Z> — Planned` heading.
20+
- [ ] **README touched** (if any): `DocumentationCoverageTest.readmeShouldUseCanonicalDslAndAvoidLegacyApis` still passes &mdash; canonical fingerprints (`GraphCompose.document(`, `DocumentSession`, `document.pageFlow(`, `BusinessTheme`) preserved, no legacy tokens (`GraphCompose.pdf(`, `PdfComposer`, `CvTemplateV1`, …).
21+
- [ ] **Examples touched** (if any): runnable via `./mvnw -f examples/pom.xml exec:java -Dexec.mainClass=…`; if a new example, also added to `GenerateAllExamples` and the gallery row count in `examples/README.md`.
22+
23+
## Linked issue
24+
25+
Closes #<issue-number>

CODE_OF_CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and maintainers pledge to make participation in
6+
the GraphCompose community a harassment-free experience for everyone, regardless
7+
of age, body size, visible or invisible disability, ethnicity, sex
8+
characteristics, gender identity and expression, level of experience, education,
9+
socio-economic status, nationality, personal appearance, race, religion, or
10+
sexual identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behaviour that contributes to a positive environment:
18+
19+
- Demonstrating empathy and kindness toward other people.
20+
- Being respectful of differing opinions, viewpoints, and experiences.
21+
- Giving and gracefully accepting constructive feedback.
22+
- Accepting responsibility and apologising to those affected by our mistakes,
23+
and learning from the experience.
24+
- Focusing on what is best not just for us as individuals, but for the overall
25+
community.
26+
27+
Examples of unacceptable behaviour:
28+
29+
- The use of sexualised language or imagery, and sexual attention or advances of
30+
any kind.
31+
- Trolling, insulting or derogatory comments, and personal or political attacks.
32+
- Public or private harassment.
33+
- Publishing others' private information, such as a physical or email address,
34+
without their explicit permission.
35+
- Other conduct which could reasonably be considered inappropriate in a
36+
professional setting.
37+
38+
## Enforcement Responsibilities
39+
40+
The maintainer ([@DemchaAV](https://github.com/DemchaAV)) is responsible for
41+
clarifying and enforcing standards of acceptable behaviour and will take
42+
appropriate and fair corrective action in response to any behaviour deemed
43+
inappropriate, threatening, offensive, or harmful.
44+
45+
The maintainer has the right and responsibility to remove, edit, or reject
46+
comments, commits, code, wiki edits, issues, and other contributions that are
47+
not aligned to this Code of Conduct, and will communicate reasons for moderation
48+
decisions when appropriate.
49+
50+
## Scope
51+
52+
This Code of Conduct applies within all community spaces (this repository's
53+
issues, pull requests, discussions, and any related channels), and also applies
54+
when an individual is officially representing the community in public spaces.
55+
56+
## Enforcement
57+
58+
Instances of abusive, harassing, or otherwise unacceptable behaviour may be
59+
reported privately to the maintainer at **demchyshyn.artem@gmail.com**.
60+
All complaints will be reviewed and investigated promptly and fairly.
61+
The maintainer is obligated to respect the privacy and security of the reporter
62+
of any incident.
63+
64+
## Attribution
65+
66+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
67+
version 2.1, available at
68+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
69+
70+
[homepage]: https://www.contributor-covenant.org
71+
72+
For answers to common questions about this code of conduct, see the FAQ at
73+
https://www.contributor-covenant.org/faq.

CONTRIBUTING.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ Read these files first:
1313

1414
They explain the current public surface, the engine/template split, and the recommended extension points.
1515

16+
## Java 17 baseline
17+
18+
GraphCompose targets **Java 17+** as of v1.6.1. CI runs the full test suite against Temurin JDK 17 / 21 / 25 in parallel matrix, so JDK-incompatibility regressions fail the PR immediately.
19+
20+
When writing new code, avoid Java 21+ APIs and language constructs that don't exist in 17:
21+
22+
- `List.getFirst()` / `List.getLast()` &rarr; `list.get(0)` / `list.get(list.size() - 1)`
23+
- `Thread.threadId()` &rarr; `Thread.getId()`
24+
- `switch` with type patterns (`case Foo f -> …`) &rarr; `instanceof` if-else chains
25+
- `switch` with deconstruction patterns (`case Foo(Bar b) -> …`) &rarr; `instanceof Foo f` + `f.bar()`
26+
- `case null, default ->` &rarr; explicit `if (x == null) return …;` early return
27+
- `List.reversed()` &rarr; `Collections.reverse(new ArrayList<>(list))`
28+
1629
## Build and test
1730

1831
- The blocking validation gate for repository work is `./mvnw -B -ntp clean verify`.
@@ -33,15 +46,21 @@ GraphCompose follows a fork &rarr; feature branch &rarr; pull request flow. Exte
3346
git pull --ff-only origin develop
3447
git checkout -b feature/short-description
3548
```
36-
Use `feature/...` for new functionality, `fix/...` for bug fixes, and `docs/...` for documentation-only changes.
49+
Use `feature/...` for new functionality, `fix/...` for bug fixes, and `docs/...` for documentation-only changes. Issue-prefixed names (`42/fix/short-description`) are also welcome &mdash; convenient when the branch closes a specific issue.
3750
3. **Commit small, focused changes.** Each commit message should describe the *why*, not just the *what*. Recent commits on `develop` (`Prepare v1.5.0 release`, `Align public docs with the canonical surface`) are reasonable length and structure templates.
3851
4. **Run the validation gate locally** before opening a PR:
3952
```bash
4053
./mvnw -B -ntp clean verify
4154
```
4255
This runs the architecture-and-documentation guards plus the full test suite. The same gate runs in CI on every PR.
4356
5. **Push** your feature branch to your fork and open a pull request against `develop` on `DemchaAV/GraphCompose`. Reference any related issue and describe the user-visible change in the PR body.
44-
6. **CI runs automatically.** The required status checks are `Architecture and Documentation Guards` and `Build and run tests`. The PR cannot merge into a protected branch until both are green.
57+
6. **CI runs automatically.** Active jobs:
58+
- `Architecture and Documentation Guards` &mdash; fast canonical / engine-boundary guard tests, fail-first gate
59+
- `Build and run tests (JDK 17)`, `(JDK 21)`, `(JDK 25)` &mdash; full `mvnw verify` in parallel matrix across the supported JVMs
60+
- `Examples Generation Smoke Test` &mdash; regenerates all 26 runnable examples and uploads the PDFs as a CI artifact
61+
- `Performance Smoke Check` &mdash; PR-only coarse benchmark to catch performance regressions
62+
63+
The PR cannot merge into a protected branch until all required checks are green.
4564
7. **Address review comments**, then squash any fixup commits before merge. The maintainer merges through GitHub once review is complete.
4665

4766
### Branch protection
@@ -57,12 +76,12 @@ GraphCompose follows a fork &rarr; feature branch &rarr; pull request flow. Exte
5776

5877
### Release flow
5978

60-
1. Release prep lands on `develop` &mdash; version bump in `pom.xml` + `examples/pom.xml`, fresh CHANGELOG entry, README install snippets refreshed, migration guide updated when needed.
61-
2. The maintainer merges `develop` into `main` via pull request &mdash; this is the only path a commit takes to reach `main`.
62-
3. The maintainer tags the release on `main` (`vX.Y.Z`) and creates the GitHub release with notes copied from the matching `CHANGELOG.md` section.
63-
4. JitPack picks up the new tag automatically; the `Installation` block in the README is the consumer-facing source of truth.
79+
1. **Release prep** lands on `develop` &mdash; version bumps in `pom.xml`, `examples/pom.xml`, and `benchmarks/pom.xml`; fresh CHANGELOG entry; migration guide for minor releases. **README install snippets stay pinned to the previously published tag** (e.g. `v1.6.0`) until JitPack confirms the new build, otherwise consumers copying the snippet during the publish window hit a 404.
80+
2. **`scripts/cut-release.ps1 -Version <X.Y.Z>`** automates the bump + CHANGELOG date + commit + tag + push from `develop`. The maintainer fast-forwards `main` from `develop` after the tag lands (`git push origin develop:main`).
81+
3. **JitPack** picks up the new tag automatically. After JitPack reports `BUILD SUCCESS`, a separate post-release commit on `develop` flips the README install snippets to the new version.
82+
4. **GitHub Release** is created with notes from the matching `CHANGELOG.md` section.
6483

65-
See [docs/release-process.md](./docs/release-process.md) for the full checklist.
84+
See [docs/release-process.md](./docs/release-process.md) for the full checklist (audit gates, hotfix protocol, lessons learned).
6685

6786
## Repository map
6887

@@ -95,7 +114,7 @@ See [docs/release-process.md](./docs/release-process.md) for the full checklist.
95114
2. Keep structural cleanup separate from behavior changes whenever possible.
96115
3. If you touch public examples or screenshots, update the related docs in the same change.
97116
4. Run the smallest relevant tests while iterating, then run `./mvnw -B -ntp clean verify` before opening a pull request.
98-
5. For quick visual iteration on a template, you can use the experimental live preview tool in test scope by running [GraphComposeDevTool.java](./src/test/java/com/demcha/compose/devtool/GraphComposeDevTool.java) and editing [LivePreviewProvider.java](./src/test/java/com/demcha/preview/LivePreviewProvider.java).
117+
5. For quick visual iteration on a template, run [GraphComposeDevTool.java](./src/test/java/com/demcha/compose/devtool/GraphComposeDevTool.java) in test scope &mdash; it hot-reloads the rendered PDF as you edit your template source.
99118

100119
## Contributor architecture rules
101120

@@ -286,9 +305,10 @@ Choose the smallest tests that match the change:
286305
[ComputedPositionTest.java](./src/test/java/com/demcha/compose/engine/components/layout/ComputedPositionTest.java)
287306
- For pagination and multi-page behavior:
288307
[PageBreakerIntegrationTest.java](./src/test/java/com/demcha/compose/engine/integration/PageBreakerIntegrationTest.java)
289-
- For concrete templates:
290-
[BuiltInTemplateRenderTest.java](./src/test/java/com/demcha/compose/document/templates/builtins/BuiltInTemplateRenderTest.java)
291-
[CvTemplateV1LayoutSnapshotTest.java](./src/test/java/com/demcha/compose/document/templates/builtins/CvTemplateV1LayoutSnapshotTest.java)
308+
- For Templates v2 CV / cover-letter presets:
309+
[PresetVisualParityTest.java (CV)](./src/test/java/com/demcha/compose/document/templates/cv/presets/PresetVisualParityTest.java)
310+
[PresetVisualParityTest.java (cover letter)](./src/test/java/com/demcha/compose/document/templates/coverletter/presets/PresetVisualParityTest.java)
311+
[PresetLayoutSnapshotTest.java](./src/test/java/com/demcha/compose/document/templates/cv/presets/PresetLayoutSnapshotTest.java)
292312

293313
If a change affects public docs, examples, or screenshots, update those assets in the same PR so the repository stays internally consistent.
294314

0 commit comments

Comments
 (0)