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

Fix Etag Mismatch auto saving #2316

Merged
merged 28 commits into from
Jun 6, 2023
Merged

Fix Etag Mismatch auto saving #2316

merged 28 commits into from
Jun 6, 2023

Conversation

JillieBeanSim
Copy link
Contributor

@JillieBeanSim JillieBeanSim commented May 30, 2023

Proposed changes

fix for #2277

Remove duplicate code and updated the handling of dirty file when etag mismatch error for MVS and z/OS UNIX files by marking file unsaved before pulling the latest changes to the local file then use the vscode built in command workspace.files.action.compareWithSaved.

This PR was originally based against maintenance so will also bring in the commits for 2.8.2 fix & release

Fixed the error returned by FTP ext to trigger the diff editor with mismatch etag.

Release Notes

Milestone: 2.9.0

Changelog:
ZE: Fixed an issue with mismatch etag error returned not triggering the diff editor and possible loss of data due to the issue. #2277
zFTP: - Fixed an issue with mismatch etag, correcting error message sent to Zowe Explorer to trigger diff editor. #2277

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

Theia:
Screen Shot 2023-06-02 at 7 45 51 AM

zFTP:
Screen Shot 2023-06-02 at 8 26 27 AM

JillieBeanSim and others added 8 commits May 22, 2023 15:07
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@JillieBeanSim JillieBeanSim added this to the v2.8.2 milestone May 30, 2023
@JillieBeanSim JillieBeanSim self-assigned this May 30, 2023
JillieBeanSim and others added 5 commits May 30, 2023 11:56
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Fix zowe.settings.version being added to workspace settings
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
@JillieBeanSim JillieBeanSim modified the milestones: v2.8.2, v2.9.0 Jun 1, 2023
@JillieBeanSim JillieBeanSim changed the base branch from maintenance to main June 1, 2023 19:35
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@JillieBeanSim JillieBeanSim marked this pull request as ready for review June 1, 2023 23:05
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Patch coverage: 84.84% and project coverage change: +0.14 🎉

Comparison is base (155ee55) 91.90% compared to head (c7f1d14) 92.05%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2316      +/-   ##
==========================================
+ Coverage   91.90%   92.05%   +0.14%     
==========================================
  Files          90       90              
  Lines        9242     9222      -20     
  Branches     1908     1906       -2     
==========================================
- Hits         8494     8489       -5     
+ Misses        747      732      -15     
  Partials        1        1              
Impacted Files Coverage Δ
...xplorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts 83.48% <0.00%> (-0.38%) ⬇️
...xplorer-ftp-extension/src/ZoweExplorerFtpUssApi.ts 87.41% <0.00%> (+0.57%) ⬆️
packages/zowe-explorer/src/shared/context.ts 94.68% <50.00%> (-0.98%) ⬇️
packages/zowe-explorer/src/dataset/actions.ts 94.25% <100.00%> (+0.58%) ⬆️
packages/zowe-explorer/src/shared/utils.ts 95.42% <100.00%> (+0.55%) ⬆️
packages/zowe-explorer/src/uss/actions.ts 93.50% <100.00%> (+2.66%) ⬆️
packages/zowe-explorer/src/utils/SettingsConfig.ts 100.00% <100.00%> (+0.97%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @JillieBeanSim 🙂 just had a question regarding implementation for putContents

Comment on lines +141 to +143
result.success = false;
result.commandResponse = "Rest API failure with HTTP(S) status 412 Save conflict.";
return result;
Copy link
Member

Choose a reason for hiding this comment

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

I noticed that the MVS API returns an unsuccessful result without throwing an error, but the USS API throws an error. I see that we are catching errors when calling this function, but should we maintain the same behavior/return value for when save conflicts appear in putContents across all FTP APIs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @traeok the FTP extension is just following the same protocol used with zosmf, I did notice USS and MVS are handled differently but that is how zowe cli was returning these and Zowe Explorer was built around that

@traeok traeok self-requested a review June 5, 2023 18:08
traeok
traeok previously approved these changes Jun 5, 2023
rudyflores
rudyflores previously approved these changes Jun 5, 2023
Copy link
Contributor

@rudyflores rudyflores left a comment

Choose a reason for hiding this comment

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

Tested this and it seems to be handling the conflicts and displaying the diff view on VS Code to handle saving mismatches, thanks @JillieBeanSim !

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
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.

I'm consistently getting the error that this PR fixes:

will re-review after that one

Changes LGTM though.

there will be a very small conflict with this other PR:

@sonarcloud
Copy link

sonarcloud bot commented Jun 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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! 😋
now we get the compare button for both FTP and ZE 🥳

@zFernand0 zFernand0 merged commit 636752c into main Jun 6, 2023
@zFernand0 zFernand0 deleted the fix/etag-mismatch branch June 6, 2023 19:10
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.

Extenders not being presented the compare option with mismatch etag
6 participants