Skip to content

Conversation

@VGoncharova
Copy link
Contributor

No description provided.

…a fetch logic, improve version resolution and validation steps, and enhance fallback mechanisms for missing or invalid versions
@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Walkthrough

Enhanced EAP version resolution logic in the TeamCity configuration file to support two-step metadata-based lookup (attempting latest tag first, then highest available version) with multiple fallback layers and added validation to correct invalid plugin versions.

Changes

Cohort / File(s) Summary
EAP Version Resolution Enhancement
.teamcity/src/subprojects/train/TriggerProjectSamplesOnEAP.kt
Implemented broader EAP version resolution with two-step approach: attempt latest tag from metadata, fall back to highest version. Added fallback paths using framework version if no suitable version found. Strengthened validation to detect and correct plugin versions starting with -eap- by resetting to framework version. Expanded metadata logging throughout for improved debugging visibility.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Version resolution logic: Multiple conditional branches and fallback paths require careful verification to ensure correct precedence and behavior in edge cases.
  • Validation and correction logic: New plugin version validation that detects and resets invalid -eap- prefixed versions needs thorough testing across scenarios.
  • Metadata handling: Understanding how metadata is fetched, logged, and used across different code paths to prevent regression.
  • Fallback chain: Complex cascading fallbacks (latest tag → highest version → framework version) must be traced to ensure no broken states or infinite loops.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
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.
Description Check ❓ Inconclusive The pull request has no description provided by the author. While the lenient check criteria states that it should pass as long as the description is not completely off-topic, a missing description prevents verification that the requirement of being "related in some way to the changeset" is satisfied. The absence of any descriptive content creates an ambiguous situation that cannot be conclusively assessed against the pass criterion.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "update Ktor EAP trigger settings: refine plugin and framework metadata fetch logic, improve version resolution and validation steps, and enhance fallback mechanisms for missing or invalid versions" is fully aligned with the changeset content. The summary shows changes to EAP version resolution, metadata handling, validation steps, and fallback logic for the Ktor build trigger system, which directly matches all components of the title. While the title is lengthy at 27 words, it remains specific and descriptive enough for a teammate to understand the primary changes without ambiguity.
✨ 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.

@VGoncharova VGoncharova merged commit aadc887 into master Oct 31, 2025
1 of 2 checks passed
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)

189-206: Trim metadata-sourced values before emitting service message.

TeamCity service messages must stay on one line; if <latest> ever comes back with indentation or incidental whitespace, we’ll echo a malformed setParameter. Please strip whitespace from the extracted value before we write it to stdout.

-                        LATEST_PLUGIN_VERSION=$(grep -o "<latest>[^<]*</latest>" "${'$'}TEMP_METADATA" | sed 's/<latest>//;s/<\/latest>//')
+                        LATEST_PLUGIN_VERSION=$(grep -o "<latest>[^<]*</latest>" "${'$'}TEMP_METADATA" | sed 's/<latest>//;s/<\/latest>//' | tr -d '[:space:]')

832-845: Apply the same whitespace trimming in the resolver step.

The resolver script should make the same guarantee as the detection step—sanitize the <latest> value before handing it to TeamCity so we never emit a multi-line service message.

-                                LATEST_PLUGIN_VERSION=$(grep -o "<latest>[^<]*</latest>" "${'$'}TEMP_METADATA" | sed 's/<latest>//;s/<\/latest>//')
+                                LATEST_PLUGIN_VERSION=$(grep -o "<latest>[^<]*</latest>" "${'$'}TEMP_METADATA" | sed 's/<latest>//;s/<\/latest>//' | tr -d '[:space:]')

854-856: Clean up the mktemp file on the failure path.

When curl fails we leave the ${'$'}TEMP_METADATA file behind. It’s small, but over repeated runs the temp dir will accumulate leftovers. A quick cleanup in the else branch keeps parity with the success path.

                         else
                             echo "WARNING: Could not fetch plugin metadata, using framework version as fallback"
                             PLUGIN_VERSION="${'$'}FRAMEWORK_VERSION"
+                            rm -f "${'$'}TEMP_METADATA"
                         fi
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 182601d and 6dcbb47.

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

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