Skip to content

Commit

Permalink
Merge pull request #539 from refinedmods/release/2.0.0-milestone.3.7
Browse files Browse the repository at this point in the history
Release v2.0.0-milestone.3.7
  • Loading branch information
raoulvdberge authored Jun 3, 2024
2 parents d1b7e72 + c942fc1 commit bbdd072
Show file tree
Hide file tree
Showing 68 changed files with 1,917 additions and 1,011 deletions.
96 changes: 55 additions & 41 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ When contributing to this repository, please first discuss the change you wish t
[GitHub issues](https://github.com/refinedmods/refinedstorage2/issues), [Discord](https://discordapp.com/invite/VYzsydb),
or any other method with the owners of this repository before making a change.

## Quickstart

These are the most important things to know before contributing (also explained in more detail later in this document):

- Commit messages must adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
- Branch names must be formatted correctly. The format is `{category}/GH-{issue number}/{lowercase-description}`.
Category must match a
category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum).
- We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is
recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your
IDE, so that formatting rules are respected.
- Branches are kept up to date by rebasing, not by merging.
- For non-technical changes, adding a changelog entry is required.

## Pull requests

- Keep your pull request (PR) as small as possible, this makes reviewing easier.
Expand Down Expand Up @@ -44,32 +58,13 @@ Valid examples are:

## Translations

