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

Bugfix: Limited items retrurned from the Get-YTProject function #2

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

KhoiKy
Copy link
Contributor

@KhoiKy KhoiKy commented Feb 26, 2025

  • Fixed the default limit of projects returned from the Get-YTProject function.
  • Fixed Ubuntu job failure.

CHANGELOG.md Outdated

## 1.0.0

* Created the following basic functions that are used to interact with the API:
Copy link
Member

Choose a reason for hiding this comment

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

Simplify this sentence to "Created these functions:".

[String[]] $AdditionalField
[String[]] $AdditionalField,

# Maximum number of results to return. Api end point defaults to top 42. Defaulted to 300 here.
Copy link
Member

Choose a reason for hiding this comment

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

We should leave this blank so that we return the default number of results that the API returns. and only include the top query string parameter if this parameter is given. Document in the function's description that the API currently returns 42 results at a time.

@@ -18,7 +18,7 @@
RootModule = 'YouTrackAutomation.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'
Copy link
Member

Choose a reason for hiding this comment

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

This is adding functionality, not fixing a bug, so increment to 1.1.0.

@KhoiKy KhoiKy force-pushed the bugfix/limited-items-returned branch from 448ef0f to d2bd829 Compare February 26, 2025 20:16

if ($Top)
{
$endpoint = $endpoint + '&$top=' + "$Top"
Copy link
Member

Choose a reason for hiding this comment

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

Lint: $endpoint = "${endpoint}&top=${Top}".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It needs to be exactly '&$top=' or else it doesn't work correctly. Having that in double quotes will attempt to treat '$top' as a variable.

Copy link
Member

@splatteredbits splatteredbits Feb 26, 2025

Choose a reason for hiding this comment

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

I didn't see the $ in the query string. Yu can escape it with backtick:

$endpoint = "${endpoint}&`$top=${Top}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh the backtick, thank you sir!

@KhoiKy KhoiKy force-pushed the bugfix/limited-items-returned branch from d2bd829 to a40e222 Compare February 26, 2025 21:12
@KhoiKy KhoiKy merged commit fae6759 into main Feb 26, 2025
1 check passed
@KhoiKy KhoiKy deleted the bugfix/limited-items-returned branch February 26, 2025 21:44
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.

2 participants