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

Add CMCI query parameters to SDK getResource #171

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

AndrewTwydell
Copy link
Contributor

What It Does
Allows a user to specify query parameters to be added to the CMCI query URI (SUMMONLY, NODISCARD, OVERRIDEWARNINGCOUNT) by adding an optional addition to the supplied params.

This will allow the VSCE to retrieve a cache token from CMCI which will enable pagination on large result sets.

Review Checklist
I certify that I have:

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! 😋

Great addition to the SDK 🙏

/**
* Query parameters to be used in the HTTP request
*/
queryParams?: IResourceQueryParams;
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea of a query parameters object.
Maybe by V4 we could move criteria and parameter to that object 😋

if (options != null) {
if (options.criteria != null && options.criteria.length > 0) {
const addParentheses = options.criteria.charAt(0) !== '(';
if (options && options.criteria) {
Copy link
Member

Choose a reason for hiding this comment

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

not required to change this, but if you want to save some typing 😋

Suggested change
if (options && options.criteria) {
if (options?.criteria) {

This may apply to other if conditions 🙏

delimiter = "&";
}

if (options && options.queryParams && options.queryParams.nodiscard) {
Copy link
Member

Choose a reason for hiding this comment

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

there could be some savings here too 😋

Suggested change
if (options && options.queryParams && options.queryParams.nodiscard) {
if (options?.queryParams?.nodiscard) {

@AndrewTwydell AndrewTwydell force-pushed the get-resource-query-params branch from f17635b to 96512f1 Compare December 17, 2024 19:06

if (options && options.queryParams && options.queryParams.overrideWarningCount) {
cmciResource += `${delimiter}${CicsCmciConstants.OVERRIDE_WARNING_COUNT}`;
delimiter = "&";

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

The value assigned to delimiter here is unused.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.62%. Comparing base (087757b) to head (96512f1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   93.49%   93.62%   +0.12%     
==========================================
  Files          74       74              
  Lines         738      753      +15     
  Branches       37       40       +3     
==========================================
+ Hits          690      705      +15     
  Misses         48       48              

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

@zFernand0 zFernand0 merged commit 1ea123b into main Dec 17, 2024
10 checks passed
@zFernand0 zFernand0 deleted the get-resource-query-params branch December 17, 2024 20:39
@zFernand0 zFernand0 added release-minor Indicates a minor feature has been added release-current Indicates that there is no new functionality being delivered and removed release-minor Indicates a minor feature has been added labels Dec 17, 2024
@zFernand0
Copy link
Member

Labeled as release-current in case we want to combine multiple enhancements into a single release 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-current Indicates that there is no new functionality being delivered
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

4 participants