Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Detect remote conflicts when uploading data sets or USS files #197

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

traeok
Copy link
Member

@traeok traeok commented Mar 11, 2025

What It Does

  • Adds conflict detection in zowex to prevent overwriting changes made on the remote system.
    • When the developer/user passes an E-tag as part of their write request, it will compare the current e-tag to the one that's given. If the tags do not match, this indicates a change was made on the mainframe and the write request fails as a result (e-tag mismatch)
    • If the user does not pass an e-tag, this assumes a destructive operation, and the write request always overwrites the contents of the Data Set or USS file.

The following methods are used to build e-tags:

  • USS files: <mtime in hex>-<byte size in hex>
    • Example: 4d101bfc-7 for a file with 7 bytes
  • Data Set: SIMD-optimized Adler-32 algorithm
    • Adler-32 is a faster alternative to CRC32. This implementation takes advantage of SIMD support in newer hardware so that the checksum is calculated in chunks of 16 bytes rather than each byte at a time.

How to Test

  • USS file:
    1. Open up a USS file through your SSH profile in Zowe Explorer
    2. From a terminal in the same window, open an SSH connection to the same server and make a change to the same USS file
    3. Make a change to the file in the Zowe Explorer editor and save
    4. Notice the conflict dialog appears and you are prompted to compare changes or overwrite
    • Clicking "Compare" shows the server data beside your requested changes
    • Clicking "Overwrite" replaces the data on the server with your changes
  • Data Set:
    • This is more complicated to reproduce because once alt-tabbing back into ZE, the change detection pulls the new data for the data set before a conflict can occur. However, if you change the data set from a 3270 emulator without changing window focus in VS Code, OR if another person introduces the conflict, you can follow step iii and onward for "USS file".

Review Checklist
I certify that I have:

traeok and others added 17 commits March 3, 2025 16:01
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
@traeok traeok linked an issue Mar 11, 2025 that may be closed by this pull request
@traeok traeok linked an issue Mar 11, 2025 that may be closed by this pull request
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
4.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Implement conflict detection
2 participants