Skip to content

Commit

Permalink
Merge pull request #144 from AtlassianPS/release/v2.0
Browse files Browse the repository at this point in the history
Release v2.0 major version
  • Loading branch information
lipkau authored Jun 25, 2017
2 parents 65db92b + 4587517 commit 364cc02
Show file tree
Hide file tree
Showing 122 changed files with 924 additions and 904 deletions.
14 changes: 7 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing to PSJira
# Contributing to JiraPS
-----------

We welcome and appreciate contributions from the community.
There are many ways to become involved with PSJira:
There are many ways to become involved with JiraPS:
* including filing issues,
* joining in design conversations,
* writing and improving documentation,
Expand Down Expand Up @@ -35,14 +35,14 @@ _not yet defined_

### Building and testing

#### Testing PSJira
#### Testing JiraPS

Please see PowerShell [Testing Guidelines - Running Tests Outside of CI][running-tests-outside-of-ci] on how to test you build locally.

### Finding or creating an issue

1. Follow the instructions in [Contributing to Issues][contribute-issues] to find or open an issue.
2. Mention in the issue that you are working on the issue and ask `@PSJira/moderators` for an assignment.
2. Mention in the issue that you are working on the issue and ask `@AtlassianPS/moderators` for an assignment.

### Forks and Pull Requests

Expand Down Expand Up @@ -142,9 +142,9 @@ See [Contributing to documentation related to PowerShell](#contributing-to-docum
* An Author is encouraged to choose Reviewer(s) and an Assignee for the PR.
If no Assignee is chosen, one of the Maintainers shall be assigned to it.
If no Reviewer is chosen, the Assignee shall choose Reviewer(s) as appropriate.
* If an Author is a [PSJira Team](https://github.com/orgs/PSJira/people) member,
* If an Author is a [AtlassianPS Team](https://github.com/orgs/AtlassianPS/people) member,
then the Author **is required** to choose Reviewer(s) and an Assignee for the PR.
* For a PR to be merged, it must be approved by at least one PSJira Team member or Collaborator,
* For a PR to be merged, it must be approved by at least one JiraPS Team member or Collaborator,
so additional Reviewer(s) may be added by the Assignee as appropriate.
The Assignee may also be re-assigned by Maintainers.
Expand Down Expand Up @@ -238,7 +238,7 @@ is also appropriate, as is using Markdown syntax.
and John Gruber's [Markdown syntax](https://daringfireball.net/projects/markdown/syntax).
* Don't commit code that you didn't write.
If you find code that you think is a good fit to add to PSJira,
If you find code that you think is a good fit to add to JiraPS,
file an issue and start a discussion before proceeding.
* Create and/or update tests when making code changes.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
<!-- Include as many relevant details about the environment you experienced the bug in -->
<!-- The following code snip is a recommendation. You can just paste the output here. -->
> ```posh
> Get-Module PSJira -ListAvailable | select version
> Get-Module JiraPS -ListAvailable | select version
> $PSVersionTable
> ```
4 changes: 2 additions & 2 deletions .vscode/tasks.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@echo off
if "%1" == "!" goto start
chcp 65001 > nul
PowerShell.exe -NoProfile -ExecutionPolicy Bypass "& 'D:\Documents\Projects\PSJira\Build\Invoke-Build.ps1' -File 'D:\Documents\Projects\PSJira\Build\PSJira.build.ps1' %1"
PowerShell.exe -NoProfile -ExecutionPolicy Bypass "& 'D:\Documents\Projects\JiraPS\Build\Invoke-Build.ps1' -File 'D:\Documents\Projects\JiraPS\Build\JiraPS.build.ps1' %1"
exit
:start
shift
start PowerShell.exe -NoExit -NoProfile -ExecutionPolicy Bypass "& 'D:\Documents\Projects\PSJira\Build\Invoke-Build.ps1' -File 'D:\Documents\Projects\PSJira\Build\PSJira.build.ps1' %1"
start PowerShell.exe -NoExit -NoProfile -ExecutionPolicy Bypass "& 'D:\Documents\Projects\JiraPS\Build\Invoke-Build.ps1' -File 'D:\Documents\Projects\JiraPS\Build\JiraPS.build.ps1' %1"
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.0.0 (Jun 24, 2017)

### Changes to the code module
- Move module to organization `AtlassianPS`
- Rename of the module to `JiraPS` **breaking change**
- Rename of module's custom objects to `JiraPS.*` **breaking change**

## 1.2.5 (Aug 08, 2016)

IMPROVEMENTS:
Expand Down Expand Up @@ -100,4 +107,4 @@ FEATURES:

IMPROVEMENTS:

BUG FIXES:
BUG FIXES:
Original file line number Diff line number Diff line change
@@ -1,132 +1,132 @@
function ConvertFrom-Json2
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true,
Position = 0)]
[Object[]] $InputObject,

[Parameter()]
[int] $MaxJsonLength = [int]::MaxValue
)

