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

Is there platform independent PS module build to top of this one? #340

Closed
olljanat opened this issue Sep 24, 2021 · 4 comments
Closed

Is there platform independent PS module build to top of this one? #340

olljanat opened this issue Sep 24, 2021 · 4 comments
Labels
support User support questions triage needed An issue that needs to be reviewed by a member of the team.

Comments

@olljanat
Copy link

We are planning migration from classic pipelines to YAML pipelines and we know that on sometime in future we will most probably migrate to GitHub Enterprise too so I ended up thinking that it would make sense to create PS module where commands are same no matter what is underlying platform (PSGit on examples below).

I mean on way that would just login to Azure DevOps with command like:

$splat = @{
    Platform            = "AzureDevOps"
    GitRepo             = 'myRepo'
    Collection          = 'myCollection'
    Project             = 'myProject'
    Instance            = 'https://dev.azure.com/'
    PersonalAccessToken = 'myPersonalAccessToken'
}
New-PSGitSession @splat

and PSGit module would then use AzurePipelinesPS.

Or alternatively I would be able to login to GitHub Enterprise with command like:

$splat = @{
    Platform            = "GitHub"
    GitRepo             = 'myRepo'
    PersonalAccessToken = 'myPersonalAccessToken'
    Instance            = "github.contoso.com"
}
New-PSGitSession @splat

and PSGit module would then use PowerShellForGitHub.

But on both cases user would be able to use commands like:

New-PSGitPullRequest -SourceBranch "feat/new-ui" -TargetBranch "main" -Title "New UI"

and that it should be open source tool where community can add support for more platforms too.

Also asked same question from Dejulia489/AzurePipelinesPS#22

@olljanat olljanat added support User support questions triage needed An issue that needs to be reviewed by a member of the team. labels Sep 24, 2021
@olljanat
Copy link
Author

FYI. I started to piloting that concept on https://github.com/olljanat/PSGit

@HowardWolosky
Copy link
Member

@olljanat - Apologies for the late response -- I completely missed this Issue when you opened it...only saw the notification when it got closed.

I'm confused by the question though, because this module is platform independent. Any script that you write with it will work consistently across Mac, Linux and Windows (in both Windows PowerShell and PowerShell 7+).

@olljanat
Copy link
Author

@HowardWolosky Ah, "platform" is probably bad word selection. I was meaning more like generic PS module which works with both Azure DevOps and GitHub (and maybe others too) with same cmdlets.

Examples my on my pilot project https://github.com/olljanat/PSGit#usage probably clarify what I mean. Main idea is that I can build automation on top of Azure DevOps which does not need to be refactored if/when we decide switch to GitHub Enterprise as most probably some point in future we need to do that switch.

@HowardWolosky
Copy link
Member

Now I understand what you're getting at. I think that's an interesting idea, but definitely out-of-scope for this project. I wish you luck with your efforts though -- be sure to come back here and report how things are going if you make further progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User support questions triage needed An issue that needs to be reviewed by a member of the team.
Projects
None yet
Development

No branches or pull requests

2 participants