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

Merge in functionality from other PS & Github Modules #21

Closed
kilasuit opened this issue Aug 19, 2016 · 12 comments
Closed

Merge in functionality from other PS & Github Modules #21

kilasuit opened this issue Aug 19, 2016 · 12 comments

Comments

@kilasuit
Copy link

Ideally we only need 1 module for PowerShell & to work with Github and we already have 2 in the Gallery by @pcgeek86 @davidobrien1985 as well as a more featured module Posh-Github written by @Iristyle which could really do with being updated to allow use of Personal Access Token's which there is already support for in the other modules.

Now I'm looking at whether it makes sense trying to port a number of the functions in @Iristyle module as well as @davidobrien1985 module this weekend (if people are agreeable to this of course) into this module and have 1 fully functioned module

Now that PS its self is OS'd I think its time to start bringing together modules that have some similarities to the PowerShell DSC Resources that fall under a similar High Quality suggestive

I say this especially around the Posh-Github modile as there are some as there are some really good functions in that module like the New-GithubFork however I would really like this to be a module that combined all the functions together without lots of global variables dotted everywhere (yak) and has no reliance on stored credentials of any kind (again yak) whilst it passes PSScriptAnalyzer whilst having a structured & standardised build process.

Also would be a challenge to get this working on a .NET Core PS environment and would be a great showcase to the community too!

@kilasuit
Copy link
Author

kilasuit commented Aug 19, 2016

