Skip to content

Maven Central publishing, CD automation - #6

Merged
halotukozak merged 10 commits into
masterfrom
feat/cd-maven-central
Mar 20, 2026
Merged

Maven Central publishing, CD automation#6
halotukozak merged 10 commits into
masterfrom
feat/cd-maven-central

Conversation

@halotukozak

Copy link
Copy Markdown
Contributor

No description provided.

@halotukozak halotukozak self-assigned this Mar 11, 2026
Copilot AI review requested due to automatic review settings March 11, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Maven Central publishing + CD automation and adds a new Gradle plugin module that wraps the core OpenAPI parser/generator for consumer builds.

Changes:

  • Add plugin Gradle module with a justworks { specs { ... } } DSL and generation tasks (including functional tests via Gradle TestKit).
  • Implement/extend core OpenAPI parsing, validation, and Kotlin code generation (models, clients, shared response types) with extensive unit tests and test specs.
  • Configure Maven Central publishing (via Vanniktech plugin) and add a GitHub Actions CD workflow triggered by v* tags.

Reviewed changes

Copilot reviewed 42 out of 44 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
settings.gradle.kts Includes new plugin module in the multi-module build.
build.gradle.kts Adds Maven publish plugin and switches versioning to tag/env-based release versions.
.gitignore Adds common build/IDE output directories to ignore list.
.github/workflows/cd.yml Adds tag-triggered CD workflow to publish/release artifacts to Maven Central.
core/build.gradle.kts Switches to Vanniktech publishing and adds Arrow dependency + context-parameters compiler flag.
core/src/main/kotlin/com/avsystem/justworks/core/Generator.kt Adds a generator entry point placeholder object.
core/src/main/kotlin/com/avsystem/justworks/core/model/ApiSpec.kt Defines parsed OpenAPI model types (ApiSpec, SchemaModel, etc.).
core/src/main/kotlin/com/avsystem/justworks/core/model/TypeRef.kt Defines TypeRef sealed type tree for schema typing.
core/src/main/kotlin/com/avsystem/justworks/core/parser/SpecValidator.kt Adds OpenAPI validation producing errors/warnings.
core/src/main/kotlin/com/avsystem/justworks/core/parser/SpecParser.kt Adds OpenAPI parsing + schema/endpoint extraction with ref resolution and combinator handling.
core/src/main/kotlin/com/avsystem/justworks/core/gen/Names.kt Centralizes KotlinPoet type/member references used by generators.
core/src/main/kotlin/com/avsystem/justworks/core/gen/NameUtils.kt Adds naming utilities for identifiers, enum constants, and operation names.
core/src/main/kotlin/com/avsystem/justworks/core/gen/TypeMapping.kt Maps TypeRef to KotlinPoet TypeNames (incl. dates).
core/src/main/kotlin/com/avsystem/justworks/core/gen/SerializersModuleGenerator.kt Generates SerializersModule registrations for polymorphic types.
core/src/main/kotlin/com/avsystem/justworks/core/gen/InlineSchemaDeduplicator.kt Deduplicates inline schemas and resolves name collisions.
core/src/main/kotlin/com/avsystem/justworks/core/gen/ModelGenerator.kt Generates Kotlin models (data classes, sealed interfaces, serializers) from ApiSpec.
core/src/main/kotlin/com/avsystem/justworks/core/gen/ClientGenerator.kt Generates Ktor-based API clients from ApiSpec.
core/src/main/kotlin/com/avsystem/justworks/core/gen/ApiResponseGenerator.kt Generates shared response wrapper types (HttpError, HttpSuccess).
core/src/test/resources/petstore.yaml Adds OpenAPI 3 test spec fixture.
core/src/test/resources/petstore-v2.json Adds Swagger 2.0 test fixture for auto-conversion.
core/src/test/resources/invalid-spec.yaml Adds invalid spec fixture for validation/error tests.
core/src/test/resources/refs-spec.yaml Adds $ref-heavy spec fixture for reference resolution tests.
core/src/test/resources/polymorphic-spec.yaml Adds oneOf/allOf polymorphism fixture for parser/generator tests.
core/src/test/resources/anyof-spec.yaml Adds anyOf fixture (incl. discriminator + union case).
core/src/test/resources/anyof-valid-spec.yaml Adds anyOf-with-discriminator fixture.
core/src/test/resources/mixed-combinator-spec.yaml Adds fixture to assert mixed oneOf/anyOf errors.
core/src/test/kotlin/com/avsystem/justworks/core/parser/SpecValidatorTest.kt Unit tests for SpecValidator.
core/src/test/kotlin/com/avsystem/justworks/core/parser/SpecParserTest.kt Broad parser tests for endpoints/schemas/refs/errors/v2 conversion/anyOf.
core/src/test/kotlin/com/avsystem/justworks/core/parser/SpecParserPolymorphicTest.kt Parser tests focused on polymorphic handling.
core/src/test/kotlin/com/avsystem/justworks/core/gen/TypeMappingTest.kt Unit tests for TypeMapping.
core/src/test/kotlin/com/avsystem/justworks/core/gen/SerializersModuleGeneratorTest.kt Unit tests for serializers module generation.
core/src/test/kotlin/com/avsystem/justworks/core/gen/NameUtilsTest.kt Unit tests for naming helpers.
core/src/test/kotlin/com/avsystem/justworks/core/gen/InlineSchemaDedupTest.kt Unit tests for inline schema deduplication logic.
core/src/test/kotlin/com/avsystem/justworks/core/gen/ModelGeneratorTest.kt Unit tests for model generation (properties, defaults, enums, aliases, etc.).
core/src/test/kotlin/com/avsystem/justworks/core/gen/ModelGeneratorPolymorphicTest.kt Unit tests for polymorphic model generation and serializer behavior.
core/src/test/kotlin/com/avsystem/justworks/core/gen/ClientGeneratorTest.kt Unit tests for client generation (methods, params, auth, error handling).
core/src/test/kotlin/com/avsystem/justworks/core/gen/ApiResponseGeneratorTest.kt Unit tests for shared response type generation.
plugin/build.gradle.kts Configures Gradle plugin publication + functional test source set.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksPlugin.kt Registers DSL extension and generation tasks; wires outputs into compilation.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksExtension.kt Defines justworks { specs { ... } } extension container.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksSpecConfiguration.kt Defines per-spec DSL configuration object.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksGenerateTask.kt Task that parses specs and runs generators into build output.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksSharedTypesTask.kt Task that generates shared HttpError/HttpSuccess once per build.
plugin/src/functionalTest/kotlin/com/avsystem/justworks/gradle/JustworksPluginFunctionalTest.kt Gradle TestKit functional coverage for the plugin DSL/tasks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread core/src/main/kotlin/com/avsystem/justworks/core/gen/ModelGenerator.kt Outdated
Comment thread core/src/main/kotlin/com/avsystem/justworks/core/gen/ModelGenerator.kt Outdated
Comment thread core/src/main/kotlin/com/avsystem/justworks/core/gen/ModelGenerator.kt Outdated
Comment thread core/src/main/kotlin/com/avsystem/justworks/core/parser/SpecValidator.kt Outdated
Comment thread core/src/main/kotlin/com/avsystem/justworks/core/gen/ClientGenerator.kt Outdated
Comment thread core/src/main/kotlin/com/avsystem/justworks/core/gen/ClientGenerator.kt Outdated
@halotukozak
halotukozak changed the base branch from master to feat/parser-enhancements March 12, 2026 14:18
@halotukozak
halotukozak force-pushed the feat/parser-enhancements branch from b2abec1 to 3168d68 Compare March 19, 2026 08:58
@halotukozak
halotukozak force-pushed the feat/cd-maven-central branch from 075769a to 5d308d5 Compare March 19, 2026 08:58
@halotukozak
halotukozak force-pushed the feat/parser-enhancements branch from 6dd8eb9 to ebad85e Compare March 19, 2026 11:38
@halotukozak
halotukozak changed the base branch from feat/parser-enhancements to master March 19, 2026 12:35
@halotukozak
halotukozak force-pushed the feat/cd-maven-central branch from 5d308d5 to a0ad7d8 Compare March 19, 2026 12:38
@halotukozak
halotukozak changed the base branch from master to feat/plugin March 19, 2026 12:54
@halotukozak
halotukozak requested a review from Copilot March 19, 2026 13:21
@halotukozak halotukozak changed the title Feat/cd maven central Maven Central publishing, CD automation Mar 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread core/build.gradle.kts Outdated
Comment thread core/build.gradle.kts Outdated
Comment thread plugin/build.gradle.kts Outdated
@halotukozak
halotukozak requested review from ddworak and mzielu March 19, 2026 13:58
Base automatically changed from feat/plugin to master March 20, 2026 09:17
halotukozak and others added 6 commits March 20, 2026 10:21
Configure vanniktech maven-publish plugin with Central Portal,
GPG signing, and GitHub Actions workflow triggered on version tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replaced redundant property setters with assignment syntax.
- Updated Maven Central configuration and developer information in `pom`.
- Simplified ktlint version and compiler arguments setup.
…ized Maven publishing

- Added Maven publish configuration for all subprojects with shared metadata.
- Simplified and unified POM setup, including URLs, licenses, SCM info, and developer details.
- Removed individual Maven configurations from subprojects.
Core module no longer publishes to Maven Central — only the Gradle
plugin is distributed. All POM metadata now lives in plugin/build.gradle.kts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Applied shared Maven publishing setup to all subprojects.
- Consolidated POM metadata including licenses, SCM details, and developer info in the root `build.gradle.kts`.
- Removed duplicated Maven configurations across subprojects.
@halotukozak
halotukozak force-pushed the feat/cd-maven-central branch from 5330496 to f654f05 Compare March 20, 2026 09:21
@github-actions

Copy link
Copy Markdown
Overall Project 90.22% 🍏

There is no coverage information present for the Files changed

Comment thread .github/workflows/cd.yml
Comment thread build.gradle.kts Outdated
Comment thread .github/workflows/cd.yml Outdated
Comment thread build.gradle.kts
- Add CI dependency to CD workflow to prevent publishing broken artifacts
- Add --no-configuration-cache to publish command
- Validate release tag with semver regex instead of naive v-prefix strip
- Centralize kover plugin version in root build.gradle.kts for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@halotukozak
halotukozak requested a review from ddworak March 20, 2026 11:39
@github-actions

Copy link
Copy Markdown
Overall Project 93.35% 🍏

There is no coverage information present for the Files changed

@ddworak

ddworak commented Mar 20, 2026

Copy link
Copy Markdown
Member

Improve README with publishing info and it looks good to go as far as I'm concerned

@github-actions

Copy link
Copy Markdown
Overall Project 93.35% 🍏

There is no coverage information present for the Files changed

Comment thread build.gradle.kts
Comment thread build.gradle.kts
- Add validate-tag job that fails fast on non-semver tags
- Make publish depend on both CI and tag validation
- Add workflow_call trigger to ci.yml for reusable workflow support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@halotukozak
halotukozak requested a review from mzielu March 20, 2026 14:26
@github-actions

Copy link
Copy Markdown

Coverage Report

Overall Project 93.35% 🍏

There is no coverage information present for the Files changed

@halotukozak
halotukozak merged commit 60cd595 into master Mar 20, 2026
1 check passed
@halotukozak
halotukozak deleted the feat/cd-maven-central branch March 20, 2026 14:32
@halotukozak halotukozak added this to the 0.0.1 milestone Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants