Skip to content

Commit

Permalink
Release v2.8
Browse files Browse the repository at this point in the history
### IMPROVEMENTS

- Added support for paginated response from API server by means of `-Paging` (#291, [@lipkau[]])
- Added full set of functions to manage Filter Permissions (#289, [@lipkau[]])
- Added `-Id` parameter to `Remove-JiraFilter` (#288, [@lipkau[]])
- Changed logic of `Get-JiraUser` to return multiple results for a search (#272, [@lipkau[]])
- Added posts for homepage to the module's repository (#268, [@lipkau[]])
- Improved handling of _Credentials_ (#271, [@lipkau[]])
- Added missing interactions with _Filters_ (#266, [@lipkau[]])
- Added `Remove-JiraIssue` (#265, [@hmmwhatsthisdo[]])
- Improved Build script (to deploy changes to the homepage) (#259, [@lipkau[]])

### BUG FIXES

- Reverted `Add-JiraIssueAttachament` as JiraPS v2.7 broke it (#287, [@lipkau[]])
- Fixed resolving of Remote Link (#286, [@lipkau[]])
- Improved error handling for ErrorDetails and non-JSON/HTML responses (#277, [@hmmwhatsthisdo[]])
- Fully support Powershell v3 (#273, [@lipkau[]])
- Fixed parameter used in documentation but not in code (#263, [@lipkau[]])
  • Loading branch information
lipkau authored Jun 28, 2018
2 parents 3909c3d + dd689c7 commit 6414364
Show file tree
Hide file tree
Showing 119 changed files with 7,253 additions and 1,595 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve

---

## Description
<!-- A clear and concise description of what the bug is. -->

## Steps To Reproduce
<!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->

## Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

## Your Environment
<!-- 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. -->
> ```powershell
> Get-Module JiraPS -ListAvailable | select version
> $PSVersionTable
> ```
## Possible Solution
<!-- Not obligatory, but suggest a fix/reason for the bug -->
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Change Log

## 2.8 - 2018-06-28

More detailed description about the changes can be found on [Our Website](https://atlassianps.org/article/announcement/JiraPS-v2.8.html).

### IMPROVEMENTS

- Added support for paginated response from API server by means of `-Paging` (#291, [@lipkau[]])
- Added full set of functions to manage Filter Permissions (#289, [@lipkau[]])
- Added `-Id` parameter to `Remove-JiraFilter` (#288, [@lipkau[]])
- Changed logic of `Get-JiraUser` to return multiple results for a search (#272, [@lipkau[]])
- Added posts for homepage to the module's repository (#268, [@lipkau[]])
- Improved handling of _Credentials_ (#271, [@lipkau[]])
- Added missing interactions with _Filters_ (#266, [@lipkau[]])
- Added `Remove-JiraIssue` (#265, [@hmmwhatsthisdo[]])
- Improved Build script (to deploy changes to the homepage) (#259, [@lipkau[]])

### BUG FIXES

- Reverted `Add-JiraIssueAttachament` as JiraPS v2.7 broke it (#287, [@lipkau[]])
- Fixed resolving of Remote Link (#286, [@lipkau[]])
- Improved error handling for ErrorDetails and non-JSON/HTML responses (#277, [@hmmwhatsthisdo[]])
- Fully support Powershell v3 (#273, [@lipkau[]])
- Fixed parameter used in documentation but not in code (#263, [@lipkau[]])

## 2.7 - 2018-05-13

More detailed description about the changes can be found on [Our Website](https://atlassianps.org/article/announcement/JiraPS-v2.7.html).
Expand Down Expand Up @@ -258,6 +282,7 @@ which is in turn inspired by the [Vagrant](https://github.com/mitchellh/vagrant/
[@colhal]: https://github.com/colhal
[@Dejulia489]: https://github.com/Dejulia489
[@ebekker]: https://github.com/ebekker
[@hmmwhatsthisdo]: https://github.com/hmmwhatsthisdo
[@jkknorr]: https://github.com/jkknorr
[@kittholland]: https://github.com/kittholland
[@LiamLeane]: https://github.com/LiamLeane
Expand Down
24 changes: 13 additions & 11 deletions JiraPS.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ task InstallDependencies {
# Synopsis: Ensure the build environment is all ready to go
task Init {
Set-BuildEnvironment -BuildOutput '$ProjectPath/Release' -ErrorAction SilentlyContinue
# BuildHelpers does not write the project name in the correct caps
if ($env:APPVEYOR_PROJECT_NAME) {
$env:BHProjectName = $env:APPVEYOR_PROJECT_NAME
}

Add-ToModulePath -Path $env:BHBuildOutput
}, GetNextVersion
Expand Down Expand Up @@ -173,6 +177,7 @@ task UpdateManifest GetNextVersion, {

# Synopsis: Create a ZIP file with this build
task Package GenerateRelease, {
Remove-Item "$env:BHBuildOutput\$env:BHProjectName.zip" -ErrorAction SilentlyContinue
$null = Compress-Archive -Path "$env:BHBuildOutput\$env:BHProjectName" -DestinationPath "$env:BHBuildOutput\$env:BHProjectName.zip"
}
#endregion BuildRelease
Expand Down Expand Up @@ -201,9 +206,7 @@ task Test Init, {
OutputFormat = "NUnitXml"
CodeCoverage = $codeCoverageFiles
}
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$parameter["Show"] = "Fails"
}
$parameter["Show"] = "Fails"
$testResults = Invoke-Pester @parameter

If ('AppVeyor' -eq $env:BHBuildSystem) {
Expand Down Expand Up @@ -257,37 +260,36 @@ task TagReplository GetNextVersion, {
task UpdateHomepage {
try {
Write-Build Gray "git close .../AtlassianPS.github.io --recursive"
cmd /c "git clone https://github.com/AtlassianPS/AtlassianPS.github.io --recursive 2>&1"
$null = cmd /c "git clone https://github.com/AtlassianPS/AtlassianPS.github.io --recursive 2>&1"

Push-Location "AtlassianPS.github.io/"

Write-Build Gray "git submodule foreach git pull origin master"
cmd /c "git submodule foreach git pull origin master 2>&1"
$null = cmd /c "git submodule foreach git pull origin master 2>&1"

Write-Build Gray "git status -s"
$status = cmd /c "git status -s 2>&1"

Write-Build Gray $status
if ($status -contains " M modules/$env:BHProjectName") {
Write-Build Gray "git add modules/$env:BHProjectName"
cmd /c "git add modules/$env:BHProjectName 2>&1"
$null = cmd /c "git add modules/$env:BHProjectName 2>&1"

Write-Build Gray "git commit -m `"Update module $PROJECT_NAME`""
cmd /c "git commit -m `"Update module $PROJECT_NAME`" 2>&1"
Write-Build Gray "git commit -m `"Update module $env:BHProjectName`""
cmd /c "git commit -m `"Update module $env:BHProjectName`" 2>&1"

Write-Build Gray "git push"
cmd /c "git push 2>&1"
}

Pop-Location
}
catch {}
catch { Write-Warning "Failed to deploy to homepage"}
}
#endregion Publish

#region Cleaning tasks
# Synopsis: Clean the working dir
task Clean RemoveGeneratedFiles, RemoveTestResults, RemoveConfig
task Clean Init, RemoveGeneratedFiles, RemoveTestResults, RemoveConfig

# Synopsis: Remove generated and temp files.
task RemoveGeneratedFiles {
Expand Down
2 changes: 1 addition & 1 deletion JiraPS/JiraPS.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'JiraPS.psm1'

# Version number of this module.
ModuleVersion = '2.7'
ModuleVersion = '2.8'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
42 changes: 34 additions & 8 deletions JiraPS/JiraPS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,37 @@
# Load Web assembly when needed
# PowerShell Core has the assembly preloaded
if (!("System.Web.HttpUtility" -as [Type])) {
Add-Type -Assembly System.Web
Add-Type -AssemblyName "System.Web"
}
# Load System.Net.Http when needed
# PowerShell Core has the assembly preloaded
if (!("System.Net.Http.HttpRequestException" -as [Type])) {
Add-Type -AssemblyName "System.Net.Http"
}
if (!("System.Net.Http" -as [Type])) {
Add-Type -Assembly System.Net.Http
}
#endregion Dependencies

#region Configuration
$script:DefaultContentType = "application/json; charset=utf-8"
$script:DefaultPageSize = 25
$script:DefaultHeaders= @{ "Accept-Charset" = "utf-8" }
# Bug in PSv3's .Net API
if ($PSVersionTable.PSVersion.Major -gt 3) {
$script:DefaultHeaders["Accept"] = "application/json"
}
$script:PagingContainers = @(
"comments"
"dashboards"
"groups"
"issues"
"values"
"worklogs"
)
$script:SessionTransformationMethod = "ConvertTo-JiraSession"
#endregion Configuration

#region LoadFunctions
$PublicFunctions = @( Get-ChildItem -Path "$PSScriptRoot/Public/*.ps1" -ErrorAction SilentlyContinue )
$PrivateFunctions = @( Get-ChildItem -Path "$PSScriptRoot/Private/*.ps1" -ErrorAction SilentlyContinue )
Expand All @@ -24,15 +51,14 @@ foreach ($file in @($PublicFunctions + $PrivateFunctions)) {
. $file.FullName
}
catch {
$errorItem = [System.Management.Automation.ErrorRecord]::new(
([System.ArgumentException]"Function not found"),
'Load.Function',
[System.Management.Automation.ErrorCategory]::ObjectNotFound,
$file
)
$exception = ([System.ArgumentException]"Function not found")
$errorId = "Load.Function"
$errorCategory = 'ObjectNotFound'
$errorTarget = $file
$errorItem = New-Object -TypeName System.Management.Automation.ErrorRecord $exception, $errorId, $errorCategory, $errorTarget
$errorItem.ErrorDetails = "Failed to import function $($file.BaseName)"
throw $errorItem
}
}
Export-ModuleMember -Function $PublicFunctions.BaseName
Export-ModuleMember -Function $PublicFunctions.BaseName -Alias *
#endregion LoadFunctions
22 changes: 22 additions & 0 deletions JiraPS/Private/ConvertTo-GetParameter.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function ConvertTo-GetParameter {
<#
.SYNOPSIS
Generate the GET parameter string for an URL from a hashtable
#>
[CmdletBinding()]
param (
[Parameter( Position = 0, Mandatory = $true, ValueFromPipeline = $true )]
[hashtable]$InputObject
)

process {
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Making HTTP get parameter string out of a hashtable"
Write-Verbose ($InputObject | Out-String)
[string]$parameters = "?"
foreach ($key in $InputObject.Keys) {
$value = $InputObject[$key]
$parameters += "$key=$($value)&"
}
$parameters -replace ".$"
}
}
32 changes: 20 additions & 12 deletions JiraPS/Private/ConvertTo-JiraFilter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,33 @@ function ConvertTo-JiraFilter {
param(
[Parameter( ValueFromPipeline )]
[PSObject[]]
$InputObject
$InputObject,

[PSObject[]]
$FilterPermissions
)

process {
foreach ($i in $InputObject) {
Write-Debug "[$($MyInvocation.MyCommand.Name)] Converting `$InputObject to custom object"

$props = @{
'ID' = $i.id
'Name' = $i.name
'JQL' = $i.jql
'RestUrl' = $i.self
'ViewUrl' = $i.viewUrl
'SearchUrl' = $i.searchUrl
'Favourite' = $i.favourite

'SharePermission' = $i.sharePermissions
'SharedUser' = $i.sharedUsers
'Subscription' = $i.subscriptions
'ID' = $i.id
'Name' = $i.name
'JQL' = $i.jql
'RestUrl' = $i.self
'ViewUrl' = $i.viewUrl
'SearchUrl' = $i.searchUrl
'Favourite' = $i.favourite
'FilterPermissions' = @()

'SharePermission' = $i.sharePermissions
'SharedUser' = $i.sharedUsers
'Subscription' = $i.subscriptions
}

if ($FilterPermissions) {
$props.FilterPermissions = @(ConvertTo-JiraFilterPermission ($FilterPermissions))
}

if ($i.description) {
Expand Down
39 changes: 39 additions & 0 deletions JiraPS/Private/ConvertTo-JiraFilterPermission.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
function ConvertTo-JiraFilterPermission {
[CmdletBinding()]
param(
[Parameter( ValueFromPipeline )]
[PSObject[]]
$InputObject
)

process {
foreach ($i in $InputObject) {
Write-Debug "[$($MyInvocation.MyCommand.Name)] Converting `$InputObject to custom object"

$props = @{
'ID' = $i.id
'Type' = $i.type
'Group' = $null
'Project' = $null
'Role' = $null
}
if ($i.group) {
$props["Group"] = ConvertTo-JiraGroup $i.group
}
if ($i.project) {
$props["Project"] = ConvertTo-JiraProject $i.project
}
if ($i.role) {
$props["Role"] = ConvertTo-JiraProjectRole $i.role
}

$result = New-Object -TypeName PSObject -Property $props
$result.PSObject.TypeNames.Insert(0, 'JiraPS.FilterPermission')
$result | Add-Member -MemberType ScriptMethod -Name 'ToString' -Force -Value {
Write-Output "$($this.Type)"
}

Write-Output $result
}
}
}
30 changes: 30 additions & 0 deletions JiraPS/Private/ConvertTo-JiraProjectRole.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function ConvertTo-JiraProjectRole {
[CmdletBinding()]
param(
[Parameter( ValueFromPipeline )]
[PSObject[]]
$InputObject
)

process {
foreach ($i in $InputObject) {
Write-Debug "[$($MyInvocation.MyCommand.Name)] Converting `$InputObject to custom object"

$props = @{
'ID' = $i.id
'Name' = $i.name
'Description' = $i.description
'Actors' = $i.actors
'RestUrl' = $i.self
}

$result = New-Object -TypeName PSObject -Property $props
$result.PSObject.TypeNames.Insert(0, 'JiraPS.ProjectRole')
$result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value {
Write-Output "$($this.Name)"
}

Write-Output $result
}
}
}
Loading

0 comments on commit 6414364

Please sign in to comment.