Skip to content

Conversation

@VGoncharova
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

Walkthrough

Adds EAP publish constant, fetches latest EAP Ktor version into env.KTOR_VERSION, wires that into EAP version resolution and sample/composite build flows, enables reuse of successful upstream EAP builds, adds finish-build triggers, and expands use of teamcity.build.skipDependencyBuilds and USE_LATEST_KTOR_GRADLE_PLUGIN flags across TeamCity EAP sample/validation/composite build configurations.

Changes

Cohort / File(s) Summary
TeamCity EAP sample & trigger configuration
./.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt
Added PUBLISH_BUILD_PLUGIN_TYPE_ID constant; added a script step to fetch latest EAP Ktor version and expose env.KTOR_VERSION; wired env.KTOR_VERSION into EAP version resolver flow; added reuseBuilds = SUCCESSFUL for KtorEAPVersionResolver dependencies; introduced env.USE_LATEST_KTOR_GRADLE_PLUGIN flag usage; added finishBuildTrigger blocks on multiple build types with successfulOnly and branch filters; set teamcity.build.skipDependencyBuilds = true in additional composite/sample validation contexts; updated createEAPSample to mark dependency builds reusable and skip dependency builds.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning No pull request description was provided, so there is no information describing the content or purpose of the changeset. Please add a pull request description that summarizes the key changes, their purpose, and the intended impact on EAP sample build triggers and related configurations.
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.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title “update EAP sample triggers” accurately and concisely summarizes the primary changes pushed in this pull request, which focus on updating and adding build triggers for EAP sample projects in the TeamCity configuration.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

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

42-79: Add curl timeout and consider XML parsing robustness.

The script correctly fetches and parses the Maven metadata, but consider these improvements:

  1. Add a timeout to the curl command to prevent indefinite hangs
  2. The grep/sed parsing is fragile if the XML structure changes
  3. Consider validating the extracted version format

Apply this diff to add timeout and improve robustness:

-                if ! curl -s "${'$'}METADATA_URL" -o "${'$'}TEMP_FILE"; then
+                if ! curl -s --max-time 30 --connect-timeout 10 "${'$'}METADATA_URL" -o "${'$'}TEMP_FILE"; then
                     echo "Failed to download metadata from ${'$'}METADATA_URL"
                     rm -f "${'$'}TEMP_FILE"
                     exit 1
                 fi
                 
                 # 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/')
                 
                 # Clean up temp file
                 rm -f "${'$'}TEMP_FILE"
                 
                 if [ -z "${'$'}LATEST_VERSION" ]; then
                     echo "Failed to extract latest version from metadata"
                     exit 1
                 fi
+                
+                # Validate version format (basic sanity check)
+                if ! echo "${'$'}LATEST_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+'; then
+                    echo "Warning: Version format doesn't match expected pattern: ${'$'}LATEST_VERSION"
+                fi

164-165: Remove extra blank line.

The parameter is correctly configured, but there's an unnecessary blank line at line 165.

Apply this diff:

             param("env.USE_LATEST_KTOR_GRADLE_PLUGIN", "true")
-
         }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e38bf3 and 857a2be.

📒 Files selected for processing (1)
  • .teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (6 hunks)
🔇 Additional comments (7)
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt (7)

15-15: LGTM!

The new constant follows the established pattern and is used consistently in the finishBuildTrigger configuration.


39-39: LGTM!

The teamcity.runAsFirstBuild parameter is appropriate for the version resolver build type, ensuring it runs before dependent builds.


114-120: LGTM!

Adding reuseBuilds = ReuseBuilds.SUCCESSFUL is appropriate here, as it prevents unnecessary re-runs of the version resolver when a successful build already exists.


108-111: LGTM!

Adding teamcity.build.skipDependencyBuilds here is consistent with the pattern used elsewhere in the file and appropriate for sample validation builds.


172-178: Verify that the branch filter should include all branches.

The finishBuildTrigger configuration looks correct, but the branchFilter = "+:*" will trigger validation for all branches. Ensure this is intentional, as you may want to restrict EAP validation to specific branches (e.g., master, main, or release branches).

If you want to restrict to specific branches, consider:

-                branchFilter = "+:*"
+                branchFilter = "+:master"

or for multiple branches:

-                branchFilter = "+:*"
+                branchFilter = """
+                    +:master
+                    +:main
+                """.trimIndent()

213-219: Verify that the branch filter should include all branches.

Similar to the build plugin trigger, this branchFilter = "+:*" will trigger validation for all branches. Confirm this aligns with your EAP validation strategy.


250-250: LGTM!

Properly configured to skip dependency builds in the composite build, consistent with the pattern used throughout this configuration.

@VGoncharova VGoncharova merged commit b0c0944 into master Sep 30, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 17, 2025
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