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

Release 3.3.0 #103

Merged
merged 21 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7028eca
Add .first() function to JSON response captures
noremac700 Apr 2, 2024
57652e8
Add .last() function to JSON response captures
noremac700 Apr 2, 2024
83cd8b7
Refactor checking for function
noremac700 Apr 2, 2024
637e584
Rename
noremac700 Apr 2, 2024
dcd9174
refactor: unify definitions for request and response headers, and var…
alexandrehtrb Apr 10, 2024
6e757a1
Merge branch 'master' into develop
alexandrehtrb Apr 11, 2024
f31f2cc
cicd: add comment to PR for draft release
alexandrehtrb Apr 11, 2024
8a5e520
Merge branch 'master' into develop
alexandrehtrb Apr 12, 2024
3d33720
Add failing tests
cameronpyne-smith Apr 13, 2024
bf643f3
Return JsonNode rather than string from function processor
cameronpyne-smith Apr 14, 2024
780f788
Merge pull request #90 from cameronpyne-smith/feature/86-response-cap…
alexandrehtrb Apr 15, 2024
bf6d68c
refactor: single icon in EditableTextBlock
alexandrehtrb Apr 18, 2024
cdb06c2
docs: fix grammar
alexandrehtrb Apr 22, 2024
6164913
fix: nullable warnings in JSON capture
alexandrehtrb Apr 23, 2024
f0363d8
refactor: enable assembly trimming on desktop project
alexandrehtrb Apr 23, 2024
64ea56f
refactor/fix: eliminates useless grids and buttons from UI; fixnumber…
alexandrehtrb Apr 24, 2024
05164e1
cicd: add PR comment with unit test coverage
Apr 26, 2024
895b9fe
cicd: fix PR unit test cov comment
Apr 26, 2024
5526479
cicd: change code cov PR comment generation
alexandrehtrb Apr 26, 2024
e6e6071
cicd: code cov title in PR comment
alexandrehtrb Apr 26, 2024
a3fe397
release: version 3.3.0
Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/draft-github-release-wfw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
uses: ./.github/workflows/generate-nuget-and-sboms-wfw.yml
with:
uploadArtifactsToRelease: true
postUnitTestsCoverageInPR: true
prNumber: ${{ github.event.number }}

linux-x64:
needs: draft-github-release
Expand Down
40 changes: 39 additions & 1 deletion .github/workflows/generate-nuget-and-sboms-wfw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
required: false
default: false
type: boolean
postUnitTestsCoverageInPR:
required: false
default: false
type: boolean
prNumber:
required: false
default: 0
type: number

jobs:

Expand Down Expand Up @@ -45,7 +53,37 @@ jobs:
run: dotnet build --no-restore --configuration Release --nologo --verbosity quiet

- name: Execute unit tests
run: dotnet test --no-build --configuration Release --nologo --verbosity quiet --filter FullyQualifiedName!~Pororoca.Test.Tests
run: dotnet test --no-build --configuration Release --nologo --verbosity quiet --filter FullyQualifiedName!~Pororoca.Test.Tests --collect:"XPlat Code Coverage" --results-directory ./TestResults/

- name: Report unit tests coverage
if: ${{ inputs.postUnitTestsCoverageInPR == true }}
uses: danielpalme/[email protected]
with:
reports: TestResults/**/coverage.cobertura.xml
targetdir: TestResults
reporttypes: JsonSummary
assemblyfilters: +Pororoca.Domain;+Pororoca.Domain.OpenAPI
filefilters: -*.g.cs

- name: Add unit tests coverage comment to PR
if: ${{ inputs.postUnitTestsCoverageInPR == true }}
shell: pwsh
run: |
$summary = (Get-Content ./TestResults/Summary.json) | ConvertFrom-Json;
$lineCovBadgeColor = if ($summary.summary.linecoverage -ge 90.0) { "080" } else { "800" };
$branchCovBadgeColor = if ($summary.summary.branchcoverage -ge 80.0) { "080" } else { "800" };
$linesBadge = "![Line coverage](https://img.shields.io/badge/lines-" + $summary.summary.linecoverage + "%25-" + $lineCovBadgeColor + ")";
$branchesBadge = "![Branch coverage](https://img.shields.io/badge/branches-" + $summary.summary.branchcoverage + "%25-" + $branchCovBadgeColor + ")";
$text = "`#`#`# Unit tests code coverage " + $linesBadge + " " + $branchesBadge + "`n`n" + "| Assembly | Line coverage | Branch coverage |`n|---|---|---|`n";
foreach ($assembly in $summary.coverage.assemblies)
{
$text += "| **$($assembly.name)** | $($assembly.coverage)% | $($assembly.branchcoverage)% |`n"
}
Set-Content -Path ./TestResults/SummaryGithub2.md -Value $text
gh pr comment $env:PR_NUMBER --body-file ./TestResults/SummaryGithub2.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ inputs.prNumber }}

- name: Read package version
shell: pwsh
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

