Skip to content

Add helpful warnings to migration tool#8037

Merged
deleonio merged 17 commits intodevelopfrom
feature/update-migrations-tool-auf-3.0.1
Jul 21, 2025
Merged

Add helpful warnings to migration tool#8037
deleonio merged 17 commits intodevelopfrom
feature/update-migrations-tool-auf-3.0.1

Conversation

@deleonio
Copy link
Copy Markdown
Contributor

@deleonio deleonio commented Jul 15, 2025

This pull request introduces several updates to the kolibri-cli tool, including improvements to error handling, support for asynchronous command parsing, and enhancements to the migration process. It also includes updates to the test suite and minor changes to the visual tests utility. Below are the most important changes grouped by theme:

Command Parsing and Execution:

  • Replaced synchronous command parsing (program.parse()) with asynchronous parsing (program.parseAsync()) across multiple files to improve non-blocking execution. ([[1]](https://github.com/public-ui/kolibri/pull/8037/files#diff-a6e505ca1bce6beb1c26ea6eaa817b6a7917584fbff1528c591329eadc51023aL34-R34), [[2]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L13-R58), [[3]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L71-R76))

Migration Enhancements:

  • Added validation to check if the source folder exists and contains KoliBri component tags before proceeding with migration tasks. This includes logging warnings if no tags or modifications are detected. ([[1]](https://github.com/public-ui/kolibri/pull/8037/files#diff-0f4c1099a75fc41acdcfd8e777ddec500af1b5e7f335cfad1b33bdc78638b909R95-R101), [[2]](https://github.com/public-ui/kolibri/pull/8037/files#diff-0f4c1099a75fc41acdcfd8e777ddec500af1b5e7f335cfad1b33bdc78638b909R214-R217))
  • Introduced the hasKoliBriTags utility function to efficiently scan directories for KoliBri component tags (web or React) using regex patterns. ([packages/tools/kolibri-cli/src/migrate/shares/reuse.tsR64-R102](https://github.com/public-ui/kolibri/pull/8037/files#diff-b2916f4608b5373374152773dfcf75d1b67e52e9f482abc70be174ca6ff99a55R64-R102))
  • Defined new constants WEB_TAG_REGEX and REACT_TAG_REGEX for identifying KoliBri tags in markup files. ([packages/tools/kolibri-cli/src/types.tsR8-R10](https://github.com/public-ui/kolibri/pull/8037/files#diff-f6fa260b90aef11eeffd413f2460122fa7ab99105e603faac41aa82bc13cf596R8-R10))

Test Suite Updates:

  • Updated CLI interface tests to use asynchronous parsing (program.parseAsync) and ensured proper restoration of the working directory after tests. ([[1]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L13-R58), [[2]](https://github.com/public-ui/kolibri/pull/8037/files#diff-43c2c697e00052437a19b2faa0283bbf06768b62c65dd6ef6f525bfab54ead45L90-R102))

Utility Improvements:

  • Enhanced temporary directory handling in getBinaryVersion to prevent unintended modifications to package.json when using Yarn with Corepack. ([packages/tools/kolibri-cli/src/info/index.tsR11-R23](https://github.com/public-ui/kolibri/pull/8037/files#diff-4dd1057d925acf329dc208b76c7ed41617399e25be3b3f6aa6ecdc6f363e0136R11-R23))
  • Updated tempDir handling in visual tests utility to fall back to os.tmpdir() when environment variables are not set. ([packages/tools/visual-tests/src/index.jsR9-R11](https://github.com/public-ui/kolibri/pull/8037/files#diff-f61a4e5c7dd4a054ee031451088f13b7355212e7b53766f6ae8d5eed1e0d9f15R9-R11))

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 15, 2025

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 15, 2025

Hydration Benchmark Report (vs Baseline)

✅ Top 5 Improvements (Best Speedups)

Component Current Baseline Δ% Result
kol-form 28.8ms 35.6ms -19.1%
kol-input-color 69.2ms 81.9ms -15.5%
kol-input-radio 48ms 56.5ms -15%
kol-nav 29.5ms 33.9ms -13%
kol-spin 22.1ms 24.2ms -8.7%

🔻 Flop 5 Regressions (Worst Slowdowns)

Component Current Baseline Δ% Result
kol-drawer 40.9ms 25.6ms +59.8% 🔻
kol-card 30ms 22.6ms +32.7% 🔻
kol-quote 22.7ms 19ms +19.5% 🔻
kol-tree-item 73ms 64ms +14.1% 🔻
kol-link 55.1ms 49.8ms +10.6% 🔻
📋 Show all results
Component Current Baseline Δ% Result
kol-abbr 19.5ms 19.8ms -1.5%
kol-accordion 132.2ms 131ms +0.9%
kol-alert 114.1ms 105.9ms +7.7%
kol-avatar 25.5ms 26.9ms -5.2%
kol-badge 66.1ms 70.1ms -5.7%
kol-breadcrumb 93ms 97.6ms -4.7%
kol-button 59.2ms 63ms -6%
kol-button-link 51ms 50.7ms +0.6%
kol-card 30ms 22.6ms +32.7% 🔻
kol-details 127.1ms 134.9ms -5.8%
kol-drawer 40.9ms 25.6ms +59.8% 🔻
kol-form 28.8ms 35.6ms -19.1%
kol-heading 22.1ms 21.5ms +2.8%
kol-icon 66.6ms 65.1ms +2.3%
kol-image 18.9ms 19.3ms -2.1%
kol-input-checkbox 135.5ms 141.3ms -4.1%
kol-input-color 69.2ms 81.9ms -15.5%
kol-input-date 71.8ms 70.3ms +2.1%
kol-input-email 61.3ms 62.5ms -1.9%
kol-input-file 92.1ms 93.7ms -1.7%
kol-input-number 61.9ms 56.1ms +10.3% 🔻
kol-input-password 51.5ms 51.6ms -0.2%
kol-input-radio 48ms 56.5ms -15%
kol-input-text 60.8ms 59.3ms +2.5%
kol-link 55.1ms 49.8ms +10.6% 🔻
kol-link-button 61.6ms 56.5ms +9%
kol-modal 20.4ms 20.5ms -0.5%
kol-nav 29.5ms 33.9ms -13%
kol-pagination 433.8ms 423.8ms +2.4%
kol-popover-button 69.1ms 71.3ms -3.1%
kol-progress 33ms 32.8ms +0.6%
kol-quote 22.7ms 19ms +19.5% 🔻
kol-select 116.6ms 117.1ms -0.4%
kol-skip-nav 23.8ms 23.6ms +0.8%
kol-spin 22.1ms 24.2ms -8.7%
kol-split-button 168.8ms 174.7ms -3.4%
kol-table-stateful 391.4ms 374.7ms +4.5%
kol-table-stateless 432.2ms 437ms -1.1%
kol-tabs 34.1ms 32.3ms +5.6%
kol-textarea 53ms 54.1ms -2%
kol-toolbar 34.6ms 36ms -3.9%
kol-tree 27.3ms 26.5ms +3%
kol-tree-item 73ms 64ms +14.1% 🔻
kol-version 153.8ms 154.8ms -0.6%

@deleonio deleonio requested review from Copilot and laske185 July 15, 2025 12:08

This comment was marked as outdated.

@deleonio deleonio requested a review from Copilot July 16, 2025 20:58

This comment was marked as outdated.

@deleonio deleonio force-pushed the feature/update-migrations-tool-auf-3.0.1 branch from 2c1d3b4 to 74386e0 Compare July 16, 2025 21:06
@deleonio deleonio requested a review from Copilot July 16, 2025 21:07

This comment was marked as outdated.

@deleonio deleonio requested a review from Copilot July 17, 2025 03:24

This comment was marked as outdated.

deleonio and others added 3 commits July 17, 2025 05:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
@deleonio deleonio requested a review from Copilot July 17, 2025 07:11

This comment was marked as outdated.

deleonio and others added 4 commits July 17, 2025 09:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Martin <6279703+deleonio@users.noreply.github.com>
@deleonio deleonio requested a review from Copilot July 17, 2025 18:34
Copy link
Copy Markdown
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 enhances the KoliBri CLI migration tool by adding validation checks and improved user feedback to guide users when migrating projects. The changes help identify potential issues early and provide clearer guidance when migrations don't find KoliBri components or produce no file modifications.

  • Added regex-based detection of KoliBri tags in project files to validate migration targets
  • Implemented directory existence validation and warning messages for empty migration results
  • Enhanced console output to provide better user guidance during the migration process

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
packages/tools/visual-tests/src/index.js Improved fallback logic for temporary directory resolution by adding os.tmpdir()
packages/tools/kolibri-cli/src/types.ts Added regex patterns for detecting KoliBri web and React component tags
packages/tools/kolibri-cli/src/migrate/shares/reuse.ts Implemented hasKolibriTags function to scan files for KoliBri component usage
packages/tools/kolibri-cli/src/migrate/index.ts Integrated validation checks and enhanced user feedback in migration workflow

Comment thread packages/tools/kolibri-cli/src/migrate/shares/reuse.ts Outdated
Comment thread packages/tools/kolibri-cli/src/migrate/shares/reuse.ts Outdated
Comment thread packages/tools/kolibri-cli/src/types.ts
Comment thread packages/tools/kolibri-cli/src/types.ts
@deleonio deleonio marked this pull request as ready for review July 21, 2025 08:57
@deleonio deleonio merged commit 7616bed into develop Jul 21, 2025
9 checks passed
@deleonio deleonio deleted the feature/update-migrations-tool-auf-3.0.1 branch July 21, 2025 09:05
@publicuibot publicuibot bot locked and limited conversation to collaborators Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants