Skip to content

Revise unobvious defaults #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 18, 2025
Merged

Conversation

osipxd
Copy link
Member

@osipxd osipxd commented Apr 18, 2025

This PR aims to fix unibvious or unchangeable defaults.

  • Don't add mavenCentral and other repositories automatically
  • Don't set implicit default apiVersion, require it to be set explicitly
  • Don't resolve apiVersion during configuration if dependency extensions was used (proper fix for apiVersion attribute not being respected #59)

@osipxd osipxd self-assigned this Apr 18, 2025
Copy link

coderabbitai bot commented Apr 18, 2025

Walkthrough

This set of changes updates the Bukkit Gradle plugin to modernize dependency management, configuration, and server core support. The default Bukkit API version is no longer set automatically and must be specified explicitly. Support for Spigot and other cores is removed, with PaperMC as the only supported core. Dependency resolution now uses version placeholders and group ID substitution rules, and users must add repositories manually. The plugin.yml generation process is updated to use the jpenilla/resource-factory plugin, with renamed configuration blocks and tasks. The development server feature is refactored, replacing the old plugin with a new configuration approach. Documentation and tests are updated to reflect these changes.

Changes

File(s) / Path(s) Change Summary
CHANGELOG.md, README.md Updated documentation to reflect breaking changes: explicit Bukkit API version required, PaperMC is now the only supported core, plugin.yml generation uses a new plugin, users must add repositories manually, and configuration APIs are renamed. Migration instructions and examples were revised.
src/main/kotlin/BukkitExtension.kt Refactored to remove default API version; added new internal providers for finalized and parsed API version; constructor updated to require ProviderFactory; removed Project extension property.
src/main/kotlin/BukkitGradlePlugin.kt Refactored plugin application logic: removed intermediate configuration methods, inlined logic, added explicit Java compilation and dependency extension configuration, removed implicit repository addition, and switched to new dev server feature configuration.
src/main/kotlin/dependencies/Dependencies.kt Refactored dependency management: removed late-initialized/deprecated properties, centralized version substitution and group ID rewriting in resolution strategy, replaced dependency API with version placeholders, and simplified repository extension setup.
src/main/kotlin/dependencies/DependenciesExtensions.kt Updated dependency properties to use new version placeholder function; removed old group ID resolution; updated imports and suppressed unused receiver parameter.
src/main/kotlin/plugin/PluginYamlFeature.kt Removed unused import; no logic changes.
src/main/kotlin/plugin/util/MinecraftVersion.kt Updated version parsing to strip version suffix; removed extension property for parsed API version; updated imports.
src/main/kotlin/server/Constants.kt Deleted file; removed default server version constant.
src/main/kotlin/server/DevServerFeature.kt Added new feature for configuring the development server: applies RunPaperPlugin, sets up RunServer and PrepareServer tasks, configures Java toolchain, and registers IDE run configuration task. Uses conventions from Bukkit extension and supports property-based directory configuration.
src/main/kotlin/server/DevServerPlugin.kt Deleted plugin class and related methods for the old dev server implementation.
src/main/kotlin/server/extension/CoreType.kt Deleted enum for server core types (SPIGOT, PAPER).
src/main/kotlin/server/extension/ServerConfiguration.kt Removed coreType property from interface.
src/main/kotlin/server/extension/ServerConfigurationImpl.kt Removed coreType property and logic; deprecated setCore method now only logs a warning and does not change state.
src/main/kotlin/server/task/PrepareServer.kt Removed eula property; renamed and refactored method for configuring online mode to use Kotlin resource management idioms.
src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy Refactored tests to use Gradle dependency/repository DSL blocks, updated expectations for version placeholders and group ID substitution, added tests for error handling when API version is unset, and removed Spigot extension tests.
src/test/groovy/ru/endlesscode/bukkitgradle/server/extension/ServerConfigurationSpec.groovy Removed tests related to setting and verifying server core types.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Gradle as Gradle Project
    participant BukkitExt as BukkitExtension
    participant DevServer as DevServerFeature
    participant RunPaper as RunPaperPlugin

    User->>Gradle: Applies BukkitGradlePlugin
    Gradle->>BukkitExt: Creates BukkitExtension (requires explicit apiVersion)
    Gradle->>DevServer: Configures DevServerFeature with BukkitExtension
    DevServer->>RunPaper: Applies RunPaperPlugin
    DevServer->>Gradle: Registers RunServer & PrepareServer tasks
    DevServer->>Gradle: Registers IDE Run Config task
    User->>Gradle: Adds dependencies with {bukkit.apiVersion} placeholder
    Gradle->>BukkitExt: Resolves apiVersion and substitutes in dependencies
    Gradle->>Gradle: Resolves PaperMC groupId as needed
    Gradle->>Gradle: Builds and runs server using configured tasks
