AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
322 stars 131 forks source link

Issue 45 #378

Closed timerplayer closed 2 years ago

timerplayer commented 4 years ago

A pull request that fixes an issue #45

Description

This pull request allow to use few sessions to Jira server in same time. For ex.:

Get-Issue -Key "AA-0000" -Session $sessionA
Get-Issue -Key "AA-0000" -Session $sessionB
Get-Issue -Key "AA-0000" -Session "SessionNameA"
Get-Issue -Key "AA-0000" -Session "SessionNameB"

Motivation and Context

There is project exists that I work for. The project requires to write a scripts that fetch information from one Jira server and create an issue on other Jira server. Current version of JiraPS does not allow such behaviors without call to Set-JiraConfigServer. Therefore, the pull request allow to skip a switching Jira server between cmdlets calls.

Types of changes

Checklist

timerplayer commented 4 years ago

Found that all the failed test is result of running Help.Tests.ps1 file. Of course, there are a things that I should changes in functions documentation. I added a Session parameter in all public functions and did not change help docs.

But there are failed test exists that do no belong to my changes. Therefore, I run same test on master branch and received near the same result.

What should I configure in order to pass all test for master branch?

timerplayer commented 4 years ago

I have found a point how to run test correctly. Therefore, my mistake was to run Pester tests without build the module. As soon as I released that fact I built the module and got correct results.

I will provide a new commit that will fix tests.

timerplayer commented 4 years ago

Please be aware that changing the behavior of public functions will be a breaking change (as you did by removing the -Credential parameter) and therefore require a new major release.

I supposed that it enough to add alias to -Session parameter. Session parameter accept following types:

  1. String - Name of a session
  2. JiraPS.Session - a session itself
  3. PSCredential - a credential that should be used for current operation.

However, if a new major release is needed, I want the common session handling for all AtlassianPS modules to be used - which I already started to implement here

May you share a link where you describe an idea of common configuration I may assist you with the change for JIraPS.

If you manage to add the functionality without changing current behavior, I will gladly release a new minor version with your changes

If alias is not enough to provide backward compatibility, I can return back -Credential parameter and use its value together with -Session parameter's value. Will it suits for minor release?

lipkau commented 4 years ago

May you share a link where you describe an idea of common configuration I may assist you with the change for JIraPS.

I did share the link here: However, if a new major release is needed, I want the common session handling for all AtlassianPS modules to be used - which I already started to implement here

lipkau commented 4 years ago

@timerplayer , any new on this?

timerplayer commented 4 years ago

Hello @lipkau,

Sorry, I had no time to provide a fixes, due to busy by other project. What should I do?

lipkau commented 4 years ago

@timerplayer There were some major changes by atlassian to the api in order to be compliant to GDPR. I have been investigating how to adapt this module to still work kind of the same for cloud servers and on-premise. I changes had a lot of impact on the searching and fetching of users. This is the current status (still WIP) https://github.com/lipkau/JiraPS/blob/feature/ProperUserHandling/JiraPS/Public/Get-JiraUser.ps1 https://github.com/lipkau/JiraPS/blob/feature/ProperUserHandling/JiraPS/Public/Find-JiraUser.ps1

As I see, these changes also include what this PR would have changed. If you agree, I would like to close this PR.