-
Notifications
You must be signed in to change notification settings - Fork 187
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
GitHubRepositories: Add New-GitHubRepositoryFromTemplate Function #221
GitHubRepositories: Add New-GitHubRepositoryFromTemplate Function #221
Conversation
Can we trigger the CI for this PR? |
I'll kick off a CI build a little bit later today after the current one ends. |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
Can we trigger the CI for this PR? |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
A weird CI failure on MacOS for the static code analysis step: 2 | $results = Invoke-ScriptAnalyzer -Path ./ –Recurse
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Collection was modified; enumeration operation may not execute. May be related to this: Collection was modified; enumeration operation may not execute when running Invoke-ScriptAnalyzer can you run the CI again and see if it is consistent? |
Yeah, I've been seeing that pop up from time to time. I've just been waiting out a fix for that bug. |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
@HowardWolosky Can you please open a new issue in the PSScriptAnalyzer repo with steps to repro: https://github.com/PowerShell/PowerShell/issues/new?assignees=&labels=Issue-Question&template=Bug_Report.md&title=My+bug+report |
…rove ScriptAnalyzer installation to not skip publisher and check and not allow clobber (#236) #221 reported that this repo causes PSScriptAnalyzer to sporadically throw an error. In order to report the full error needed for analysis, report the full stack trace. In order to make this easier, I've updated `Invoke-ScriptAnalyzer` to run within a `try/catch using -ErrorAction Stop`, and report any error found with `$_.Exception.StackTrace` before re-throwing the error.
Can we trigger the CI for this PR? |
I can once the conflicts stemming from #242 have been resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this functionality!
Some feedback is included for you to review.
Can we trigger the CI for this PR? |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super minor additional changes, and then we can get this merged. Thanks for the new feature!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed one bug before I was about to run CI. I'll kick off CI and then merge this in once that gets fixed.
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
@HowardWolosky, ready for CI. |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
@HowardWolosky , can we trigger the CI for this PR? |
Sure thing. Will kick it off once the current one completes, and then get this merged in. |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
@X-Guardian - looks like this work doesn't fully support pipeline input, and the tests aren't sufficiently figuring that out either. You're not capturing PowerShellForGitHub/GitHubRepositories.ps1 Lines 363 to 366 in d96541e
PowerShellForGitHub/Tests/GitHubRepositories.tests.ps1 Lines 332 to 333 in d96541e
Want to take a crack at a fix? |
Added in microsoft#221, `New-GitHubRepositoryFromTemplate was not capturing the passed-in value for the RepositoryName if provided via a Uri parameter. There was a pipeline test in place, however it missed this fact because it was only testing the pipeline input scenario using `-WhatIf`, and the error was only found when calling the actual REST API and GitHub noticed that the `RepositoryName` was missing from the URI.
I put out a fix with #259 |
…#259) Added in #221, `New-GitHubRepositoryFromTemplate was not capturing the passed-in value for the RepositoryName if provided via a Uri parameter. There was a pipeline test in place, however it missed this fact because it was only testing the pipeline input scenario using `-WhatIf`, and the error was only found when calling the actual REST API and GitHub noticed that the `RepositoryName` was missing from the URI.
Description
This PR adds a new function
New-GitHubRepositoryFromTemplate
to theGitHubRepositories
module. This function creates a new GitHub repository from a specified template repository.Parameters
Issues Fixed
References
Create a repository using a template
Checklist
is reporting back clean.