feat: W-18337792 - org display command does not rely on CLI but on core library #6395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This pull request introduces significant improvements to the Salesforce DX utilities and Apex Debugger modules, focusing on replacing CLI-based org information retrieval with a more robust approach using the Salesforce Core library. It also includes code refactoring, bug fixes, and enhancements to unit tests.
Refactoring and Core Library Integration:
OrgDisplay
with a new implementation using the@salesforce/core-bundle
library. This includes methods for retrieving org details, handling scratch orgs, and detecting connection status. ([1], [2], [3], [4])OrgQueryResult
,ScratchOrgQueryResult
,ScratchOrgInfo
) to support the enhanced org information retrieval. (packages/salesforcedx-utils/src/types/orgInfo.tsR20-R52)Bug Fixes and Code Improvements:
this.projectPath
assignment inApexReplayDebug
to ensure it is set before being accessed. (packages/salesforcedx-apex-replay-debugger/src/adapter/apexReplayDebug.tsL86-R88)projectPath
parameter fromfetchOverlayResultsForApexHeapDumps
and other related methods to simplify the code. ([1], [2])Unit Test Enhancements:
OrgDisplay
unit tests to mock Salesforce Core library components and validate the new org information retrieval logic. Added tests for various scenarios, such as handling scratch orgs, sandboxes, and missing usernames. (packages/salesforcedx-utils/test/jest/cli/orgDisplay.test.tsL7-R225)Dependency Updates:
@salesforce/core-bundle
as a dependency insalesforcedx-utils
to enable the new org information retrieval functionality. (packages/salesforcedx-utils/package.jsonR19)What issues does this PR fix or reference?
@W-18337792@