* [3.3.0](#330-2024-04-29)
* [3.2.0](#320-2024-04-09)
* [3.1.1](#311-2024-03-13)
* [3.1.0.1](#3101-2024-02-19)
Expand All @@ -23,6 +24,41 @@
* [1.1.0](#110-2022-03-20)
* [1.0.0](#100-2022-03-08)

## [3.3.0](https://github.com/alexandrehtrb/Pororoca/tree/3.3.0) (2024-04-29)

### Features

* Adds `.first()` and `.last()` functions to JSON response captures by [@cameronpyne-smith](https://github.com/cameronpyne-smith) (PR #90).

### Bug Fixes

* Number of repetitions to execute in sequential mode is now correctly displayed.

### Refactors

* App trimming to remove unused code and DLLs, reducing disk and memory usage:

| operating system | version | disk usage | start memory usage | end memory usage |
|---|---|---|---|---|
| Windows 7 x64 | Pororoca v3.3.0 | 49.7MB | 96MB | 250MB |
| Windows 7 x64 | Pororoca v3.2.0 | 70.2MB | 138MB | 259MB |
| Windows 7 x64 | Postman v10.24 | 526MB | 360MB | 787MB |
| Debian 12 KDE x64 | Pororoca v3.3.0 | 47.4MB | 171MB | 494MB |
| Debian 12 KDE x64 | Pororoca v3.2.0 | 67.5MB | 231MB | 497MB |
| Debian 12 KDE x64 | Postman v10.24 | 405.6MB | 430MB | 816MB |

The end memory usage was measured after importing several collections and sending many requests.

* Centralized classes and layouts for many tables.
* Removed useless grids and views, navigation is sleeker.

### CI/CD

* Releases are drafted when opening a PR to master.
* Code coverage report in PR to master.
* Pororoca.Test published to NuGet via GitHub Actions.


## [3.2.0](https://github.com/alexandrehtrb/Pororoca/tree/3.2.0) (2024-04-09)

### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Ler em português](README_pt.md) | [Читать на русском](README_ru.md) | [Leggi in italiano](README_it.md) | [以简体中文阅读](README_zh-cn.md)

Pororoca is a HTTP testing tool, inspired by Postman, but with many improvements.
Pororoca is an HTTP testing tool, inspired by Postman, but with many improvements.

It is available for Windows, macOS and Linux.

Expand Down
2 changes: 1 addition & 1 deletion src/Pororoca.Desktop.Debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: pororoca
Version: 3.2.0
Version: 3.3.0
Section: devel
Priority: optional
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion src/Pororoca.Desktop.Debian/publishdebian.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ mkdir ./staging_folder/usr/share/icons/hicolor/scalable
mkdir ./staging_folder/usr/share/icons/hicolor/scalable/apps
cp ./misc/pororoca_logo.svg ./staging_folder/usr/share/icons/hicolor/scalable/apps/pororoca.svg
# Make .deb file
dpkg-deb --root-owner-group --build ./staging_folder/ ./pororoca_3.2.0_amd64.deb
dpkg-deb --root-owner-group --build ./staging_folder/ ./pororoca_3.3.0_amd64.deb
4 changes: 2 additions & 2 deletions src/Pororoca.Desktop.MacOSX/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<key>CFBundleDisplayName</key>
<string>Pororoca</string>
<key>CFBundleVersion</key>
<string>3.2.0</string>
<string>3.3.0</string>
<key>CFBundleShortVersionString</key>
<string>3.2.0</string>
<string>3.3.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>CFBundleExecutable</key>
Expand Down
59 changes: 8 additions & 51 deletions src/Pororoca.Desktop/Controls/EditableTextBlock.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:vm="clr-namespace:Pororoca.Desktop.ViewModels;assembly=Pororoca.Desktop"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:conv="clr-namespace:Pororoca.Desktop.Converters;assembly=Pororoca.Desktop"
mc:Ignorable="d"
d:DesignWidth="1350"
d:DesignHeight="700"
Expand All @@ -12,6 +13,10 @@
x:DataType="vm:EditableTextBlockViewModel"
FontSize="14">

<UserControl.Resources>
<conv:EditableTextBlockIconConverter x:Key="etbIconConverter"/>
</UserControl.Resources>

<Grid ShowGridLines="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
Expand All @@ -31,63 +36,15 @@
Orientation="Horizontal"
IsVisible="{Binding !IsEditing}">
<Image
x:Name="imgIconHttp"
Margin="0,0,12,0"
IsVisible="{Binding IsHttpRequest}"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<Image.Source>
<DrawingImage Drawing="{StaticResource IconHttp}"/>
</Image.Source>
</Image>
<Image
x:Name="imgIconDisconnectedWebSocket"
Margin="0,0,12,0"
IsVisible="{Binding IsDisconnectedWebSocket}"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<Image.Source>
<DrawingImage Drawing="{StaticResource IconWebsocket}"/>
</Image.Source>
</Image>
<Image
x:Name="imgIconConnectedWebSocket"
Margin="0,0,12,0"
IsVisible="{Binding IsConnectedWebSocket}"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<Image.Source>
<DrawingImage Drawing="{StaticResource IconWebsocketConnected}"/>
</Image.Source>
</Image>
<Image
x:Name="imgIconHttpRepetition"
Margin="0,0,12,0"
IsVisible="{Binding IsHttpRepetition}"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<Image.Source>
<DrawingImage Drawing="{StaticResource IconRifleGun}"/>
</Image.Source>
</Image>
<Image
x:Name="imgIconHttpMinigun"
x:Name="imgIcon"
Margin="0,0,12,0"
IsVisible="{Binding IsHttpMinigun}"
IsVisible="{Binding HasIcon}"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<Image.Source>
<DrawingImage Drawing="{StaticResource IconMinigun}"/>
<DrawingImage Drawing="{Binding Icon, Mode=OneWay, Converter={StaticResource etbIconConverter}}"/>
</Image.Source>
</Image>
<TextBlock
Expand Down
108 changes: 108 additions & 0 deletions src/Pororoca.Desktop/Controls/RequestHeadersTableView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<UserControl
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:Pororoca.Desktop.ViewModels.DataGrids;assembly=Pororoca.Desktop"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:Pororoca.Desktop.Controls;assembly=Pororoca.Desktop"
mc:Ignorable="d"
d:DesignWidth="1350"
d:DesignHeight="700"
x:Class="Pororoca.Desktop.Controls.RequestHeadersTableView"
x:CompileBindings="True"
x:DataType="vm:RequestHeadersDataGridViewModel">

<DataGrid
Name="datagrid"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
AutoGenerateColumns="False"
ItemsSource="{Binding Items}"
SelectionChanged="OnSelectedRequestHeadersChanged"
CanUserResizeColumns="True"
HeadersVisibility="All"
Classes="DragAndDrop RequestHeadersDragAndDrop">
<!--DataGrid.KeyBindings>
<KeyBinding Command="{Binding RequestHeadersTableVm.CutCmd}" Gesture="Ctrl+X" />
<KeyBinding Command="{Binding RequestHeadersTableVm.CopyCmd}" Gesture="Ctrl+C" />
<KeyBinding Command="{Binding RequestHeadersTableVm.PasteCmd}" Gesture="Ctrl+V" />
<KeyBinding Command="{Binding RequestHeadersTableVm.DuplicateCmd}" Gesture="Ctrl+D" />
<KeyBinding Command="{Binding RequestHeadersTableVm.DeleteCmd}" Gesture="Delete" />
</DataGrid.KeyBindings-->
<DataGrid.ContextMenu>
<ContextMenu>
<MenuItem
Header="{Binding i18n.ContextMenu.Cut}"
Command="{Binding CutCmd}"
InputGesture="Ctrl+X"/>
<MenuItem
Header="{Binding i18n.ContextMenu.Copy}"
Command="{Binding CopyCmd}"
InputGesture="Ctrl+C"/>
<MenuItem
Header="{Binding i18n.ContextMenu.Paste}"
Command="{Binding PasteCmd}"
InputGesture="Ctrl+V"
IsEnabled="{Binding InnerClipboardArea.CanPaste}"/>
<MenuItem
Header="{Binding i18n.ContextMenu.Delete}"
Command="{Binding DeleteCmd}"
InputGesture="Delete"/>
</ContextMenu>
</DataGrid.ContextMenu>
<DataGrid.Columns>
<DataGridCheckBoxColumn
Width="0.24*"
Binding="{Binding Enabled}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding i18n.HttpRequest.HeaderEnabled}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<DataGridTemplateColumn Width="0.32*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding i18n.HttpRequest.HeaderName}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock
Text="{Binding Key}"
VerticalAlignment="Center"
Padding="12,0,12,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<controls:HeaderNameTextBox
Text="{Binding Key}"
VerticalContentAlignment="Center"
Padding="12,0,12,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn
Width="0.32*"
Binding="{Binding Value}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding i18n.HttpRequest.HeaderValue}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTemplateColumn
Width="0.12*"
Header="">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button
Command="{Binding RemoveParamCmd}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Classes="Trash">
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>

</UserControl>
20 changes: 20 additions & 0 deletions src/Pororoca.Desktop/Controls/RequestHeadersTableView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Pororoca.Desktop.ViewModels.DataGrids;
using static Pororoca.Desktop.Views.DataGridSelectionUpdater;

namespace Pororoca.Desktop.Controls;

public sealed class RequestHeadersTableView : UserControl
{
public RequestHeadersTableView() => InitializeComponent();

private void InitializeComponent() => AvaloniaXamlLoader.Load(this);

public void OnSelectedRequestHeadersChanged(object sender, SelectionChangedEventArgs e)
{
var tableVm = (RequestHeadersDataGridViewModel)DataContext!;
UpdateVmSelectedItems(tableVm, e);
}
}
Loading