Skip to content

fix: relax che-editor ID detection to match any path segment (CRW-11960)#344

Open
vrubezhny wants to merge 1 commit into
redhat-developer:mainfrom
vrubezhny:fix/che-editor-id-check-any-segment
Open

fix: relax che-editor ID detection to match any path segment (CRW-11960)#344
vrubezhny wants to merge 1 commit into
redhat-developer:mainfrom
vrubezhny:fix/che-editor-id-check-any-segment

Conversation

@vrubezhny

Copy link
Copy Markdown
Collaborator

Previously the quick editor ID check hardcoded index 1, assuming the che-editor annotation always had the format "prefix/editor-name/version". This failed when the prefix or version segments were absent.

Now all "/"-separated segments are checked against the regex, so values like "che-idea-server", "che-idea-server/latest", or "eclipse/che-idea-server/latest" are all correctly detected.

Fixes: https://redhat.atlassian.net/browse/CRW-11960

Assisted-By: Claude Opus 4.6 noreply@anthropic.com

Previously the quick editor ID check hardcoded index 1, assuming the
che-editor annotation always had the format "prefix/editor-name/version".
This failed when the prefix or version segments were absent.

Now all "/"-separated segments are checked against the regex, so values
like "che-idea-server", "che-idea-server/latest", or
"eclipse/che-idea-server/latest" are all correctly detected.

Fixes: https://redhat.atlassian.net/browse/CRW-11960

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

isIdeaEditorBased now checks all slash-separated editor annotation segments for a matching IDEA editor ID. Tests cover full paths, names, versions, prefixes, non-IDEA editors, and unknown values.

Changes

IDE editor detection

Layer / File(s) Summary
Editor matching and validation
src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt, src/test/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspacesTest.kt
Editor ID matching scans every annotation path segment, with tests for recognized and unrecognized editor formats using a workspace construction helper.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: azatsarynnyy, adietish

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: relaxing che-editor ID detection across path segments.
Description check ✅ Passed The description matches the code changes and explains the updated segment-based editor ID detection.

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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.42%. Comparing base (71098f6) to head (3ae5825).
⚠️ Report is 394 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##            main     #344       +/-   ##
==========================================
+ Coverage   0.00%   32.42%   +32.42%     
==========================================
  Files          4      111      +107     
  Lines         26     4565     +4539     
  Branches       0      861      +861     
==========================================
+ Hits           0     1480     +1480     
- Misses        26     2883     +2857     
- Partials       0      202      +202     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vrubezhny vrubezhny changed the title fix: relax che-editor ID detection to match any path segment fix: relax che-editor ID detection to match any path segment (CRW-11960) Jul 23, 2026
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