Skip to content

Fix malformed z/OS log query strings when optional parameters are combined - #460

Merged
frankgiordano merged 1 commit into
zowe:mainfrom
Ashish-Kumar-Dash:fix/zoslog-query-delimiters
Apr 25, 2026
Merged

frankgiordano merged 1 commit into
zowe:mainfrom
Ashish-Kumar-Dash:fix/zoslog-query-delimiters

Conversation

@Ashish-Kumar-Dash

Copy link
Copy Markdown
Contributor

This PR fixes query string construction in ZosLog.issueCommand().

Previously, the time parameter was always added first, but optional parameters like timeRange, direction, and hardcopy could still be appended with ? depending on queryCount. That could produce malformed URLs such as:

.../restconsoles/v1/log?time=2026-04-24T10:00Z?timeRange=10m

This change makes query delimiter handling deterministic:

  • time is always added first with ?
  • all additional optional parameters are appended with &

What’s included:

  • fix in ZosLog.java
  • regression test covering combined optional query parameters in ZosLogTest.java

Validation:

  • ran ./mvnw.cmd -q test
  • full test suite passed
    Hey @frankgiordano , I found this potential bug while exploring the codebase & thought it's urgent enough so raised a PR. This matters because malformed query strings can break valid z/OS log requests whenever users combine optional filters. Do lemme know your thoughts! If you want me to raise an issue first for this or from next time onwards , do tell

Signed-off-by: Ashish Kumar Dash <ashishdash2410@gmail.com>
@Ashish-Kumar-Dash
Ashish-Kumar-Dash force-pushed the fix/zoslog-query-delimiters branch from fe71809 to 8afd8c0 Compare April 24, 2026 06:31
@frankgiordano

Copy link
Copy Markdown
Collaborator

Thank you for this PR. I will review.

@frankgiordano
frankgiordano self-requested a review April 24, 2026 16:17
@frankgiordano frankgiordano added the bug Something isn't working label Apr 24, 2026
@frankgiordano
frankgiordano merged commit a9711d2 into zowe:main Apr 25, 2026
2 checks passed
@frankgiordano

Copy link
Copy Markdown
Collaborator

I merged the request. All looks good. Thanks for identifying this issue.

@frankgiordano

Copy link
Copy Markdown
Collaborator

I will release a new version with this version 6.1.3.

@frankgiordano

Copy link
Copy Markdown
Collaborator

@Ashish-Kumar-Dash FYI — I opened PR #462, which continues the work from this PR and fixes additional inconsistencies in this API. It also led to a different approach for handling URL construction.

Given the scope of these changes, I think it makes more sense to include them in version 6.2.0 rather than 6.1.3. This feels like more than a minor patch-level release.

@Ashish-Kumar-Dash

Copy link
Copy Markdown
Contributor Author

Yes @frankgiordano , I agree. I see your follow-up in #462 addresses the broader issue more cleanly, especially by avoiding client generated time values and simplifying URL construction. Also, I saw some more interesting things while I was going through the codebase, but I'd love if I can run it by you first. Is there a space where you're active, or would you prefer I open straight issues/PR's for it? I came across this project while exploring the Workflow API's mentorship for this repo on LFX, and I'm having a blast going through the codebase as its very structured and not messy, so kudos for that!

@frankgiordano

Copy link
Copy Markdown
Collaborator

@Ashish-Kumar-Dash reach out to me via email giofr01@yahoo.com
BTW see #463 that finishes it all. lol

@Ashish-Kumar-Dash
Ashish-Kumar-Dash deleted the fix/zoslog-query-delimiters branch April 26, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants