Skip to content

Improve legacy project migration by resolving nature from pom.xml#1553

Merged
chathuranga-jayanath-99 merged 13 commits intowso2:release/mi-3.1.5from
chathuranga-jayanath-99:update-legacy-project-migration
Feb 25, 2026
Merged

Improve legacy project migration by resolving nature from pom.xml#1553
chathuranga-jayanath-99 merged 13 commits intowso2:release/mi-3.1.5from
chathuranga-jayanath-99:update-legacy-project-migration

Conversation

@chathuranga-jayanath-99
Copy link
Contributor

@chathuranga-jayanath-99 chathuranga-jayanath-99 commented Feb 25, 2026

Purpose

For projects identified as legacy, if the nature is not properly configured in the .project file, the correct nature is now resolved using the pom.xml file as a fallback mechanism.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Enhanced project type detection logic to prioritize configuration file analysis in the correct order, improving detection accuracy and reliability for project identification.

For projects identified as legacy, if the nature is not properly configured
in the .project file, the correct nature is now resolved using the pom.xml file
as a fallback mechanism.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@workspaces/mi/mi-extension/src/util/migrationUtils.ts`:
- Around line 990-1013: Fix the typo in the parseString error log inside
getNatureFromProjectFile: change the message from "Error occured while reading "
to "Error occurred while reading " so the console.error call in the parseString
callback uses the correct spelling; update only the string literal passed to
console.error in the parseString error branch of getNatureFromProjectFile.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33bc48f and 34525b7.

📒 Files selected for processing (1)
  • workspaces/mi/mi-extension/src/util/migrationUtils.ts

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 pull request improves the migration process for legacy WSO2 projects by enhancing the determineProjectType function to use pom.xml as a fallback mechanism when the .project file either doesn't contain a proper nature configuration or identifies the project as LEGACY (e.g., when it only contains org.eclipse.m2e.core.maven2Nature).

Changes:

  • Refactored duplicate XML parsing logic into a new getNatureFromProjectFile helper function
  • Added fallback logic to resolve project nature from pom.xml when .project file returns undefined or LEGACY nature
  • Added comprehensive JSDoc documentation for the new helper function

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

@chathuranga-jayanath-99 chathuranga-jayanath-99 merged commit 978fa57 into wso2:release/mi-3.1.5 Feb 25, 2026
6 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.

4 participants