Skip to content

Add initial Validation library documentation with Hugo preview infrastructure#261

Merged
alexander-yevsyukov merged 127 commits intomasterfrom
docs-set-1
Feb 13, 2026
Merged

Add initial Validation library documentation with Hugo preview infrastructure#261
alexander-yevsyukov merged 127 commits intomasterfrom
docs-set-1

Conversation

@alexander-yevsyukov
Copy link
Collaborator

@alexander-yevsyukov alexander-yevsyukov commented Jan 20, 2026

This PR establishes the documentation foundation for the Validation library, including a Hugo-based preview system, working code examples, and initial user-facing content.

Main code changes

  • Gradle plugin auto-applies dependencies: Validation plugin now automatically applies Protobuf and Compiler Gradle plugins, eliminating manual configuration
  • JVM runtime API exposure: Changed Base.lib from implementation to api scope in jvm-runtime module
  • Build system: Added TIMEOUT_MINUTES property for long-running CI tasks, bumped Gradle to 9.3.1

Documentation infrastructure

  • Hugo integration: Created docs/ as first-class Gradle module with Go module support and Hugo theme integration
  • Build automation:
    • UpdatePluginVersion task maintains version consistency across documentation examples
    • Scripts for building, serving, and embedding live code samples from _code/ projects
    • GitHub workflow validates embedded code references
  • Example projects:
    • first-model: Basic validation with BankCard message demonstrating (required) and (pattern) constraints
    • first-model-with-framework: Validation integrated with Spine framework
    • Both include Java and Kotlin test examples

Documentation content

  • Getting Started:
    • Adding Validation to Gradle builds with plugin configuration
    • First validated model tutorial using BankCard example with regex patterns for card numbers and owner names
  • Introduction: Philosophy and target audience sections with sentence-case formatting

Copilot AI review requested due to automatic review settings January 20, 2026 19:57
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jan 20, 2026
Copy link
Contributor

Copilot AI left a comment

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 updates project documentation by replacing informal "Please note" phrases with more concise "Note that" phrasing, and bumps version numbers across multiple configuration files and documentation.

Changes:

  • Simplified documentation language by removing "Please" prefix from note statements
  • Updated version from 2.0.0-SNAPSHOT.393 to 2.0.0-SNAPSHOT.394 across configuration files
  • Updated dependency versions (CoreJvmCompiler from .050 to .051, validation-jvm-runtime from .392 to .393)

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
version.gradle.kts Bumped validation version to .394
tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionITest.kt Removed "Please" from documentation note
pom.xml Updated project version to .394 and dependency versions
jvm-runtime/src/main/kotlin/io/spine/validation/MessageValidator.kt Simplified "Please note" to "Note" in KDoc
java/src/main/kotlin/io/spine/tools/validation/java/setonce/SetOnceEnumField.kt Condensed and simplified documentation note
java/src/main/kotlin/io/spine/tools/validation/java/setonce/SetOnceBytesField.kt Condensed and simplified documentation note
java/src/main/kotlin/io/spine/tools/validation/java/JavaValidationPlugin.kt Reformatted multi-line KDoc note for clarity
docs/01-getting-started/index.md Improved line wrapping for better readability
dependencies.md Updated version references and generation timestamps
config Updated subproject commit reference
buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt Updated validation version constant to .393
buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt Updated CoreJvmCompiler versions to .051

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

Copilot AI review requested due to automatic review settings January 22, 2026 20:42
Copy link
Contributor

Copilot AI left a comment

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 20 out of 20 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

docs/options.proto:1

  • Corrected spelling of 'please' to 'use' for consistency with the PR's goal of removing informal language like 'Please' from comments.
/*

docs/ToC.md:1

  • These link text entries still use title case capitalization ("First Validated Model", "Validation Workflow") while other entries in the same file have been updated to sentence case. These should be changed to "Your first validated model" and "Validation workflow" for consistency.
# Spine Validation — Table of contents

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

Copilot AI review requested due to automatic review settings February 12, 2026 21:12
Copy link
Contributor

Copilot AI left a comment

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 72 out of 81 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • docs/_preview/package-lock.json: Language not supported
Comments suppressed due to low confidence (8)

pom.xml:1

  • protobuf-gradle-plugin is a Gradle plugin artifact and generally shouldn’t be published as a regular Maven compile dependency of this project (it will leak into consumers’ classpaths without being useful at runtime). If the goal is to support the Gradle plugin module, keep this dependency in the Gradle plugin’s build only (Gradle buildscript/plugin classpath), and remove it from the Maven POM dependencies.
    docs/_code/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto:1
  • The regex is not anchored at the end, so it will accept strings that start with a valid-looking number but have trailing characters (despite the comment saying it must match a 16-digit number formatted exactly). Consider adding an end anchor ($) so the whole field value must match.
    docs/go.mod:1
  • Consider using the canonical go directive format (go 1.22) and keeping it consistent with the preview module’s go.mod. Using patch versions in the go directive can reduce compatibility with tooling and makes it harder to keep the docs toolchain aligned.
    docs/_preview/go.mod:1
  • The preview site’s Go version is significantly different from the docs module’s Go version and uses a patch-level directive. Aligning the Go version across docs/go.mod and docs/_preview/go.mod (and using the canonical go 1.xx format) will make Hugo Module builds more reproducible across developers/CI.
    settings.gradle.kts:1
  • This include(...) list uses :-prefixed project paths for other modules, but docs is added without the prefix. For consistency (and to avoid ambiguity in multi-project naming), consider using ":docs" here.
    docs/content/docs/validation/01-getting-started/adding-to-build.md:1
  • Correct the grammar: “base on” → “based on”.
    docs/_script/install-dependencies:1
  • Sourcing user shell init files from a build script makes builds non-reproducible and can unexpectedly execute arbitrary code (especially in CI runners or shared environments). Prefer explicitly setting required env vars in the Gradle task/CI, or at least make this opt-in (e.g., behind a flag) and quote variable expansions when checking/reading paths.
    docs/_script/embed-code:1
  • embed-code is hardcoded to the macOS binary, while check-samples selects the tool based on environment. Consider adding the same OS/CI detection here (or delegating to a shared helper) so the embedding task can run on Linux as well when needed.

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

JuliaEvseeva and others added 2 commits February 13, 2026 10:16
Get theme updates and update the version configuration
Copilot AI review requested due to automatic review settings February 13, 2026 15:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@alexander-yevsyukov
Copy link
Collaborator Author

@copilot, update the description of this PR analyzing all commits made from the very beginning of the PR. Drop the description of the "Please" changes in the documentation. They are not essential to the PR. Consider having at least 3 sections:

  • Main code changes
  • Documentation preview infrastructure
  • Added documentation

Copy link

Copilot AI commented Feb 13, 2026

@alexander-yevsyukov I've opened a new pull request, #264, to work on those changes. Once the pull request is ready, I'll request review from you.

@alexander-yevsyukov alexander-yevsyukov changed the title Docs set 1 Add initial Validation library documentation with Hugo preview infrastructure Feb 13, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review February 13, 2026 17:39
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc5fd0a5b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +24 to +26
else
echo "Running locally on macOS."
TOOL="./embed-code-macos"

Choose a reason for hiding this comment

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

P2 Badge Select binary by OS in sample check script

When :docs:checkSamples runs on Linux outside GitHub Actions (for example, local Linux dev machines or non-GHA CI), the else branch hard-codes embed-code-macos, which fails with Exec format error instead of checking samples. This makes the task unusable in those environments unless GITHUB_ACTIONS=true is injected, so the script should choose the binary from the actual platform rather than the CI vendor flag.

Useful? React with 👍 / 👎.

cd _bin

# Update code samples.
./embed-code-macos -config-path="../_settings/embed-code.yml" -mode="embed"

Choose a reason for hiding this comment

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

P2 Badge Use platform-specific embed binary in embed script

The embed workflow always invokes ./embed-code-macos, so :docs:embedCode cannot run on Linux hosts and exits with Exec format error. Because this task is the path for regenerating embedded snippets, Linux contributors/automation cannot update docs unless they manually patch the script each time.

Useful? React with 👍 / 👎.

Copy link
Contributor

Copilot AI left a comment

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 72 out of 81 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • docs/_preview/package-lock.json: Language not supported

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

Copilot AI review requested due to automatic review settings February 13, 2026 17:54
Copy link
Contributor

Copilot AI left a comment

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 71 out of 80 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • docs/_preview/package-lock.json: Language not supported
Comments suppressed due to low confidence (7)

pom.xml:1

  • The project version is bumped to 2.0.0-SNAPSHOT.394, but dependencies on spine-validation-jvm-runtime and validation-java-bundle are set to 2.0.0-SNAPSHOT.393. If this POM is meant to represent a consistent set of artifacts for 394, these versions should be aligned (or explicitly explained/managed via a property/BOM).
    pom.xml:1
  • The project version is bumped to 2.0.0-SNAPSHOT.394, but dependencies on spine-validation-jvm-runtime and validation-java-bundle are set to 2.0.0-SNAPSHOT.393. If this POM is meant to represent a consistent set of artifacts for 394, these versions should be aligned (or explicitly explained/managed via a property/BOM).
    pom.xml:1
  • The project version is bumped to 2.0.0-SNAPSHOT.394, but dependencies on spine-validation-jvm-runtime and validation-java-bundle are set to 2.0.0-SNAPSHOT.393. If this POM is meant to represent a consistent set of artifacts for 394, these versions should be aligned (or explicitly explained/managed via a property/BOM).
    docs/content/docs/validation/01-getting-started/adding-to-build.md:1
  • Correct grammar: change “base on” to “based on”.
    docs/_script/embed-code:1
  • This script hardcodes the macOS binary, which will fail on Linux/Windows (including many developer environments). Consider selecting the binary based on OS (similar to check-samples) or invoking a single platform-appropriate wrapper.
    docs/_script/install-dependencies:1
  • This script doesn’t enable “fail fast” mode. Since it performs cd _preview and runs npm install, failures can be silently ignored and subsequent commands may execute in the wrong directory. Add set -e (ideally set -euo pipefail) near the top; the same applies to hugo-build and hugo-serve.
    docs/_options/options.proto:1
  • Typo in documentation: “weather” should be “whether”.

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

Comment on lines +93 to +100
private fun updatePluginVersion(file: File, id: String, version: String) {
val content = file.readText()
// Regex to match: id("plugin-id") version "version-number"
val regex = """id\("$id"\)\s+version\s+"([^"]+)"""".toRegex()

if (regex.containsMatchIn(content)) {
val updatedContent = regex.replace(content) {
"id(\"$id\") version \"$version\""
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The plugin id is interpolated directly into a regex pattern; since plugin IDs commonly contain dots (.), they will be treated as “any character” and can match/replace the wrong plugin declaration. Escape the id when building the regex (e.g., via Regex.escape(id)).

Copilot uses AI. Check for mistakes.
.redirectError(errorOut)
.redirectOutput(debugOut)
.start()
System.err.println("[RunGradle] Running the command: '${command.joinToString(" ")}'." +
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Using System.err.println in a Gradle task produces unstructured output and ignores Gradle log levels. Prefer logger.lifecycle(...) / logger.info(...) (and/or guard under a debug flag) so CI logs stay clean and users can control verbosity.

Suggested change
System.err.println("[RunGradle] Running the command: '${command.joinToString(" ")}'." +
logger.lifecycle("[RunGradle] Running the command: '${command.joinToString(" ")}'." +

Copilot uses AI. Check for mistakes.
@alexander-yevsyukov alexander-yevsyukov merged commit c43d86b into master Feb 13, 2026
8 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the docs-set-1 branch February 13, 2026 18:35
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