If you want to contribute to the translations of this project, please use [Crowdin](https://crowdin.com/project/refined-storage-2).
If you want to contribute to the translations of this project, please
use [Crowdin](https://crowdin.com/project/refined-storage-2).

## Versioning

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Version metadata

The code doesn't contain version metadata: `build.gradle` specifies a version of `0.0.0` (via Refined Architect).
The versioning information is entirely contained in Git by using tags.

Per [Semantic Versioning](https://semver.org/spec/v2.0.0.html), the version number being released depends on the changes
in that release. We usually can't predict those
changes at the start of a release cycle, so we can't bump the version at the start of a release cycle. That means that
the version number being released is determined at release time.

Because the version number is determined at release time, we can't store any versioning metadata in the
code (`build.gradle`). If we did, `build.gradle` would have the version number of the latest released version during the
release cycle of the new version, which isn't correct.

### Dealing with Minecraft

Whenever we port to a new Minecraft version, at least the minor version should be incremented.

This is needed so that we can still support older Minecraft versions without the version numbers conflicting.

## Changelog

The changelog is kept in `CHANGELOG.md`.
Expand All @@ -92,7 +87,7 @@ Documentation must be kept up to date when adding or changing functionality.

### Javadoc

Javadoc is available after every release on https://refinedmods.com/refinedstorage2/.
Javadoc is available after every release on https://refinedmods.com/javadoc/refinedstorage2/.

### API annotations

Expand All @@ -103,7 +98,7 @@ from [API Guardian](https://github.com/apiguardian-team/apiguardian).

We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style.

It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) file into your
It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your
IDE, so that formatting rules are respected.

Moreover, the [CheckStyle-IDEA plugin](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) can be used to check
Expand All @@ -126,8 +121,26 @@ at all times.
They ensure that there are no regressions, act as general documentation for the codebase,
and ensure that the project can evolve over time.

To avoid brittle tests, tests need to validate behavior. A test cannot rely on the internal code structure, so most
mocking should be avoided.
To avoid brittle tests, tests need to validate behavior. A test cannot rely on the internal code structure, so most use
of mocking should be avoided.

### Unit testing

Tests in the API modules are regular unit tests. Don't see a "unit" here as a code unit, but as a unit of behavior.

> Don't isolate code by using mocking, even in a unit test.
These tests don't rely on, nor know about, Minecraft.

Additionally, tests in the `refinedstorage2-network` module use the `refinedstorage2-network-test` JUnit plugin to
easily set up networks for testing.

### Integration testing

To test the entire chain from Minecraft to the API modules, we use integration tests. These tests are located in the
test source set of the `refinedstorage2-platform-forge` module.

We write these integration tests as Minecraft gametests.

### Test coverage

Expand Down Expand Up @@ -202,6 +215,7 @@ The build workflow takes care of the following:

- Running a Gradle build, running our tests in the process and generating an aggregated code coverage report for the API
modules.
- Running Minecraft gametests.
- Analyzing the code on SonarQube.
> Because of
> [limitations with SonarQube](https://portal.productboard.com/sonarsource/1-sonarcloud/c/50-sonarcloud-analyzes-external-pull-request),
Expand Down Expand Up @@ -236,7 +250,7 @@ The workflow takes care of the following:
- Running a build.
- Publishing on [GitHub packages](https://github.com/refinedmods/refinedstorage2/packages) and
CreeperHost Maven.
- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/refinedstorage2/tree/gh-pages).
- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/javadoc).
- Deploying on [GitHub releases](https://github.com/refinedmods/refinedstorage2/releases).
- Announcing the release on Discord and Twitter.
- Creating a PR that merges `main` back into `develop` to get the changes to `CHANGELOG.md` and `build.gradle`
Expand All @@ -249,18 +263,18 @@ Refined Storage 2 is split up into various modules.
Most modules aren't dependent on Minecraft or a mod loader. Only modules that start
with `refinedstorage2-platform-*` have dependencies on Minecraft.

| Name | Use in addons | Description |
|-----------------------------------|---------------|---------------------------------------------------------------------------------------|
| `refinedstorage2-core-api` | ✔️ | Contains some utility classes and enums. |
| `refinedstorage2-grid-api` | ✔️ | Contains Grid related functionality. |
| `refinedstorage2-network-api` | ✔️ | Contains storage network related functionality. |
| `refinedstorage2-network` || Contains implementations of `refinedstorage2-network-api`. |
| `refinedstorage2-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. |
| `refinedstorage2-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. |
| `refinedstorage2-resource-api` | ✔️ | Contains API for handling resources. |
| `refinedstorage2-storage-api` | ✔️ | Contains storage related functionality. |
| `refinedstorage2-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. |
| `refinedstorage2-platform-test` | ✔️ | This module is used in platform tests for various Minecraft related helpers. |
| `refinedstorage2-platform-fabric` || The platform module for Fabric. This module contains Fabric specific code. |
| `refinedstorage2-platform-forge` || The platform module for Forge. This module contains Forge specific code. |
| `refinedstorage2-platform-common` || Common mod code. Most gameplay code is in here. |
| Name | Use in addons | Description |
|-----------------------------------|---------------|----------------------------------------------------------------------------------------------------|
| `refinedstorage2-core-api` | ✔️ | Contains some utility classes and enums. |
| `refinedstorage2-grid-api` | ✔️ | Contains Grid related functionality. |
| `refinedstorage2-network-api` | ✔️ | Contains storage network related functionality. |
| `refinedstorage2-network` || Contains implementations of `refinedstorage2-network-api`. |
| `refinedstorage2-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. |
| `refinedstorage2-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. |
| `refinedstorage2-resource-api` | ✔️ | Contains API for handling resources. |
| `refinedstorage2-storage-api` | ✔️ | Contains storage related functionality. |
| `refinedstorage2-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. |
| `refinedstorage2-platform-test` | ✔️ | This module is used in platform tests for various Minecraft related helpers. |
| `refinedstorage2-platform-fabric` || The platform module for Fabric. This module contains Fabric specific code. |
| `refinedstorage2-platform-forge` || The platform module for Forge. This module contains Forge specific code and the integration tests. |
| `refinedstorage2-platform-common` || Common mod code. Most gameplay code is in here. |
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/[email protected]
uses: refinedmods/refinedarchitect/.github/workflows/[email protected]
with:
gametests: true
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
jobs:
draft:
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.12.1
with:
release-type: ${{ inputs.release-type }}
version-number-override: ${{ inputs.version-number-override }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-for-unsupported-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ labeled, unlabeled, reopened ]
jobs:
unsupported-labeler:
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.12.1
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- closed
jobs:
publish-release:
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.12.1
secrets: inherit
with:
project-name: 'Refined Storage'
2 changes: 1 addition & 1 deletion .github/workflows/resolved-issue-locking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
- cron: '0 0 * * *'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.12.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-branch-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate branch name
on: [ pull_request ]
jobs:
validate-branch-name:
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.12.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
jobs:
validate-changelog:
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.12.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-commit-messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate commit messages
on: [ pull_request ]
jobs:
validate-commit-messages:
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.11.5
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.12.1
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.0.0-milestone.3.7] - 2024-06-03

### Removed

- The JEI integration has been removed and will be moved to an addon mod.

## [2.0.0-milestone.3.6] - 2024-05-18

### Added
Expand Down Expand Up @@ -572,7 +578,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- The Grid can now use smooth scrolling.
- The Grid now has syntax highlighting for the search query.

[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.6...HEAD
[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.7...HEAD

[2.0.0-milestone.3.7]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.6...v2.0.0-milestone.3.7

[2.0.0-milestone.3.6]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.5...v2.0.0-milestone.3.6

Expand Down
1 change: 1 addition & 0 deletions config/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<!-- Shadow target contains underscore -->
<suppress checks="MemberName" files="ModelBakerImplMixin.java"/>
<suppress checks="HideUtilityClassConstructor" files="GridClearPacket.java"/>
<suppress checks="HideUtilityClassConstructor" files="TestMod.java"/>
</suppressions>
64 changes: 64 additions & 0 deletions config/intellij-code-style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<code_scheme name="Refined Mods" version="173">
<JavaCodeStyleSettings>
<option name="SPACE_INSIDE_ONE_LINE_ENUM_BRACES" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="com.refinedmods" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
</JavaCodeStyleSettings>
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
<codeStyleSettings language="Cookie">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="false" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="120" />
<option name="BLANK_LINES_BEFORE_PACKAGE" value="1" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="RESOURCE_LIST_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="ASSERT_STATEMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARAMETER_ANNOTATION_WRAP" value="1" />
<option name="VARIABLE_ANNOTATION_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="NBTT">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="false" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
13 changes: 13 additions & 0 deletions doc/architecture/decision/000-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 0.

Date:

## Status

## Context

## Decision

## Consequences

## References
24 changes: 24 additions & 0 deletions doc/architecture/decision/007-refined-architect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 7. Refined Architect

Date: 2023-03-07

## Status

Accepted

## Context

For Refined Storage, we want to build a large ecosystem of addon mods. However, all those addon mods, and even unrelated mods managed by Refined Mods, have a lot of duplication in terms of build infrastructure, GitHub Actions workflows and Gradle setup code.

This duplication makes it difficult to maintain the soon-to-be suite of mods as a whole, especially if we have to upgrade Minecraft.

## Decision

We introduce [Refined Architect](https://github.com/refinedmods/refinedarchitect): a project that is used by all the mods of Refined Mods.

It contains GitHub workflows, version management and Gradle helpers to help making (cross-platform) mods easier.

## Consequences

- Refined Storage adopts Refined Architect.
- Refined Architect must be kept up to date and maintained in order to upgrade Refined Storage.
Loading

0 comments on commit bbdd072

Please sign in to comment.