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

@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 88.11%. Comparing base (d5299bc) to head (ebd612a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #369      +/-   ##
==========================================
+ Coverage   88.05%   88.11%   +0.06%     
==========================================
  Files          65       65              
  Lines        3340     3357      +17     
==========================================
+ Hits         2941     2958      +17     
  Misses        399      399              
Flag Coverage Δ
unittests 88.11% <100.00%> (+0.06%) ⬆️

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?

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Support responseTimeout profile property for z/OSMF operations

4 participants