Loading

Possibly related PRs

  • EndlessCodeGroup/BukkitGradle#66: The main PR's changes to plugin.yml generation by adopting the jpenilla/resource-factory plugin and renaming configuration blocks and APIs directly build upon and extend the plugin.yml generation refactoring introduced in the retrieved PR Use jpenilla/resource-factory to generate plugin.yml file #66, making their changes strongly related.
  • EndlessCodeGroup/BukkitGradle#63: The main PR refactors the development server implementation to use the jpenilla/run-task plugin and integrates run-paper, replacing the previous custom server run logic, which is the core change also described in the retrieved PR that introduces the run-task plugin for running the server and updates JVM toolchain handling accordingly; thus, these changes are directly related at the code level in the server run configuration and task setup.

Poem

In the warren of code, a new path we hop,
PaperMC now rules—no more Spigot swap!
Placeholders in dependencies, versions you must declare,
Plugin.yml is crafted with resource-factory flair.
The dev server’s reborn, with tasks neat and bright,
Repositories you add, for builds done right.
🐇 Cheers to fresh starts and a plugin delight!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@osipxd osipxd added this to the Next milestone Apr 18, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
README.md (1)

107-107: Minor: Add comma after "That's it!"

There should be a comma after "That's it!" for better readability.

-That's it!
+That's it!,
🧰 Tools
🪛 LanguageTool

[uncategorized] ~107-~107: Possible missing comma found.
Context: ...c() } ``` That's it! During the plugin compilation plugin.yml will be generated with the...

(AI_HYDRA_LEO_MISSING_COMMA)

src/main/kotlin/BukkitGradlePlugin.kt (1)

44-46: Prefer using convention over hard‑wiring the compiler encoding

Hard‑setting the encoding with

options.encoding = "UTF-8"

overrides any subsequent user configuration.
Switching to the convention API will still default to UTF‑8, but allows a build script to override it later if needed.

-            options.encoding = "UTF-8"
+            // keep UTF‑8 as the default, but let the user override it afterwards
+            options.encoding.convention("UTF-8")
src/main/kotlin/dependencies/Dependencies.kt (2)

58-63: Kotlin‑DSL builds cannot call the new Groovy closures

extra["spigot"] = repositoryClosure(...) (and friends) exposes only dynamic Groovy methods (spigot(), papermc(), …).
If a consumer adopts the Kotlin DSL (build.gradle.kts), these symbols are not available at compile time, forcing them to fall back to string‑based maven { url = … } blocks.

Consider adding typed extension functions alongside the closures so both Groovy and Kotlin builds get first‑class support, e.g.

fun RepositoryHandler.spigot(block: MavenArtifactRepository.() -> Unit = {}) =
    addRepo("Spigot", URL_SPIGOT, block)

That keeps the ergonomic one‑liner while remaining cross‑DSL.


86-114: Minor optimisation: avoid resolving the Provider on every dependency

bukkitVersion.get() is executed inside eachDependency, i.e. once per dependency candidate.
Caching it locally avoids repeated provider resolution and string concatenations:

-        val bukkitVersion = bukkit.finalApiVersion
-            .map { "$it$BUKKIT_VERSION_SUFFIX" }
+        val bukkitVersionProvider = bukkit.finalApiVersion
+            .map { "$it$BUKKIT_VERSION_SUFFIX" }-                val version = if (requested.version == BUKKIT_VERSION_PLACEHOLDER) {
-                    bukkitVersion.get()
+                val version = if (requested.version == BUKKIT_VERSION_PLACEHOLDER) {
+                    bukkitVersionProvider.get()

The change is optional, but it marginally improves configuration‑time performance on large dependency graphs.

src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy (1)

10-17: Solid negative‑path test – one extra assertion would tighten it

The test correctly verifies that an exception surfaces when apiVersion is missing.
To ensure the plugin throws your specific RuntimeException, also assert on the exception’s type, not only its message:

then:
def e = thrown(RuntimeException)
e instanceof MissingApiVersionException // or the concrete subclass you expect
e.cause.message == "Please, set 'bukkit.apiVersion' property."

This will prevent future refactors from masking the intended failure type via a different wrapper exception.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3e7dd2 and 0e50073.

📒 Files selected for processing (17)
  • CHANGELOG.md (2 hunks)
  • README.md (11 hunks)
  • src/main/kotlin/BukkitExtension.kt (1 hunks)
  • src/main/kotlin/BukkitGradlePlugin.kt (2 hunks)
  • src/main/kotlin/dependencies/Dependencies.kt (3 hunks)
  • src/main/kotlin/dependencies/DependenciesExtensions.kt (3 hunks)
  • src/main/kotlin/plugin/PluginYamlFeature.kt (0 hunks)
  • src/main/kotlin/plugin/util/MinecraftVersion.kt (2 hunks)
  • src/main/kotlin/server/Constants.kt (0 hunks)
  • src/main/kotlin/server/DevServerFeature.kt (1 hunks)
  • src/main/kotlin/server/DevServerPlugin.kt (0 hunks)
  • src/main/kotlin/server/extension/CoreType.kt (0 hunks)
  • src/main/kotlin/server/extension/ServerConfiguration.kt (0 hunks)
  • src/main/kotlin/server/extension/ServerConfigurationImpl.kt (1 hunks)
  • src/main/kotlin/server/task/PrepareServer.kt (1 hunks)
  • src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy (2 hunks)
  • src/test/groovy/ru/endlesscode/bukkitgradle/server/extension/ServerConfigurationSpec.groovy (0 hunks)
💤 Files with no reviewable changes (6)
  • src/main/kotlin/plugin/PluginYamlFeature.kt
  • src/main/kotlin/server/extension/ServerConfiguration.kt
  • src/main/kotlin/server/extension/CoreType.kt
  • src/main/kotlin/server/Constants.kt
  • src/test/groovy/ru/endlesscode/bukkitgradle/server/extension/ServerConfigurationSpec.groovy
  • src/main/kotlin/server/DevServerPlugin.kt
🧰 Additional context used
🧠 Learnings (1)
README.md (2)
Learnt from: osipxd
PR: EndlessCodeGroup/BukkitGradle#66
File: README.md:104-108
Timestamp: 2025-04-17T20:35:24.623Z
Learning: In Bukkit plugin.yml, the `api-version` field doesn't support patch versions for Minecraft versions lower than 1.20.5. Even if `apiVersion = "1.16.5"` is specified in configuration, it will be transformed to `api-version: '1.16'` in the generated plugin.yml file. Starting from Minecraft 1.20.5, full patch versions are supported in the api-version field.
Learnt from: osipxd
PR: EndlessCodeGroup/BukkitGradle#66
File: README.md:104-108
Timestamp: 2025-04-17T20:35:24.623Z
Learning: In Bukkit plugin.yml, the `api-version` field doesn't support patch versions for Minecraft versions lower than 1.20.5. Even if `apiVersion = "1.16.5"` is specified in configuration, it will be transformed to `api-version: '1.16'` in the generated plugin.yml file. Starting from Minecraft 1.20.5, full patch versions are supported in the api-version field.
🧬 Code Graph Analysis (1)
src/main/kotlin/dependencies/DependenciesExtensions.kt (1)
src/main/kotlin/dependencies/Dependencies.kt (1)
  • withBukkitVersion (82-84)
🪛 markdownlint-cli2 (0.17.2)
README.md

24-24: Heading levels should only increment by one level at a time
Expected: h2; Actual: h4

(MD001, heading-increment)


24-24: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


24-24: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


153-153: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


153-153: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


157-157: Bare URL used
null

(MD034, no-bare-urls)


158-158: Bare URL used
null

(MD034, no-bare-urls)


159-159: Bare URL used
null

(MD034, no-bare-urls)


160-160: Bare URL used
null

(MD034, no-bare-urls)


161-161: Bare URL used
null

(MD034, no-bare-urls)


162-162: Bare URL used
null

(MD034, no-bare-urls)


163-163: Bare URL used
null

(MD034, no-bare-urls)


164-164: Bare URL used
null

(MD034, no-bare-urls)


165-165: Bare URL used
null

(MD034, no-bare-urls)


167-167: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


344-344: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)

🪛 LanguageTool
README.md

[uncategorized] ~107-~107: Possible missing comma found.
Context: ...c() } ``` That's it! During the plugin compilation plugin.yml will be generated with the...

(AI_HYDRA_LEO_MISSING_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Check
🔇 Additional comments (22)
src/main/kotlin/server/extension/ServerConfigurationImpl.kt (1)

19-30: Well-structured deprecation approach for server core selection

The implementation correctly deprecates the setCore method while maintaining backward compatibility. The warning message is clear and provides actionable guidance to users: remove the method call and file an issue if other server cores are needed.

This change aligns with the PR objective of making configuration behavior more explicit by removing hidden defaults and simplifying the server core selection to use Paper exclusively.

src/main/kotlin/plugin/util/MinecraftVersion.kt (1)

19-21: Improved version parsing with suffix handling

The updated parsing logic now properly handles version strings that include the Bukkit version suffix by removing it before parsing. This change supports the more explicit version handling approach in the PR and ensures consistent version parsing regardless of whether the suffix is present.

src/main/kotlin/server/task/PrepareServer.kt (2)

32-33: Method name improvement in task action

Renaming from resolveOnlineMode() to configureOnlineMode() better reflects the actual purpose of the method, which is to configure the online-mode property rather than just resolve a value.


35-45: Enhanced resource management for file operations

The implementation now uses Kotlin's use extension function for both reading and writing to the properties file. This ensures resources are properly closed even in case of exceptions, which is a best practice for file I/O operations.

src/main/kotlin/BukkitExtension.kt (2)

23-29: Removed implicit default for apiVersion

The code now explicitly requires users to set the bukkit.apiVersion property by removing the default value and adding a validation check. This change directly implements one of the key objectives of the PR: making implicit defaults explicit and ensuring users make conscious configuration choices.

The error message is clear and provides guidance on what needs to be done.


25-30: Well-designed provider architecture for version handling

The introduction of separate providers for finalized API version and parsed version follows good separation of concerns. The finalApiVersion provider handles validation and finalization, while parsedApiVersion handles the parsing logic. This design maintains a clean architecture while enforcing the requirement for explicit version specification.

CHANGELOG.md (4)

6-11: Good addition of dependency substitution documentation

The new section clearly explains how to use dependency substitution rules with the placeholder value {bukkit.apiVersion} in version catalogs, which makes the dependency resolution mechanism more transparent to users.


18-21: Clear explanation of server core type removal

The changelog clearly communicates the breaking change regarding server core support, providing a good rationale and alternative (filing issues) for users who need other server cores.


35-43: Well-documented change for repository handling

The explanation for removing implicit repository additions is thorough and includes a helpful example of how users should now explicitly add repositories. This directly addresses the PR objective of making configuration more explicit.


44-52: Clear communication about apiVersion default removal

The changelog effectively explains the removal of the implicit default for bukkit.apiVersion, providing both the rationale ("unobvious behavior") and a clear example of how users should configure it going forward.

src/main/kotlin/dependencies/DependenciesExtensions.kt (2)

1-20: Import changes align with dependency substitution model

The updated imports and additional suppression reflect the refactoring to use placeholder versions instead of resolved versions, which aligns with the PR objective of making version defaults explicit.


49-59: Refactored dependency properties to use placeholders

Good refactoring of dependency properties to use withBukkitVersion which returns a dependency notation with a placeholder that will be substituted at resolution time, making the version dependency more explicit.

README.md (5)

90-93: Updated documentation to show explicit apiVersion requirement

The changes properly document that users must now explicitly set apiVersion, aligning with the PR objective of eliminating implicit defaults.


96-103: Updated example to reflect PaperMC as the only supported core

The example code has been updated to use paperApi and explicitly add the papermc() repository, consistent with the changes to remove Spigot support.


155-166: Improved repository documentation formatting

The repositories table is now better formatted, making it easier for users to understand which repositories are available.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

157-157: Bare URL used
null

(MD034, no-bare-urls)


158-158: Bare URL used
null

(MD034, no-bare-urls)


159-159: Bare URL used
null

(MD034, no-bare-urls)


160-160: Bare URL used
null

(MD034, no-bare-urls)


161-161: Bare URL used
null

(MD034, no-bare-urls)


162-162: Bare URL used
null

(MD034, no-bare-urls)


163-163: Bare URL used
null

(MD034, no-bare-urls)


164-164: Bare URL used
null

(MD034, no-bare-urls)


165-165: Bare URL used
null

(MD034, no-bare-urls)


171-180: Clear dependency documentation with repository requirements

This section now explicitly indicates which repository is needed for each dependency, helping users understand the relationship between dependencies and repositories after the removal of implicit repository additions.


257-295: Comprehensive migration guide for 0.10.x

The migration guide clearly outlines all the steps required to upgrade from 0.10.x, addressing each breaking change including the need to explicitly set apiVersion, remove server core selection, and add repositories manually.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

257-257: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)

src/main/kotlin/server/DevServerFeature.kt (4)

18-46: Well-implemented server feature configuration

The dev server feature is well-implemented with proper use of Gradle's provider API for deferred configuration. The server version falls back to the explicitly configured bukkit.finalApiVersion, aligning with the PR objective of eliminating implicit defaults.


48-61: Good implementation of JVM toolchain configuration

The method properly configures the Java launcher for the server based on the project's Java toolchain and the minimal JVM version required by the server version, ensuring compatibility.


63-70: Explicit server directory resolution

The implementation correctly resolves the server directory from a Gradle property or a deprecated fallback property, making configuration more explicit and predictable.


72-87: Well-structured task registration methods

The task registration methods are well-structured and follow Gradle best practices for task configuration and dependencies. The tasks are properly integrated with the RunServer task from the RunPaperPlugin.

src/main/kotlin/BukkitGradlePlugin.kt (1)

21-37: Good inline refactor & removal of silent defaults

Moving the former helper logic directly into apply() makes the execution flow easier to follow, and the explicit call to configureDependencyExtensions nicely groups all dependency‑related tweaks in one place.
I see no functional or stylistic issues here – well done.

@osipxd osipxd force-pushed the breaking-changes-before-release branch from 0e50073 to 0ea83c5 Compare April 18, 2025 16:57
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
CHANGELOG.md (2)

6-11: Clear documentation of dependency substitution rules

The changelog effectively explains the new dependency substitution feature with a helpful example. The use of a code block to illustrate the version catalog syntax is particularly useful.

Minor grammatical suggestion: Add a comma after "In version catalogs" for better readability.

-  In version catalogs placeholder value `{bukkit.version}` can be used, and it will be replaced with the actual version:
+  In version catalogs, placeholder value `{bukkit.apiVersion}` can be used, and it will be replaced with the actual version:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~7-~7: Possible missing comma found.
Context: ...bstituting bukkit version. In version catalogs placeholder value {bukkit.version} ca...

(AI_HYDRA_LEO_MISSING_COMMA)


44-52: Clear explanation of apiVersion default removal

The explanation of removing the implicit default for bukkit.apiVersion aligns with the PR objective of eliminating unobvious defaults. The example code snippet helps users understand how to adapt to this change.

Minor suggestion: Consider adding "the" before "default" for better readability.

-  Don't set default `bukkit.apiVersion`.
+  Don't set the default `bukkit.apiVersion`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~45-~45: You might be missing the article “the” here.
Context: ... ``` - Breaking change! Don't set default bukkit.apiVersion. It was implicitl...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

README.md (1)

178-180: Minor markdown formatting issue in footnotes

There are extra spaces after the backslashes in the footnotes which might affect rendering.

-\* Spigot is available in `mavenLocal()` only if you've built it locally using [Spigot BuildTools][buildtools]. \
-\*\* Bukkit should be built locally. However, some versions are available in `spigot()` repository.  \
+\* Spigot is available in `mavenLocal()` only if you've built it locally using [Spigot BuildTools][buildtools].\
+\*\* Bukkit should be built locally. However, some versions are available in `spigot()` repository.\
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e50073 and 0ea83c5.

📒 Files selected for processing (12)
  • CHANGELOG.md (2 hunks)
  • README.md (11 hunks)
  • src/main/kotlin/BukkitExtension.kt (1 hunks)
  • src/main/kotlin/BukkitGradlePlugin.kt (2 hunks)
  • src/main/kotlin/dependencies/Dependencies.kt (3 hunks)
  • src/main/kotlin/dependencies/DependenciesExtensions.kt (3 hunks)
  • src/main/kotlin/extensions/Provider.kt (0 hunks)
  • src/main/kotlin/plugin/PluginYamlFeature.kt (0 hunks)
  • src/main/kotlin/plugin/util/MinecraftVersion.kt (2 hunks)
  • src/main/kotlin/server/Constants.kt (0 hunks)
  • src/main/kotlin/server/DevServerFeature.kt (1 hunks)
  • src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy (2 hunks)
💤 Files with no reviewable changes (3)
  • src/main/kotlin/plugin/PluginYamlFeature.kt
  • src/main/kotlin/server/Constants.kt
  • src/main/kotlin/extensions/Provider.kt
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/main/kotlin/plugin/util/MinecraftVersion.kt
  • src/main/kotlin/BukkitExtension.kt
  • src/main/kotlin/dependencies/DependenciesExtensions.kt
  • src/main/kotlin/BukkitGradlePlugin.kt
  • src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy
  • src/main/kotlin/server/DevServerFeature.kt
🧰 Additional context used
🧠 Learnings (1)
README.md (2)
Learnt from: osipxd
PR: EndlessCodeGroup/BukkitGradle#66
File: README.md:104-108
Timestamp: 2025-04-17T20:35:24.623Z
Learning: In Bukkit plugin.yml, the `api-version` field doesn't support patch versions for Minecraft versions lower than 1.20.5. Even if `apiVersion = "1.16.5"` is specified in configuration, it will be transformed to `api-version: '1.16'` in the generated plugin.yml file. Starting from Minecraft 1.20.5, full patch versions are supported in the api-version field.
Learnt from: osipxd
PR: EndlessCodeGroup/BukkitGradle#66
File: README.md:104-108
Timestamp: 2025-04-17T20:35:24.623Z
Learning: In Bukkit plugin.yml, the `api-version` field doesn't support patch versions for Minecraft versions lower than 1.20.5. Even if `apiVersion = "1.16.5"` is specified in configuration, it will be transformed to `api-version: '1.16'` in the generated plugin.yml file. Starting from Minecraft 1.20.5, full patch versions are supported in the api-version field.
🪛 LanguageTool
CHANGELOG.md

[uncategorized] ~7-~7: Possible missing comma found.
Context: ...bstituting bukkit version. In version catalogs placeholder value {bukkit.version} ca...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~45-~45: You might be missing the article “the” here.
Context: ... ``` - Breaking change! Don't set default bukkit.apiVersion. It was implicitl...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

README.md

[uncategorized] ~107-~107: Possible missing comma found.
Context: ...c() } ``` That's it! During the plugin compilation plugin.yml will be generated with the...

(AI_HYDRA_LEO_MISSING_COMMA)

🪛 markdownlint-cli2 (0.17.2)
README.md

24-24: Heading levels should only increment by one level at a time
Expected: h2; Actual: h4

(MD001, heading-increment)


24-24: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


24-24: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


153-153: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


153-153: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


157-157: Bare URL used
null

(MD034, no-bare-urls)


158-158: Bare URL used
null

(MD034, no-bare-urls)


159-159: Bare URL used
null

(MD034, no-bare-urls)


160-160: Bare URL used
null

(MD034, no-bare-urls)


161-161: Bare URL used
null

(MD034, no-bare-urls)


162-162: Bare URL used
null

(MD034, no-bare-urls)


163-163: Bare URL used
null

(MD034, no-bare-urls)


164-164: Bare URL used
null

(MD034, no-bare-urls)


165-165: Bare URL used
null

(MD034, no-bare-urls)


167-167: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


344-344: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)

🔇 Additional comments (15)
src/main/kotlin/dependencies/Dependencies.kt (7)

29-30: Well-structured version placeholders

The use of constants for version placeholders and suffixes improves maintainability and makes the code more readable. This aligns with the PR objective of making version configuration more explicit.


32-34: Good use of constants for group IDs

Defining constants for both old and new Paper group IDs centralizes this information and makes it easier to maintain. This approach supports the dynamic group ID substitution based on Minecraft version.


39-44: Clean separation of concerns

The configureDependencyExtensions function properly separates the extension setup from resolution strategy configuration, making the code more modular and maintainable.


46-56: Repository extensions no longer automatically applied

This implementation aligns with the PR objective of removing implicit repository additions. Users now must explicitly add repositories, making the configuration behavior more predictable.


58-63: Dependencies use version placeholders

The dependency declarations now use placeholders instead of concrete versions, which is a cleaner approach and supports the resolution strategy.


82-84: Simple and clear dependency string generator

This function elegantly generates dependency notation with the version placeholder, supporting the goal of making version configuration more explicit.


86-116: Elegant resolution strategy implementation

The resolution strategy effectively handles both version placeholder substitution and group ID rewriting based on Minecraft version. This implementation properly fixes issue #59 by ensuring version resolution happens during the dependency resolution phase rather than the configuration phase.

CHANGELOG.md (2)

18-21: Clear explanation of server core support changes

The changelog clearly communicates the removal of Spigot support and provides guidance for users who need other server cores. This transparency helps users understand the rationale behind the change.


35-43: Well-documented breaking change for repository handling

The changelog clearly explains the rationale for requiring explicit repository declarations and provides a helpful example. This is essential information for users migrating from previous versions.

README.md (6)

90-93: Updated example with explicit apiVersion

The example now correctly shows the explicit setting of apiVersion, aligning with the PR objective to eliminate implicit defaults.


101-103: Example shows explicit repository declaration

This example demonstrates the new requirement to explicitly declare repositories, which is a key change in the PR.


110-110: Version representation in plugin.yml

Based on the retrieved learnings, for Minecraft versions prior to 1.20.5, the api-version field would omit the patch version, but this example shows the full version. This is correct for 1.21.5+ as the learnings indicate full patch versions are supported starting from 1.20.5.


276-281: Clear migration instructions for apiVersion

The migration guide clearly explains the need to explicitly set apiVersion, which is essential for users upgrading from previous versions.


283-285: Clear guidance on server core changes

The migration guide effectively communicates the removal of server core selection and the standardization on PaperMC, which is a significant change for users.


288-294: Comprehensive repository migration guidance

This section provides clear instructions on the need to explicitly add repositories, with helpful examples that will ease the transition for users.

@osipxd osipxd force-pushed the breaking-changes-before-release branch from 0ea83c5 to 1ad7b08 Compare April 18, 2025 17:08
@osipxd osipxd merged commit 1ad7b08 into develop Apr 18, 2025
2 of 3 checks passed
@osipxd osipxd deleted the breaking-changes-before-release branch April 18, 2025 17:12
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
CHANGELOG.md (2)

6-11: Good addition of dependency substitution rules

The addition of dependency substitution rules for handling paper groupId and version placeholders is well-documented. This feature will make dependency management more flexible.

Consider adding a comma after "version." in line 7 for better readability.

-  In version catalogs placeholder value `{bukkit.version}` can be used, and it will be replaced with the actual version:
+  In version catalogs, placeholder value `{bukkit.version}` can be used, and it will be replaced with the actual version:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~7-~7: Possible missing comma found.
Context: ...bstituting bukkit version. In version catalogs placeholder value {bukkit.version} ca...

(AI_HYDRA_LEO_MISSING_COMMA)


44-52: Good explanation of mandatory apiVersion

The explanation for removing the implicit default for bukkit.apiVersion is clear and provides a proper code example. This change improves configuration transparency.

Consider adding "the" before "default" in line 45 for better readability.

-Don't set default `bukkit.apiVersion`.
+Don't set the default `bukkit.apiVersion`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~45-~45: You might be missing the article “the” here.
Context: ... ``` - Breaking change! Don't set default bukkit.apiVersion. It was implicitl...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

