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: Add SMFID to Jobs Tree View #2629

Merged
merged 8 commits into from
Dec 19, 2023
Merged

Conversation

SanthoshiBoyina
Copy link
Contributor

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

  • 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

Signed-off-by: Santhoshi Boyina <[email protected]>
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (94db84d) 93.21% compared to head (f47317a) 93.23%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2629      +/-   ##
==========================================
+ Coverage   93.21%   93.23%   +0.01%     
==========================================
  Files         104      104              
  Lines       10411    10414       +3     
  Branches     2200     2203       +3     
==========================================
+ Hits         9705     9709       +4     
+ Misses        705      704       -1     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

SanthoshiBoyina1 and others added 3 commits December 15, 2023 20:03
Signed-off-by: Santhoshi Boyina <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
@JillieBeanSim JillieBeanSim linked an issue Dec 15, 2023 that may be closed by this pull request
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

Thanks @SanthoshiBoyina for this enhancement, it works great for profile types that return the value and that don't. Once code coverage it up, I think this PR will be good to go.

Signed-off-by: Santhoshi Boyina <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
Copy link
Contributor

@JillieBeanSim JillieBeanSim 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 @SanthoshiBoyina for this enhancement and thanks for upping the code coverage!

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 @SanthoshiBoyina! Since my comments are mostly focused on test code, I won't request changes - just wanted to mention a couple things 😋

expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - ACTIVE");
});

it("To check smfid field when return code is undefined", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I might be misinterpreting the name for this test case, but I believe that the test code is checking for the opposite scenario:

Suggested change
it("To check smfid field when return code is undefined", async () => {
it("Does not add the SMFID field when return code is undefined", async () => {

Comment on lines +427 to +435
const globalMocks = await createGlobalMocks();

await globalMocks.testJobsProvider.addSession("fake");
globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234";
globalMocks.testJobsProvider.mSessionNodes[1].dirty = true;
globalMocks.testJobsProvider.mSessionNodes[1].filtered = true;
globalMocks.testIJob.retcode = "ACTIVE";

const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren();
Copy link
Member

@traeok traeok Dec 15, 2023

Choose a reason for hiding this comment

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

I noticed a pattern across the new tests in this file. For the future, we might benefit from a test function that condenses this pattern, calling it with the appropriate arguments:

function jobLabelWithArgs(retcode?: string, execMember?: string): string {
    const globalMocks = await createGlobalMocks();

    await globalMocks.testJobsProvider.addSession("fake");
    globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234";
    globalMocks.testJobsProvider.mSessionNodes[1].dirty = true;
    globalMocks.testJobsProvider.mSessionNodes[1].filtered = true;
    globalMocks.testIJob.retcode = retcode;
    globalMocks.testIJob["exec-member"] = execMember;

    const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren();
    return jobs[0].label;
}

// then one of the tests could just be:
expect(jobLabelWithArgs("ACTIVE").toEqual("TESTJOB(JOB1234) - ACTIVE");

Comment on lines +206 to +209
nodeTitle =
job["exec-member"] !== undefined && job["exec-member"] !== ""
? `${job.jobname}(${job.jobid}) - ${job["exec-member"] as string} - ${job.retcode}`
: `${job.jobname}(${job.jobid}) - ${job.retcode}`;
Copy link
Member

@traeok traeok Dec 15, 2023

Choose a reason for hiding this comment

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

For the future, we might benefit from an exported function that builds these labels - primarily so it can be used to build job labels in tests.

Copy link

sonarcloud bot commented Dec 19, 2023

Quality Gate Failed Quality Gate failed

Failed conditions

10.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@traeok traeok merged commit 4e48524 into zowe:main Dec 19, 2023
17 of 19 checks passed
@JillieBeanSim JillieBeanSim added this to the v2.14.0 milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

Add z/OS System Name (SMFID) to Zowe Explorer Jobs View
5 participants