Skip to content

Conversation

@ATorrise
Copy link
Contributor

@ATorrise ATorrise commented Aug 25, 2025

Proposed changes

When two profiles point to the same shared storage but use different authentication methods (ie basic auth vs. APIML) the Zowe's VSCE previously allowed a drag-and-drop that looked like a cross-LPAR move.

This results in confusing behavior and can lead to accidental deletion even though the source and target were actually the same object. In reality no move is necessary and should be prevented.

This change adds explicit detection of “same-object” situations in both Dataset and USS trees and blocks the drop operation.

If a blocked condition is detected:

  1. the operation is stopped and the user sees:
Cannot move: The source and target are the same. You are using a different profile to view the target. Refresh to view changes.
  1. Overwriting the same physical data under another profile is prevented.

How to Test

Situations to test:

  • Create 2 different profiles that are actually utilizing the same storage - check for new "Cannot move" error
  • Ensure that when one of those profiles is not expanded in the VSCode tree, that you are prompted to open the profile at a specific directory. I added this safeguard because there were some instances where a file was "moved" but was actually just lost
  • Test that you can in fact move the file/folder/data set/pds to a profile utilizing different storage

Release Notes

Changelog:
Bug Fix – Prevent drag-and-drop between profiles when the source and target resolve to the same object (same DSN on same DASD for MVS, or same path for USS). The operation is now blocked and an explanatory error is shown. Users should Refresh the target profile to see changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have tested new functionality with the FTP extension and profile verifying no extender profile type breakages introduced
  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Signed-off-by: Amber <[email protected]>
@github-actions
Copy link

github-actions bot commented Aug 25, 2025

zowe-explorer-vsix Download
Build Details
Name Information
PR Commit fe604b0
Merge Commit d2956db
Size 3.7 MB
Last Updated By ATorrise
Last Updated Oct 7, 25, 5:55:06 PM UTC
Expires At Jan 5, 26, 5:53:18 PM UTC

@anaxceron
Copy link
Contributor

@ATorrise suggestion for the message is below. Lmk if you have any thoughts on this.

Cannot move: The source and target are the same. You are using a different profile to view the target. Refresh to view changes.

Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

Left some suggestions for the changelog entry and the user message.

if (targetSys == sourceSys) {
await Gui.errorMessage(
vscode.l10n.t(
"Cannot move: the source and target are the same dataset on the same system. You're viewing it under a different profile. Any changes you need to view with target profile can be seen via a refresh."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested message:

Cannot move: The source and target are the same. You are using a different profile to view the target. Refresh to view changes.

Co-authored-by: anaxceron <[email protected]>
Signed-off-by: Amber Torrise <[email protected]>
@ATorrise ATorrise changed the title Preventing Same-LPAR / Same-Dataset Drag-and-Drop Preventing Same-DASD & Same-DSN Drag-and-Drop Aug 27, 2025
Signed-off-by: Amber Torrise <[email protected]>
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

LGTM! 😋

This should work in most scenarios. However, we should warn the users about some of the edge cases.

@ATorrise ATorrise requested a review from pujal0909 October 7, 2025 14:37
@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 7, 2025
@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

❌ Patch coverage is 75.60976% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.95%. Comparing base (b104cb2) to head (fe604b0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ages/zowe-explorer/src/trees/shared/SharedUtils.ts 85.71% 4 Missing ⚠️
packages/zowe-explorer/src/trees/uss/USSTree.ts 20.00% 4 Missing ⚠️
...ges/zowe-explorer/src/trees/dataset/DatasetTree.ts 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3827      +/-   ##
==========================================
- Coverage   94.00%   93.95%   -0.05%     
==========================================
  Files         129      129              
  Lines       15472    15510      +38     
  Branches     3732     3592     -140     
==========================================
+ Hits        14545    14573      +28     
- Misses        925      935      +10     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 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.

@ATorrise ATorrise marked this pull request as ready for review October 28, 2025 14:35
@zowe-robot zowe-robot moved this from In Progress to Review/QA in Zowe Explorer for VS Code Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review/QA

Development

Successfully merging this pull request may close these issues.

Drag and drop data set onto different profile on same LPAR deletes the data set

5 participants