README.md (2)

106-115: Updated plugin.yml example

The example output for generated plugin.yml has been updated to show the proper format for the api-version field. This is accurate and aligns with the learned information about API version formatting.

Consider adding a comma after "That's it!" for better readability.

-That's it!
-During the plugin compilation `plugin.yml` will be generated with the following content:
+That's it!
+During the plugin compilation, `plugin.yml` will be generated with the following content:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~107-~107: A comma might be missing here.
Context: ...c() } ``` That's it! During the plugin compilation plugin.yml will be generated with the...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


171-180: Updated dependency table with clarified repository requirements

The dependency table now clearly indicates which repository is required for each dependency, and provides helpful footnotes about local builds. This improves usability.

Consider adding "the" before "spigot()" in line 179 for better readability.

-\*\* Bukkit should be built locally. However, some versions are available in `spigot()` repository.  \
+\*\* Bukkit should be built locally. However, some versions are available in the `spigot()` repository.  \
🧰 Tools
🪛 LanguageTool

[uncategorized] ~179-~179: You might be missing the article “the” here.
Context: ...However, some versions are available in spigot() repository. \ *** `$apiVer...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ea83c5 and 1ad7b08.

📒 Files selected for processing (5)
  • CHANGELOG.md (2 hunks)
  • README.md (11 hunks)
  • src/main/kotlin/BukkitExtension.kt (1 hunks)
  • src/main/kotlin/server/Constants.kt (0 hunks)
  • src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy (2 hunks)
💤 Files with no reviewable changes (1)
  • src/main/kotlin/server/Constants.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/kotlin/BukkitExtension.kt
🧰 Additional context used
🧠 Learnings (1)
README.md (2)
Learnt from: osipxd
PR: EndlessCodeGroup/BukkitGradle#66
File: README.md:104-108
Timestamp: 2025-04-17T20:35:24.623Z
Learning: In Bukkit plugin.yml, the `api-version` field doesn't support patch versions for Minecraft versions lower than 1.20.5. Even if `apiVersion = "1.16.5"` is specified in configuration, it will be transformed to `api-version: '1.16'` in the generated plugin.yml file. Starting from Minecraft 1.20.5, full patch versions are supported in the api-version field.
Learnt from: osipxd
PR: EndlessCodeGroup/BukkitGradle#66
File: README.md:104-108
Timestamp: 2025-04-17T20:35:24.623Z
Learning: In Bukkit plugin.yml, the `api-version` field doesn't support patch versions for Minecraft versions lower than 1.20.5. Even if `apiVersion = "1.16.5"` is specified in configuration, it will be transformed to `api-version: '1.16'` in the generated plugin.yml file. Starting from Minecraft 1.20.5, full patch versions are supported in the api-version field.
🪛 LanguageTool
CHANGELOG.md

