Skip to content

Finish the ODO migration and clean up (CRW-13625) - #6246

Open
vrubezhny wants to merge 1 commit into
redhat-developer:mainfrom
vrubezhny:feature/CRW-13625-odo-complete-removal
Open

vrubezhny wants to merge 1 commit into
redhat-developer:mainfrom
vrubezhny:feature/CRW-13625-odo-complete-removal

Conversation

@vrubezhny

Copy link
Copy Markdown
Contributor

All odo-dependent functionality has been migrated to oc and the Kubernetes API, so the odo CLI tool is no longer bundled or used.

  • drop the odo entry from src/tools.json and delete the check-odo workflow that auto-bumped it; the bundled binaries are now oc, func, helm and alizer, and verifyBundledBinaries() checks all of them
  • remove the src/odo package: component description and creation call the devfile APIs directly (describeComponent, initComponent), func and oc CLI invocations go through CliChannel.executeTool(), and the still-used types moved next to their consumers (ComponentWorkspace in src/devfile, DevfileRegistryInfo in src/devfile-registry, builder images in src/oc)
  • store the devfile registry list in the new openshiftToolkit.devfileRegistries setting, with a one-time migration from ~/.odo/preference.yaml on activation
  • move the extension state files from .odo/ to .openshift-toolkit/ with read fallbacks and cleanup for the legacy locations, relabel dev-mode resources openshift-toolkit.dev/mode (matching both labels on undeploy), keep the registry download cache in the extension's global storage, and rename the run-command PID file
  • drop the ODO_TRACKING_CONSENT telemetry variable and rename the odo-named symbols (supportedFeatures, startDevAndConnectDebugger, cliChannel, deleteComponentStateFiles)
  • reorganize tests around the new code paths: CliChannel.executeTool is covered by the new test/unit/cli.test.ts, registry settings by devfileRegistrySettings.test.ts, legacy state fallbacks are tested, and tests of pure odo-binary behavior are removed
  • clean odo mentions from the docs and the welcome page

Issue: https://redhat.atlassian.net/browse/CRW-13625
Issue: #4320
Fixes: #6244

Assisted-By: OpenCode: GLM 5.3

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.29412% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.98%. Comparing base (2fece3a) to head (e24f7bb).

Files with missing lines Patch % Lines
src/registriesView.ts 26.66% 11 Missing ⚠️
src/openshift/component.ts 56.25% 7 Missing ⚠️
src/devfile/init.ts 60.00% 6 Missing ⚠️
src/devfile/undeploy.ts 62.50% 6 Missing ⚠️
src/devfile/deployStateFile.ts 81.48% 5 Missing ⚠️
.../webview/create-component/createComponentLoader.ts 28.57% 5 Missing ⚠️
src/devfile/describe.ts 50.00% 4 Missing ⚠️
src/serverlessFunction/manageRepository.ts 20.00% 4 Missing ⚠️
src/util/childProcessUtil.ts 66.66% 3 Missing ⚠️
...ew/serverless-function/serverlessFunctionLoader.ts 25.00% 3 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6246      +/-   ##
==========================================
+ Coverage   51.97%   51.98%   +0.01%     
==========================================
  Files         131      132       +1     
  Lines       12343    12299      -44     
  Branches     3019     2818     -201     
==========================================
- Hits         6415     6394      -21     
+ Misses       5924     5903      -21     
+ Partials        4        2       -2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vrubezhny
vrubezhny marked this pull request as draft November 4, 2026 13:32
@vrubezhny
vrubezhny force-pushed the feature/CRW-13625-odo-complete-removal branch 3 times, most recently from a359733 to 24a331d Compare November 4, 2026 20:05
@vrubezhny
vrubezhny marked this pull request as ready for review November 4, 2026 21:06
@vrubezhny
vrubezhny force-pushed the feature/CRW-13625-odo-complete-removal branch 3 times, most recently from a55aafa to 54ee135 Compare November 23, 2026 12:26
@vrubezhny
vrubezhny force-pushed the feature/CRW-13625-odo-complete-removal branch from 54ee135 to 5467713 Compare November 26, 2026 21:02
Comment thread src/openshift/component.ts Outdated
let shouldBeRunning = false;
try {
const stateFile = path.join(contextPath, '.odo', 'deploystate.json');
const stateFile = deployStateFilePath(contextPath);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new deployStateFilePath() only resolves the .openshift-toolkit location, but this code still reads the file directly using readFile(). This bypasses the legacy fallback implemented in loadDeployState() / readStateFile().

As a result, users upgrading from an older extension with an existing .odo/deploystate.json may no longer have their deployed component state detected correctly.

Could we reuse loadDeployState() here instead of reading the new state-file path directly? This would preserve backward compatibility during the state-directory migration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now:

  • New loadDeployStateFor(cluster, namespace, componentPath) in deployStateFile.ts — loads via readStateFile() (.openshift-toolkit/ → legacy .odo/ fallback), v1 cluster/namespace match semantics and v2 context-key lookup identical to the old inline code
  • reconcileDeployState collapsed to a 6-line call to it — the direct readFile + now-dead deployStateFilePath (removed) are gone, along with unused readFile/deployContextKey/DeployState imports
  • 10 new unit tests (test/unit/devfile/deployStateFile.test.ts): legacy fallback, new-over-legacy precedence, v1 match/mismatch, v2 key hit/miss, missing/invalid file

Comment thread src/extension.ts Outdated
await verifyBinariesInRemoteContainer();

void OdoPreference.Instance.getRegistries(); // Initializes '~/.odo/preference.json', if not initialized yet
void DevfileRegistrySettings.Instance.migrateFromOdoPreference(); // Migrates '~/.odo/preference.yaml' into settings, if needed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we await migrateFromOdoPreference() during activation?

Currently, activation continues while the migration runs asynchronously. A registry-related operation could execute before migration completes and read the default registry configuration instead of the user's existing custom registries.

Since DevfileRegistry.getRegistries() also caches the registry list in its execution context, this could potentially leave stale registry data after migration.

Could we await the migration before allowing registry-dependent operations, or otherwise invalidate the registry cache after migration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now:

  • migrateFromOdoPreference() now awaited and moved to the top of activate() (right after the extensionContext assignments, before any view/provider creation) — no registry-dependent operation can observe unmigrated defaults, and DevfileRegistry's execution-context cache can never be populated with them

All odo-dependent functionality has been migrated to oc and the
Kubernetes API, so the odo CLI tool is no longer bundled or used.

- drop the odo entry from src/tools.json and delete the check-odo
  workflow that auto-bumped it; the bundled binaries are now oc, func,
  helm and alizer, and verifyBundledBinaries() checks all of them
- remove the src/odo package: component description and creation call
  the devfile APIs directly (describeComponent, initComponent), func
  and oc CLI invocations go through CliChannel.executeTool(), and the
  still-used types moved next to their consumers (ComponentWorkspace
  in src/devfile, DevfileRegistryInfo in src/devfile-registry,
  builder images in src/oc)
- store the devfile registry list in the new
  openshiftToolkit.devfileRegistries setting, with a one-time
  migration from ~/.odo/preference.yaml on activation
- move the extension state files from .odo/ to .openshift-toolkit/
  with read fallbacks and cleanup for the legacy locations, relabel
  dev-mode resources openshift-toolkit.dev/mode (matching both labels
  on undeploy), keep the registry download cache in the extension's
  global storage, and rename the run-command PID file
- drop the ODO_TRACKING_CONSENT telemetry variable and rename the
  odo-named symbols (supportedFeatures, startDevAndConnectDebugger,
  cliChannel, deleteComponentStateFiles)
- reorganize tests around the new code paths: CliChannel.executeTool
  is covered by the new test/unit/cli.test.ts, registry settings by
  devfileRegistrySettings.test.ts, legacy state fallbacks are tested,
  and tests of pure odo-binary behavior are removed
- clean odo mentions from the docs and the welcome page

Issue: https://redhat.atlassian.net/browse/CRW-13625
Issue: redhat-developer#4320
Fixes: redhat-developer#6244

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Assisted-By: OpenCode: GLM 5.3
@vrubezhny
vrubezhny force-pushed the feature/CRW-13625-odo-complete-removal branch from 5467713 to e24f7bb Compare December 1, 2026 23:24

This branch has not been deployed

No deployments
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.

Finish the ODO migration and clean up

2 participants