Repository navigation
Conversation
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
a359733 to
24a331d
Compare
a55aafa to
54ee135
Compare
54ee135 to
5467713
Compare
| let shouldBeRunning = false; | ||
| try { | ||
| const stateFile = path.join(contextPath, '.odo', 'deploystate.json'); | ||
| const stateFile = deployStateFilePath(contextPath); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
5467713 to
e24f7bb
Compare
All odo-dependent functionality has been migrated to oc and the Kubernetes API, so the odo CLI tool is no longer bundled or used.
Issue: https://redhat.atlassian.net/browse/CRW-13625
Issue: #4320
Fixes: #6244
Assisted-By: OpenCode: GLM 5.3