[uncategorized] ~7-~7: Possible missing comma found.
Context: ...bstituting bukkit version. In version catalogs placeholder value {bukkit.version} ca...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~45-~45: You might be missing the article “the” here.
Context: ... ``` - Breaking change! Don't set default bukkit.apiVersion. It was implicitl...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

README.md

[uncategorized] ~107-~107: A comma might be missing here.
Context: ...c() } ``` That's it! During the plugin compilation plugin.yml will be generated with the...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~179-~179: You might be missing the article “the” here.
Context: ...However, some versions are available in spigot() repository. \ *** `$apiVer...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)
README.md

24-24: Heading levels should only increment by one level at a time
Expected: h2; Actual: h4

(MD001, heading-increment)


24-24: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


24-24: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


153-153: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


153-153: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


157-157: Bare URL used
null

(MD034, no-bare-urls)


158-158: Bare URL used
null

(MD034, no-bare-urls)


159-159: Bare URL used
null

(MD034, no-bare-urls)


160-160: Bare URL used
null

(MD034, no-bare-urls)


161-161: Bare URL used
null

(MD034, no-bare-urls)


162-162: Bare URL used
null

(MD034, no-bare-urls)


163-163: Bare URL used
null

(MD034, no-bare-urls)


164-164: Bare URL used
null

(MD034, no-bare-urls)


165-165: Bare URL used
null

(MD034, no-bare-urls)


167-167: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)


344-344: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)

🔇 Additional comments (10)
CHANGELOG.md (2)

18-21: Clear communication about dropping Spigot support

Good job on clearly communicating that Spigot is no longer supported and providing guidance for users who may need other server cores.


35-43: Excellent explanation of repository changes

This section provides a clear explanation of why repositories must now be added explicitly, with a helpful example. This change makes the behavior more predictable and explicit.

README.md (3)

91-103: Updated example with explicit apiVersion

The quick start example has been appropriately updated to use the latest API version (1.21.5) and require explicit setting of apiVersion. This aligns perfectly with the PR objectives of making defaults explicit.


155-165: Improved repository table formatting

The repository table has been reformatted for better readability and consistency. The new markdown table format is more organized and easier to read.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

157-157: Bare URL used
null

(MD034, no-bare-urls)


158-158: Bare URL used
null

(MD034, no-bare-urls)


159-159: Bare URL used
null

(MD034, no-bare-urls)


160-160: Bare URL used
null

(MD034, no-bare-urls)


161-161: Bare URL used
null

(MD034, no-bare-urls)


162-162: Bare URL used
null

(MD034, no-bare-urls)


163-163: Bare URL used
null

(MD034, no-bare-urls)


164-164: Bare URL used
null

(MD034, no-bare-urls)


165-165: Bare URL used
null

(MD034, no-bare-urls)


276-294: Clear migration instructions

The migration guide clearly outlines the steps needed to update from 0.10.x, particularly highlighting the need to explicitly specify apiVersion and add repositories manually. This is essential documentation for a breaking change.

src/test/groovy/ru/endlesscode/bukkitgradle/BukkitGradlePluginSpec.groovy (5)

10-17: Good test for mandatory apiVersion requirement

This new test correctly verifies that an appropriate error is shown when attempting to access the toolchain language version without setting bukkit.apiVersion. The error message is clear and actionable.


44-50: Updated test for version placeholder

The test has been updated to verify that the bukkit extension returns a dependency with the {bukkit.apiVersion} placeholder instead of a hardcoded default version. This correctly validates the removal of implicit defaults.


56-67: Improved dependency resolution testing

The test has been updated to verify actual resolved dependencies rather than string outputs. This is a more robust approach to testing the dependency resolution mechanism, including group ID substitution for PaperMC.


74-89: Good test for group ID substitution

This test properly verifies that the group ID is corrected when using Paper with a new version but the old group ID, which is a key feature of the dependency substitution rules.


108-112: Useful helper method for testing

The resolvedDependency() method is a good addition that centralizes the logic for retrieving resolved artifact identifiers, making the tests more maintainable.

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.

1 participant