The task list (if accepted by all) for this would look like the below (& I'm willing to do the majority of this work)

  • - Export all functions (Public & Private) from all modules into single ps1 files per function (easy to do & I have this automated already - see PesterHelpers module)
  • - Do comparison on all the exports and best/most functional version of a function is kept to be improved with attributions given in Comment Based help to the functions not kept with a link to the function and repo sourced from
  • - Improve all the kept functions to apply to PSScriptAnalyzer rules as a minimum
  • - Improve all the kept functions allow Basic Auth, PersonalTokens & MFA for authentication
  • - Combine all back into 1 single module
  • - Build Pester tests for code quality assurance of the module
  • - Publish update to Gallery
  • - Test Functionality for on PSCore and try to build for there in the first instance

@KarolKaczmarek
Copy link
Contributor

@kilasuit I think that's a great idea, having all the functions available under single repo would make using them significantly easier. If you are willing to get this started, I'll try to help as much as I can.

I'm not sure we want to eventually combine everything in a single file. I'd suggest splitting it into different ones according to areas they refer to (pull requests, issues etc.) but we will get better clarity once we have a list of all functions available. One option would be to mimic structure from https://developer.github.com/v3/

@dotps1
Copy link

dotps1 commented Sep 26, 2016

I also have an entire module for the Gist functionality of GitHub, it is a separate module, not sure if there would be any interest in bundling these together. https://github.com/dotps1/PSGist

@KarolKaczmarek
Copy link
Contributor

Gist queries are part of the GitHub API, so I'd definitely support this @dotps1. Would you be willing to drive this? We could start discussion on structure of this repo and how many/what modules we would require. Seems it would make sense to have separate module for Gist operations.

@Tiberriver256
Copy link

This is very needed. Also, wanted to mention Doug Finke has a Package Provider for Gists. https://www.powershellgallery.com/packages/GistProvider/0.6

@dotps1
Copy link

dotps1 commented Sep 27, 2016

@KarolKaczmarek I will look more deeply, but we need to standardize our API call I think, and go from there. I currently, for my module have the user generate a Token with only permissions to Gist Objects, then serialize that to disk, then deserialize with every call. I also have all the responses from the API dump into Class objects. So think we need to decide how we want all that done, and then we can work on the merging. I'm open to suggestions. I know PSGallery doesn't like converting the token to a secure string with the -AsPlainText -Force switches (which is completely stupid), so we can also store the token in the windows credential manager (See my PSAppVeyor project, I use that method there).

@KarolKaczmarek
Copy link
Contributor

KarolKaczmarek commented Sep 29, 2016

@dotps1 Unfortunately PasswordVault isn't supported on Windows 7, so I don't think that's a viable option for us. We could start with SecureString and design it in a way to easily replace underlying storage/encryption mechanism if it would block us from getting into PSGallery.
Also, as @kilasuit mentioned we could add Basic Auth and MFA support, however I'm not sure whether it's something we would want to do in the first iteration - personal access tokens seem to be better suited for API calls, but I'd like to hear what you guys think about it.

Regarding standardizing API call, I fully agree. I actually like your Invoke-GistApi function, so we could have something similar. I could refactor existing functions to use it later as well. The only problem is I don't see it supporting pagination, so that's something what should be added. That's an easy thing to do though - we use Get-NextResultPage for verifying if there's more results available.

@wilsonmar
Copy link

wilsonmar commented Nov 4, 2016

Please let me know how I can help in this effort. Especially code to make calls using the new GraphQL.

I had written a Bash shell script to run on my Mac to automate the sequence of Git commands I cover in my class on Git and GitHub. My script creates a Git repo locally, then calls GitHub's REST API to create a new repo on GitHub. I made it idempotent by also deleting the repo before creating it again.

When PS was open sourced to Mac, I began porting it over to PS1 so that Windows users could run the script too. Then I got stuck on error messages issued by PS. BTW, my notes on making sense of REST APIs in PS I've recorded at https://wilsonmar.github.io/powershell-rest-api/

In my Bash shell script I used the simple approach of a .secrets file which the script reads in as environment variables. The same file I had PowerShell read in as a hash table.

BTW: Thanks to @rchaganti for pointing me to this repo.

@KarolKaczmarek
Copy link
Contributor

Hi @wilsonmar ,

This particular issue is about porting cmdlets from different repos here to have everything in one place. Unfortunately I currently do not have time to drive this effort, so this didn't really start yet, however if you experimented with the new GitHub GraphQL API and would like to add it's support here, you are more than welcome to do it!

Due to very nature of GraphQL vs REST based API I don't think it makes sense to try to blend them together, but I think having a module for GraphQL API would be useful. That would give users option to use whichever API fits their needs/they are most familiar with.

Let me know if you need help getting started with it, you can also message me on Twitter @KarolKaczmarek.

Regarding your problems with porting your bash scripts to ps1, could you be a bit more specific? What errors are you seeing?

Thanks!
Karol

@wilsonmar
Copy link

I would love to create a GraphQL module for GitHub.
I'm surprised there isn't one already.
How about we call it "PowerShellforGitHubGraphQL"

My sad experience with PowerShell module is at
https://wilsonmar.github.io/powershell-github/

My rough draft outline for combining the modules and adding GraphQL is:
https://wilsonmar.github.io/github-graphql-powershell/
Yes, these should be two different projects.
But some of this is new to me, so I'm exploring.

Can we talk about this briefly?

// Wilson Mar 310.320-7878
Skype: wilsonmar4

On Fri, Nov 4, 2016 at 1:56 PM, Karol Kaczmarek [email protected]
wrote:

Hi @wilsonmar https://github.com/wilsonmar ,

This particular issue is about porting cmdlets from different repos here
to have everything in one place. Unfortunately I currently do not have time
to drive this effort, so this didn't really start yet, however if you
experimented with the new GitHub GraphQL API and would like to add it's
support here, you are more than welcome to do it!

Due to very nature of GraphQL vs REST based API I don't think it makes
sense to try to blend them together, but I think having a module for
GraphQL API would be useful. That would give users option to use whichever
API fits their needs/they are most familiar with.

Let me know if you need help getting started with it, you can also message
me on Twitter @KarolKaczmarek https://github.com/KarolKaczmarek.

Regarding your problems with porting your bash scripts to ps1, could you
be a bit more specific? What errors are you seeing?

Thanks!
Karol


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AASUDllF6tTtMNgmY6NG4oAnIRgRUkWtks5q644JgaJpZM4JowRT
.

@KarolKaczmarek
Copy link
Contributor

@wilsonmar I created an issue regarding supporting GitHub GraphQL API: #23 , let's continue the discussion about it there.

I also sent you an email with answers to the two links above.

Thanks,
Karol

@HowardWolosky
Copy link
Member

Closing this out as much of this doesn't quite seem applicable anymore given the current updated state of the repo.

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

No branches or pull requests

6 participants