Skip to content

Invoke-GHRestMethod - Find way to avoid duplicating codepaths for Status vs NoStatus #61

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

Closed
HowardWolosky opened this issue Dec 5, 2018 · 2 comments
Labels
enhancement An issue or pull request introducing new functionality to the project. help wanted Anyone in the community is welcome to do this work technical debt Work that was postponed by a previous change. up for grabs Anyone in the community is welcome to do this work

Comments

@HowardWolosky
Copy link
Contributor

This was mentioned by @danbelcher-MSFT during the PR for #60. Right now, we have a bit of duplicated code for how we execute the request synchronously (with -NoStatus) vs asynchronously with command-prompt status updates.

We should look to see if we can define the command-block of common code once, and then re-use it in both scenarios.

@HowardWolosky HowardWolosky added enhancement An issue or pull request introducing new functionality to the project. technical debt Work that was postponed by a previous change. up for grabs Anyone in the community is welcome to do this work help wanted Anyone in the community is welcome to do this work labels Dec 5, 2018
@HowardWolosky
Copy link
Contributor Author

One potential way to solve this is to always use a job to execute the request, and simply use $NoStatus to determine if wait for the result with Wait-Job or Wait-JobWithAnimation.

@HowardWolosky
Copy link
Contributor Author

#253 changed how we handle status, and so this is no longer applicable. There is no longer any duplicated code since we don't have bifurcating paths based on status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue or pull request introducing new functionality to the project. help wanted Anyone in the community is welcome to do this work technical debt Work that was postponed by a previous change. up for grabs Anyone in the community is welcome to do this work
Projects
None yet
Development

No branches or pull requests

1 participant