begin {
function PopulateJsonFrom-Dictionary
{
param
(
[System.Collections.Generic.IDictionary`2[String,Object]]$InputObject
)

process
{
$returnObject = New-Object PSObject

foreach($key in $InputObject.Keys)
{
$pairObjectValue = $InputObject[$key]

if ($pairObjectValue -is [System.Collections.Generic.IDictionary`2].MakeGenericType([String],[Object]))
{
$pairObjectValue = PopulateJsonFrom-Dictionary $pairObjectValue
}
elseif ($pairObjectValue -is [System.Collections.Generic.ICollection`1].MakeGenericType([Object]))
{
$pairObjectValue = PopulateJsonFrom-Collection $pairObjectValue
}

$returnObject | Add-Member Noteproperty $key $pairObjectValue
}

return $returnObject
}
}

function PopulateJsonFrom-Collection
{
param
(
[System.Collections.Generic.ICollection`1[Object]]$InputObject
)

process
{
$returnList = New-Object ([System.Collections.Generic.List`1].MakeGenericType([Object]))
foreach($jsonObject in $InputObject)
{
$jsonObjectValue = $jsonObject

if ($jsonObjectValue -is [System.Collections.Generic.IDictionary`2].MakeGenericType([String],[Object]))
{
$jsonObjectValue = PopulateJsonFrom-Dictionary $jsonObjectValue
}
elseif ($jsonObjectValue -is [System.Collections.Generic.ICollection`1].MakeGenericType([Object]))
{
$jsonObjectValue = PopulateJsonFrom-Collection $jsonObjectValue
}

$returnList.Add($jsonObjectValue) | Out-Null
}

return $returnList.ToArray()
}
}

$scriptAssembly = [System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")

$typeResolver = @"
public class JsonObjectTypeResolver : System.Web.Script.Serialization.JavaScriptTypeResolver
{
public override System.Type ResolveType(string id)
{
return typeof (System.Collections.Generic.Dictionary<string, object>);
}
public override string ResolveTypeId(System.Type type)
{
return string.Empty;
}
}
"@

try {
Add-Type -TypeDefinition $typeResolver -ReferencedAssemblies $scriptAssembly.FullName
}
catch {
# This is a relatively common error that's harmless unless changing the actual C#
# code, so it can be ignored. Unfortunately, it's just a plain old System.Exception,
# so we can't try to catch a specific error type.
if (-not $_.ToString() -like "*The type name 'JsonObjectTypeResolver' already exists*")
{
throw $_
}
}

$jsonserial = New-Object System.Web.Script.Serialization.JavaScriptSerializer(New-Object JsonObjectTypeResolver)
$jsonserial.MaxJsonLength = $MaxJsonLength
}

process
{
foreach ($i in $InputObject)
{
$s = $i.ToString()
if ($s) {
$jsonTree = $jsonserial.DeserializeObject($s)

if ($jsonTree -is [System.Collections.Generic.IDictionary`2].MakeGenericType([String],[Object]))
{
$jsonTree = PopulateJsonFrom-Dictionary $jsonTree
}
elseif ($jsonTree -is [System.Collections.Generic.ICollection`1].MakeGenericType([Object]))
{
$jsonTree = PopulateJsonFrom-Collection $jsonTree
}

Write-Output $jsonTree
}
}
}
}
function ConvertFrom-Json2
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true,
Position = 0)]
[Object[]] $InputObject,

[Parameter()]
[int] $MaxJsonLength = [int]::MaxValue
)

begin {
function PopulateJsonFrom-Dictionary
{
param
(
[System.Collections.Generic.IDictionary`2[String,Object]]$InputObject
)

process
{
$returnObject = New-Object PSObject

foreach($key in $InputObject.Keys)
{
$pairObjectValue = $InputObject[$key]

if ($pairObjectValue -is [System.Collections.Generic.IDictionary`2].MakeGenericType([String],[Object]))
{
$pairObjectValue = PopulateJsonFrom-Dictionary $pairObjectValue
}
elseif ($pairObjectValue -is [System.Collections.Generic.ICollection`1].MakeGenericType([Object]))
{
$pairObjectValue = PopulateJsonFrom-Collection $pairObjectValue
}

$returnObject | Add-Member Noteproperty $key $pairObjectValue
}

return $returnObject
}
}

function PopulateJsonFrom-Collection
{
param
(
[System.Collections.Generic.ICollection`1[Object]]$InputObject
)

process
{
$returnList = New-Object ([System.Collections.Generic.List`1].MakeGenericType([Object]))
foreach($jsonObject in $InputObject)
{
$jsonObjectValue = $jsonObject

if ($jsonObjectValue -is [System.Collections.Generic.IDictionary`2].MakeGenericType([String],[Object]))
{
$jsonObjectValue = PopulateJsonFrom-Dictionary $jsonObjectValue
}
elseif ($jsonObjectValue -is [System.Collections.Generic.ICollection`1].MakeGenericType([Object]))
{
$jsonObjectValue = PopulateJsonFrom-Collection $jsonObjectValue
}

$returnList.Add($jsonObjectValue) | Out-Null
}

return $returnList.ToArray()
}
}

$scriptAssembly = [System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")

$typeResolver = @"
public class JsonObjectTypeResolver : System.Web.Script.Serialization.JavaScriptTypeResolver
{
public override System.Type ResolveType(string id)
{
return typeof (System.Collections.Generic.Dictionary<string, object>);
}
public override string ResolveTypeId(System.Type type)
{
return string.Empty;
}
}
"@

try {
Add-Type -TypeDefinition $typeResolver -ReferencedAssemblies $scriptAssembly.FullName
}
catch {
# This is a relatively common error that's harmless unless changing the actual C#
# code, so it can be ignored. Unfortunately, it's just a plain old System.Exception,
# so we can't try to catch a specific error type.
if (-not $_.ToString() -like "*The type name 'JsonObjectTypeResolver' already exists*")
{
throw $_
}
}

$jsonserial = New-Object System.Web.Script.Serialization.JavaScriptSerializer(New-Object JsonObjectTypeResolver)
$jsonserial.MaxJsonLength = $MaxJsonLength
}

process
{
foreach ($i in $InputObject)
{
$s = $i.ToString()
if ($s) {
$jsonTree = $jsonserial.DeserializeObject($s)

if ($jsonTree -is [System.Collections.Generic.IDictionary`2].MakeGenericType([String],[Object]))
{
$jsonTree = PopulateJsonFrom-Dictionary $jsonTree
}
elseif ($jsonTree -is [System.Collections.Generic.ICollection`1].MakeGenericType([Object]))
{
$jsonTree = PopulateJsonFrom-Collection $jsonTree
}

Write-Output $jsonTree
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ConvertTo-JiraComment
$result = New-Object -TypeName PSObject -Property $props

# Write-Debug "[ConvertTo-JiraComment] Inserting type name information"
$result.PSObject.TypeNames.Insert(0, 'PSJira.Comment')
$result.PSObject.TypeNames.Insert(0, 'JiraPS.Comment')

# Write-Debug "[ConvertTo-JiraComment] Inserting custom toString() method"
$result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ConvertTo-JiraComponent
$result = New-Object -TypeName PSObject -Property $props

# Write-Debug "Inserting type name information"
$result.PSObject.TypeNames.Insert(0, 'PSJira.Component')
$result.PSObject.TypeNames.Insert(0, 'JiraPS.Component')

# Write-Debug "[ConvertTo-JiraComponent] Inserting custom toString() method"
$result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function ConvertTo-JiraCreateMetaField
}

$result = New-Object -TypeName PSObject -Property $props
$result.PSObject.TypeNames.Insert(0, 'PSJira.Error')
$result.PSObject.TypeNames.Insert(0, 'JiraPS.Error')

Write-Output $result
}
Expand Down Expand Up @@ -76,7 +76,7 @@ function ConvertTo-JiraCreateMetaField
$result = New-Object -TypeName PSObject -Property $props

# Write-Debug "[ConvertTo-JiraCreateMetaField] Inserting type name information"
$result.PSObject.TypeNames.Insert(0, 'PSJira.CreateMetaField')
$result.PSObject.TypeNames.Insert(0, 'JiraPS.CreateMetaField')

# Write-Debug "[ConvertTo-JiraCreateMetaField] Inserting custom toString() method"
$result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value {
Expand Down
Loading

0 comments on commit 364cc02

Please sign in to comment.