zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
159 stars 89 forks source link

No spool file available for active job #2869

Closed tiantn closed 2 months ago

tiantn commented 2 months ago

Proposed changes

Release Notes

Milestone:

Changelog:

Types of changes

What types of changes does your code introduce to Zowe Explorer? Put an x in the boxes that 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

Further comments

Fix issue #2832

tiantn commented 2 months ago

Hi @tiantn, thanks for looking into this issue!

Rather than changing the stepname on the default response, could we update getSpoolFiles to return an empty array whenever we cannot fetch spool files? This would be consistent with "no spool files available" and avoids adding special handling for this kind of response from the FTP extension. With the current changes, we'd have to add a check within Zowe Explorer's job tree to validate the stepname, which I'd like to avoid if possible.

Thank you @traeok! I updated it to return an empty array.

std4lqi commented 2 months ago

@tiantn , I didn't try it yet, but wonder the empty array returned will make Zowe explorer shows nothing when user clicks to expand the active job, or Zowe explorer handled the empty array already, like showing a node with "No spool available"?

JillieBeanSim commented 2 months ago

@tiantn , I didn't try it yet, but wonder the empty array returned will make Zowe explorer shows nothing when user clicks to expand the active job, or Zowe explorer handled the empty array already, like showing a node with "No spool available"?

@std4lqi Zowe Explorer handles the empty array as successful API call with empty return and displays the node with "No spool available" as @traeok mentioned.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 93.47%. Comparing base (f415f38) to head (694b4a7).

Files Patch % Lines
...xplorer-ftp-extension/src/ZoweExplorerFtpJesApi.ts 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2869 +/- ## ========================================== - Coverage 93.49% 93.47% -0.02% ========================================== Files 103 103 Lines 10769 10771 +2 Branches 2255 2259 +4 ========================================== Hits 10068 10068 - Misses 700 702 +2 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JillieBeanSim commented 2 months ago

we have handling in ZE for the empty array with the spool.length check displaying "There are no JES spool messages to display" for the empty array of spool files for job. If see error may have a bug on ZE side.

traeok commented 2 months ago

we have handling in ZE for the empty array with the spool.length check displaying "There are no JES spool messages to display" for the empty array of spool files for job

While we do handle that scenario in getChildren, the ZoweSpoolNode constructor will still try to call encodeJobFile with an undefined spool object when constructing the placeholder node - this causes the error message above to appear when calling getChildren on the active job.

Since the issue is specific to Zowe Explorer's core logic, I don't mind pushing the fix to this PR, but I wanted to mention this first before doing so. Whatever works best for @tiantn works for me - I can pull and test the change once it's added, or I can push up the necessary changes to get this merged 😁

tiantn commented 2 months ago

@tiantn , I didn't try it yet, but wonder the empty array returned will make Zowe explorer shows nothing when user clicks to expand the active job, or Zowe explorer handled the empty array already, like showing a node with "No spool available"?

Hi @std4lqi , like the screenshot in @traeok ‘s comments below. Now it will show an error message. Seems Zowe explorer need additional update.

tiantn commented 2 months ago

we have handling in ZE for the empty array with the spool.length check displaying "There are no JES spool messages to display" for the empty array of spool files for job

While we do handle that scenario in getChildren, the ZoweSpoolNode constructor will still try to call encodeJobFile with an undefined spool object when constructing the placeholder node - this causes the error message above to appear when calling getChildren on the active job.

Since the issue is specific to Zowe Explorer's core logic, I don't mind pushing the fix to this PR, but I wanted to mention this first before doing so. Whatever works best for @tiantn works for me - I can pull and test the change once it's added, or I can push up the necessary changes to get this merged 😁

Thank you @traeok , @JillieBeanSim , I am not very familiar with Zowe Explorer's core logic. But if any thing I can do please let me know. 😄

traeok commented 2 months ago

Thank you @traeok , @JillieBeanSim , I am not very familiar with Zowe Explorer's core logic. But if any thing I can do please let me know. 😄

No worries @tiantn, I've pushed up a small change to this PR that will fix the behavior I mentioned - hope that's okay 😋 Thanks again for the fix!

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud