Skip to content

feat: Add SMFID to Jobs Tree View#2629

Merged
traeok merged 8 commits into
zowe:mainfrom
SanthoshiBoyina:zowe_explorer_feat
Dec 19, 2023
Merged

feat: Add SMFID to Jobs Tree View#2629
traeok merged 8 commits into
zowe:mainfrom
SanthoshiBoyina:zowe_explorer_feat

Conversation

@SanthoshiBoyina

Copy link
Copy Markdown
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 <Santhoshi.Boyina1@ibm.com>
@codecov

codecov Bot commented Dec 15, 2023

Copy link
Copy Markdown

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 <Santhoshi.Boyina1@ibm.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
Signed-off-by: SanthoshiBoyina <83487694+SanthoshiBoyina@users.noreply.github.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
@JillieBeanSim JillieBeanSim linked an issue Dec 15, 2023 that may be closed by this pull request

@JillieBeanSim JillieBeanSim left a comment

Copy link
Copy Markdown
Contributor

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 <Santhoshi.Boyina1@ibm.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
@JillieBeanSim JillieBeanSim self-requested a review December 15, 2023 19:38

@JillieBeanSim JillieBeanSim left a comment

Copy link
Copy Markdown
Contributor

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!

@traeok traeok left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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();

@traeok traeok Dec 15, 2023

Copy link
Copy Markdown
Member

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}`;

@traeok traeok Dec 15, 2023

Copy link
Copy Markdown
Member

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.

@sonarqubecloud

Copy link
Copy Markdown

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
@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

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants