Skip to content

Conversation

@VGoncharova
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2025

Walkthrough

Introduces an EAP sample config interface and refactors sample build orchestration into new BuildSteps helpers, centralizes Ktor EAP version resolution and propagation via an EAP version resolver (env.KTOR_VERSION), adds Gradle/Maven EAP build steps, and rewires composites and dependencies with OS-name agent checks.

Changes

Cohort / File(s) Summary
Single entry — EAP sample orchestration
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt
Added EAPSampleConfig interface and extensions BuildPluginSampleSettings.asEAPSampleConfig and SampleProjectSettings.asEAPSampleConfig. Added many BuildSteps helpers: createEAPGradleInitScript, buildEAPGradleProject, buildEAPGradleSample, buildEAPGradlePluginSample, and buildEAPMavenSample. Replaced scattered hard-coded EAP wiring with centralized versionResolver buildType, fetch step writing env.KTOR_VERSION, propagated KTOR_VERSION to dependent builds, gathered all samples into composable per-sample configs and composite builds, switched agent checks to contains("teamcity.agent.jvm.os.name","Linux"), and adjusted imports to buildSteps.*.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description Check ⚠️ Warning No pull request description was provided by the author. While the check is lenient and does not require extensive detail, a description should provide at least some relation to the changeset to inform reviewers of the intent and context. An empty description fails to establish any connection to the substantial changes being made, including the introduction of new interfaces, build steps, and configuration restructuring for EAP sample builds.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The pull request title "Vgoncharova/ktor train" appears to be a branch name rather than a descriptive pull request title. It does not clearly convey the main changes, which involve introducing EAP sample configuration paths, helper build steps for dynamic Ktor EAP version resolution, and restructuring of the build configuration. While "ktor" is tangentially related to the repository, the title is too vague and generic to meaningfully summarize the substantial changes described in the changeset for someone scanning the project history.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vgoncharova/ktor-train

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 741d8ec and 42874ac.

📒 Files selected for processing (1)
  • .teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (1)
.teamcity/src/subprojects/build/ProjectBuild.kt (1)
  • defaultBuildFeatures (128-147)

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: 1

🧹 Nitpick comments (1)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (1)

256-297: Version resolution script is functional with minor improvement opportunity.

The bash script correctly fetches and parses Maven metadata with appropriate error handling. The grep/sed approach works but could be fragile if XML formatting changes.

For more robust XML parsing, consider using xmllint:

-            # Extract the latest version using grep and sed
-            # This pattern looks for a <latest>version</latest> tag
-            LATEST_VERSION=$(grep -o '<latest>[^<]*</latest>' "${'$'}TEMP_FILE" | sed 's/<latest>\(.*\)<\/latest>/\1/')
+            # Extract the latest version using xmllint for robust XML parsing
+            LATEST_VERSION=$(xmllint --xpath 'string(//latest)' "${'$'}TEMP_FILE" 2>/dev/null)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42874ac and 614aade.

📒 Files selected for processing (1)
  • .teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (1)
.teamcity/src/subprojects/build/ProjectBuild.kt (1)
  • defaultBuildFeatures (128-147)
🔇 Additional comments (6)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (6)

18-21: LGTM: Clean abstraction.

The interface provides a clear contract for EAP sample configurations.


23-54: LGTM: Gradle init script is well-structured.

The script correctly sets up the EAP repository and uses System.getenv("KTOR_VERSION") for dependency resolution. The KTOR_VERSION environment variable is properly propagated in the build configurations at lines 148 and 188.


56-87: LGTM: Build logic correctly handles project variations.

The function properly handles standalone vs. nested projects and distinguishes between plugin and regular samples.


89-128: LGTM: Maven configuration is correct.

The Maven settings properly configure the EAP repository and use the resolved KTOR_VERSION. The propagation is correctly handled at line 188.


130-166: LGTM: KTOR_VERSION propagation correctly implemented.

Both extension functions now properly propagate env.KTOR_VERSION from the versionResolver (lines 148 and 188), addressing the critical issues raised in previous reviews. The snapshot dependencies ensure the resolver runs first.

Also applies to: 168-225


334-429: LGTM: Composite build structure is well-organized.

The hierarchical dependency structure correctly chains the individual sample builds through composites to the top-level validation build, with appropriate triggers on EAP publications.

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)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (3)

66-75: Consider clarifying the working directory logic.

The combination of workingDir and conditional cd commands works correctly but may be confusing for future maintainers. The logic is:

  • Regular samples: set workingDir = projectName
  • Plugin samples (standalone): work from root
  • Plugin samples (non-standalone): work from root, then cd samples/$projectName

Consider adding a comment explaining this structure or consolidating the logic.


109-109: Maven version property set both in settings and command line.

The Ktor version is configured both as a profile property (Line 109) and as a command-line argument (Line 127). This ensures coverage regardless of how POMs reference the version, though it may be redundant if POMs consistently use one approach.

Also applies to: 127-127


277-279: Consider more robust XML parsing.

The grep | sed approach for extracting the <latest> tag is fragile and may break if the XML contains unexpected whitespace or formatting. Consider using xmllint for more reliable parsing:

-            # Extract the latest version using grep and sed
-            # This pattern looks for a <latest>version</latest> tag
-            LATEST_VERSION=$(grep -o '<latest>[^<]*</latest>' "${'$'}TEMP_FILE" | sed 's/<latest>\(.*\)<\/latest>/\1/')
+            # Extract the latest version using xmllint
+            LATEST_VERSION=$(xmllint --xpath 'string(//latest)' "${'$'}TEMP_FILE" 2>/dev/null)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 614aade and d6b5623.

📒 Files selected for processing (1)
  • .teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (1)
.teamcity/src/subprojects/build/ProjectBuild.kt (1)
  • defaultBuildFeatures (128-147)
🔇 Additional comments (6)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (6)

19-22: LGTM: Clean abstraction for sample configurations.

The interface design enables polymorphic handling of both plugin and regular samples, setting up a solid foundation for the EAP validation workflow.


24-55: LGTM: Init script correctly forces EAP versions.

The Gradle init script properly overrides all io.ktor dependencies via resolutionStrategy.eachDependency. The KTOR_VERSION environment variable is correctly propagated from the version resolver (as confirmed by the addressed past comments).


147-150: LGTM: Version parameter propagation correctly wired.

The env.KTOR_VERSION parameter is now properly propagated from the version resolver via dependency parameter reference, and the snapshot dependency ensures the resolver runs first. This addresses the critical issue flagged in previous reviews.

Also applies to: 152-158


187-190: LGTM: Regular samples also get proper version propagation.

Like the plugin samples, regular samples now correctly receive env.KTOR_VERSION from the resolver via dependency parameter reference. This addresses the critical issue raised in earlier reviews.

Also applies to: 198-204


312-328: LGTM: Efficient filtering eliminates O(n²) waste.

The use of zip to create pairs once, followed by simple filtering, is a significant improvement over the previous approach that repeatedly called createEAPBuildType(). This addresses the performance concern raised in earlier reviews.


386-425: LGTM: Final composite cleanly aggregates all EAP validation.

The top-level composite correctly depends on both the plugin and regular sample composites, providing a single orchestration point for the entire EAP validation workflow with appropriate notifications.

@VGoncharova VGoncharova merged commit 3a2ea7c into master Oct 17, 2025
2 checks passed
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.

2 participants