Skip to content

Conversation

@aadityasinha-dotcom
Copy link
Contributor

What It Does
Fixes #334

How to Test

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Jun 19, 2025
@zowe-robot zowe-robot moved this from New Issues to Review/QA in Zowe CLI Squad Jun 19, 2025
@adam-wolfe adam-wolfe requested review from pem70 and zFernand0 June 23, 2025 15:08
@t1m0thyj t1m0thyj requested review from Copilot and t1m0thyj July 7, 2025 15:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for the responseTimeout profile property by surfacing it on the session object and sending it as an HTTP header for z/OSMF calls.

  • Introduces response_timeout field on ISession
  • Assigns response_timeout from profile props for both auth flows
  • Includes X-IBM-Response-Timeout header in SDK API requests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/core/zowe/core_for_zowe_sdk/session.py Adds response_timeout attribute and assigns from responseTimeout prop
src/core/zowe/core_for_zowe_sdk/sdk_api.py Adds X-IBM-Response-Timeout header using response_timeout
Comments suppressed due to low confidence (3)

src/core/zowe/core_for_zowe_sdk/sdk_api.py:52

  • [nitpick] New header behavior should be covered by automated tests to verify that X-IBM-Response-Timeout is only sent when the profile property is set and that its value is correctly formatted.
            "X-IBM-Response-Timeout": self.session.response_timeout,

src/core/zowe/core_for_zowe_sdk/session.py:27

  • Using Optional[str] may allow non-numeric values; consider using Optional[int] (or validating/casting the string) so that the timeout is always a valid number.
    response_timeout: Optional[str] = None

src/core/zowe/core_for_zowe_sdk/session.py:71

  • Directly assigning the raw prop can lead to unexpected types; add validation or cast to the expected type (e.g., int(props.get(...))).
            self.session.response_timeout = props.get("responseTimeout")

@codecov
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.01%. Comparing base (7d093e6) to head (021c0ea).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #369      +/-   ##
==========================================
+ Coverage   81.86%   82.01%   +0.14%     
==========================================
  Files          48       49       +1     
  Lines        2768     2791      +23     
==========================================
+ Hits         2266     2289      +23     
  Misses        502      502              
Flag Coverage Δ
unittests 82.01% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

self.session.user = props.get("user")
self.session.password = props.get("password")
self.session.reject_unauthorized = bool(props.get("rejectUnauthorized"))
self.session.response_timeout = props.get("responseTimeout")
Copy link
Member

Choose a reason for hiding this comment

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

@zFernand0 @traeok Is it ok to store response_timeout on the Session class since it's specific to z/OSMF? Wondering if we should keep the properties on the Session class more profile/service-agnostic.

Copy link
Member

Choose a reason for hiding this comment

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

Keeping the core package zosmf agnostic makes sense.
Maybe we can move this response timeout somewhere in the zosmf package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review, can you review the changes I tried moving it to the zosmf package ☺️

Copy link
Contributor

@pem70 pem70 left a comment

Choose a reason for hiding this comment

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

Changes LGTM.

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.

Changes make sense.
I agree with Timothy's comment that we should keep the session free from z/somf specific properties

self.session.user = props.get("user")
self.session.password = props.get("password")
self.session.reject_unauthorized = bool(props.get("rejectUnauthorized"))
self.session.response_timeout = props.get("responseTimeout")
Copy link
Member

Choose a reason for hiding this comment

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

Keeping the core package zosmf agnostic makes sense.
Maybe we can move this response timeout somewhere in the zosmf package?

aadityasinha-dotcom and others added 2 commits July 21, 2025 14:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Aaditya Sinha <75474786+aadityasinha-dotcom@users.noreply.github.com>
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
@zFernand0 zFernand0 moved this from Review/QA to Release Backlog in Zowe CLI Squad Aug 11, 2025
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! 😋

I do have one small request...

Doing this only in the zosmf package will impact only the functions dependent on the zosmf...

From the IBM documentation...
https://www.ibm.com/docs/en/zos/2.5.0?topic=services-zos-data-set-file-rest-interface#izuhpinfo_api_restfiles__title__5

I believe we would want to add this same funcitonality in the files.py.
And perhaps also add some validation around it (mostly to warn people that the value may be modified by z/OSMF
5 >= responseTimeout >= 600 😋

Image

If possible, please keep in mind that more headers may need to be introduced in the future 🙏

@github-project-automation github-project-automation bot moved this from Release Backlog to Review/QA in Zowe CLI Squad Aug 15, 2025
@JTonda JTonda moved this from Review/QA to In Progress in Zowe CLI Squad Oct 27, 2025
@JTonda JTonda removed the request for review from pem70 October 27, 2025 15:20
aadityasinha-dotcom and others added 4 commits October 30, 2025 17:11
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
@traeok
Copy link
Member

traeok commented Nov 19, 2025

Hi @aadityasinha-dotcom , just tagging for awareness: Seems that the build is failing with a lint error:

src/zos_files/zowe/zos_files_for_zowe_sdk/files.py:70:0: C0301: Line too long

Can you please fix this once you get a chance? Thanks

aadityasinha-dotcom and others added 2 commits November 19, 2025 23:43
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
@github-project-automation github-project-automation bot moved this from In Progress to Review/QA in Zowe CLI Squad Dec 4, 2025
@JTonda JTonda requested a review from t1m0thyj December 15, 2025 16:14
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

Code changes LGTM! Please resolve failing unit tests (I've done this 😁) and add a changelog entry 😋

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Comment on lines 40 to 41
async_threshold = profile.get("asyncThreshold") or profile.get("X-IBM-Async-Threshold")
if not async_threshold:
Copy link
Member

Choose a reason for hiding this comment

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

Although it's true that the X-IBM-Async-Threshold and X-IBM-Response-Timeout headers are mutually exclusive, Zowe team config files don't allow the asyncThreshold parameter to be defined in a z/OSMF profile, so I think this check can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true, I also think asyncThreshold check can be removed.

Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
Comment on lines 54 to 56
else:
if hasattr(self, "logger"):
self.logger.info("X-IBM-Async-Threshold present; X-IBM-Response-Timeout will be ignored by z/OSMF")
Copy link
Member

@t1m0thyj t1m0thyj Dec 26, 2025

Choose a reason for hiding this comment

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

Please remove the else block - we don't need to log a warning when responseTimeout is missing on the profile. Everything else LGTM 😋

Signed-off-by: aadityasinha-dotcom <aadityasinha009@gmail.com>
Copy link
Member

@t1m0thyj t1m0thyj 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 @aadityasinha-dotcom!

@t1m0thyj t1m0thyj requested a review from traeok December 26, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review/QA

Development

Successfully merging this pull request may close these issues.

Support responseTimeout profile property for z/OSMF operations

5 participants