Skip to content

Commit

Permalink
v 1.1.0.1, github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ndu committed Dec 24, 2024
1 parent 438635e commit e8218c7
Show file tree
Hide file tree
Showing 28 changed files with 206 additions and 78 deletions.
137 changes: 137 additions & 0 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
# built on .NET Core.
# To learn how to migrate your existing application to .NET Core,
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
#
# To configure this workflow:
#
# 1. Configure environment variables
# GitHub sets default environment variables for every workflow run.
# Replace the variables relative to your project in the "env" section below.
#
# 2. Signing
# Generate a signing certificate in the Windows Application
# Packaging Project or add an existing signing certificate to the project.
# Next, use PowerShell to encode the .pfx file using Base64 encoding
# by running the following Powershell script to generate the output string:
#
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
#
# Open the output file, SigningCertificate_Encoded.txt, and copy the
# string inside. Then, add the string to the repo as a GitHub secret
# and name it "Base64_Encoded_Pfx."
# For more information on how to configure your signing certificate for
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
#
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
# See "Build the Windows Application Packaging project" below to see how the secret is used.
#
# For more information on GitHub Actions, refer to https://github.com/features/actions
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
# refer to https://github.com/microsoft/github-actions-for-desktop-apps

name: .NET Core Desktop


on:
push:
branches: [ "main", "github-ci-tests" ]
pull_request:
branches: [ "main" ]
# Allows running workflow manually
workflow_dispatch:
inputs:
publishbuilds:
required: false
description: Publish Builds?
type: boolean
default: false

jobs:

build:

strategy:
matrix:
configuration: [Debug, Release]

runs-on: windows-2022

env:
Solution_Name: ClefInspect.sln
Test_Project_Path: ndu.ClefInspect.Tests\ndu.ClefInspect.Tests.csproj
Wap_Project_Directory: ndu.ClefInspect.Wap
Wap_Project_Path: ndu.ClefInspect.Wap\ndu.ClefInspect.Wap.wapproj

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}

# Execute all unit tests in the solution
- name: Build
run: dotnet build --configuration $env:Configuration
env:
Configuration: ${{ matrix.configuration }}

- name: Publish Build Artifacts
if: ${{ (matrix.configuration == 'Release') && inputs.publishbuilds }}
uses: actions/upload-artifact@v4
with:
name: ClefInspect-${{ github.ref_name }}-Windows
path: |
ndu.ClefInspect/bin/Release/net6.0-windows
# # Decode the base 64 encoded pfx and save the Signing_Certificate
# - name: Decode the pfx
# run: |
# $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
# $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
# [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
#
# # Create the app package by building and packaging the Windows Application Packaging project
# - name: Create the app package
# run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
# env:
# Appx_Bundle: Always
# Appx_Bundle_Platforms: x86|x64
# Appx_Package_Build_Mode: StoreUpload
# Configuration: ${{ matrix.configuration }}
#
# # Remove the pfx
# - name: Remove the pfx
# run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
#
# # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
# - name: Upload build artifacts
# uses: actions/upload-artifact@v3
# with:
# name: MSIX Package
# path: ${{ env.Wap_Project_Directory }}\AppPackages
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ A lightweight Windows (.NET, WPF) desktop app for viewing [CLEF](https://clef-js

![ClefInspect Screenshot](screenshot.png)

Runs on Windows only ([see future](#future)), distributed as a zip archive (Requires .NET6)
Currently runs on Windows with .NET 6.0 only. Distributed as a zip archive.


## Features

* Display CLEF events on a desktop UI in the order they appear in the logfile.
* Dynamic columns based on the properties available in the logfiles.
* Displays CLEF events.
* Add columns based on the properties available in your logfiles.
* Filter events (text and properties) and pin (always display) individual events.
* Scroll to events by timestamp, switch between local and UTC timestamps.
* Show the time difference between events.
* Can follow (tail) log files while other processes write to it.
* Tabs
* Copy selected events to text or JSON.

## Why?
## Why ClefInspect?

There are amazing full featured log servers, analysers, and viewers for [CLEF](https://clef-json.org/).

My work on CLEF logfiles is mostly bug-hunting and timing analysis of extensive logfiles. The main task here is to collect the revealing events and put them into a context. As none of the tools I found could fit my workflow perfectly, I ended up using notepad++. But viewing JSON all day long is no fun. So, I created ClefInspect out of necessity (and to fill a weekend of bad weather).
My work with CLEF logfiles is mostly bug-hunting and timing analysis of extensive logfiles. The main task is to collect the revealing events and put them into a context. As none of the tools I found could fit my workflow perfectly, I created ClefInspect.


You can crawl CLEF logs with ClefInspect very efficiently by using the workflow filter -> pin -> filter -> pin.
With ClefInspect, you can crawl the logfiles and keep the important events very efficiently by using filter -> pin -> filter -> pin.


## Future

I use ClefInspect 1.1 actively, thus i will enhance and fix every now and then. Feel free to report bugs or wishes on github.

Commercial support is available via my employer, just drop me a note.
Commercial support is available via my employer (see my github profile).

There are ideas to develop ClefInspect 2.0 for cross-platform by rewriting the WPF UI using Avalonia UI. Please contact my if you are interested to collaborate.
1 change: 0 additions & 1 deletion ndu.ClefInspect.Tests/Model/TextFilterParserTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ndu.ClefInspect.Model;
using System.Text.Json.Nodes;

namespace ndu.ClefInspect.Tests.Model
{
Expand Down
1 change: 0 additions & 1 deletion ndu.ClefInspect/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ndu.ClefInspect.View;
using ndu.ClefInspect;
using System.Windows;

namespace ndu.ClefInspect
Expand Down
1 change: 0 additions & 1 deletion ndu.ClefInspect/Model/Clef.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Text;
Expand Down
4 changes: 1 addition & 3 deletions ndu.ClefInspect/Model/ClefLockedList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;

namespace ndu.ClefInspect.Model
namespace ndu.ClefInspect.Model
{
public class ClefLockedList
{
Expand Down
12 changes: 4 additions & 8 deletions ndu.ClefInspect/Model/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
using Microsoft.Extensions.Configuration;
using System;
using System.Configuration;
using System.IO;
using System.IO.Packaging;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace ndu.ClefInspect.Model
{
public class Configuration
{
private const string DEFAULT_JSON = "clef_inspect.defaults.json";
private const string DEFAULT_JSON = "ClefInspect.defaults.json";
private string DEFAULT_JSON_PATH = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, DEFAULT_JSON);

public class ClefFeaturesOptions
{
Expand Down Expand Up @@ -40,7 +36,7 @@ public Configuration()
try
{
IConfigurationRoot config = new ConfigurationBuilder()
.AddJsonFile(DEFAULT_JSON, optional: true)
.AddJsonFile(DEFAULT_JSON_PATH, optional: true)
.Build();
config.GetSection(ClefFeaturesOptions.ClefFeatures).Bind(ClefFeatures);
config.GetSection(ViewSettingsOptions.ViewSettings).Bind(ViewSettings);
Expand All @@ -62,7 +58,7 @@ public void Write()
{
Indented = true
};
using var stream = new FileStream(DEFAULT_JSON, FileMode.Create, FileAccess.Write);
using var stream = new FileStream(DEFAULT_JSON_PATH, FileMode.Create, FileAccess.Write);
using var writer = new Utf8JsonWriter(stream, options);
writer.WriteStartObject();
writer.WritePropertyName(ClefFeaturesOptions.ClefFeatures);
Expand Down
3 changes: 1 addition & 2 deletions ndu.ClefInspect/Model/Filter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ndu.ClefInspect.Model;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace ndu.ClefInspect.Model
Expand Down
6 changes: 1 addition & 5 deletions ndu.ClefInspect/Model/TextFilter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using ndu.ClefInspect.Model;
using System;
using System.Text;

namespace ndu.ClefInspect.Model
namespace ndu.ClefInspect.Model
{
public class TextFilter : IFilter
{
Expand Down
7 changes: 1 addition & 6 deletions ndu.ClefInspect/Model/TextFilterParser.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text;

namespace ndu.ClefInspect.Model
{
Expand Down
4 changes: 2 additions & 2 deletions ndu.ClefInspect/SingleInstanceManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.IO.Pipes;
using System.IO;
using System.IO;
using System.IO.Pipes;
using System.Windows;
using System.Windows.Threading;

Expand Down
12 changes: 6 additions & 6 deletions ndu.ClefInspect/View/ClefView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using ndu.ClefInspect.ViewModel.ClefView;
using ndu.ClefInspect.ViewModel;
using ndu.ClefInspect.ViewModel.ClefView;
using System.ComponentModel;
using System.Globalization;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Data;
using System.ComponentModel;
using ndu.ClefInspect.ViewModel;

namespace ndu.ClefInspect.View
{
Expand All @@ -30,7 +30,7 @@ private void OnDataColumnEnabledChanged()
{
foreach (ClefViewModel.DataColumnView dataColumn in viewModel.DataColumns)
{
if(dataColumn.Enabled)
if (dataColumn.Enabled)
{
AddColumn(dataColumn.Header);
}
Expand Down Expand Up @@ -83,7 +83,7 @@ private void ClefView_DataContextChanged(object sender, System.Windows.Dependenc
viewModel.UserActionHandler += OnUserAction;
viewModel.DataColumnEnabledChanged += OnDataColumnEnabledChanged;
OnDataColumnEnabledChanged();
if(_listViewLogEntriesScrollViewer != null)
if (_listViewLogEntriesScrollViewer != null)
{
_listViewLogEntriesScrollViewer.ScrollToVerticalOffset(viewModel.VerticalOffset);
_listViewLogEntriesScrollViewer.ScrollToHorizontalOffset(viewModel.HorizontalOffset);
Expand Down
3 changes: 2 additions & 1 deletion ndu.ClefInspect/View/MainView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public partial class MainView : Window, IMainView
public MainView()
{
InitializeComponent();
this.Title += " "+ Assembly.GetExecutingAssembly().GetName().Version;
Version v = Assembly.GetExecutingAssembly().GetName().Version ?? new Version(0, 0, 0, 1);
this.Title += $" {v.Major}.{v.Minor}.{v.Build}";
}
public void OpenFiles(string[] files)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel;
using ndu.ClefInspect.Model;
using System.ComponentModel;
using System.Windows.Input;
using ndu.ClefInspect.Model;

namespace ndu.ClefInspect.ViewModel.ClefView
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel;
using ndu.ClefInspect.Model;
using System.ComponentModel;
using System.Windows.Input;
using ndu.ClefInspect.Model;

namespace ndu.ClefInspect.ViewModel.ClefView
{
Expand Down
5 changes: 2 additions & 3 deletions ndu.ClefInspect/ViewModel/ClefView/ClefFilterViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Collections.ObjectModel;
using ndu.ClefInspect.Model;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Windows.Input;
using ndu.ClefInspect.Model;

namespace ndu.ClefInspect.ViewModel.ClefView
{
Expand Down
1 change: 0 additions & 1 deletion ndu.ClefInspect/ViewModel/ClefView/ClefLineView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ndu.ClefInspect.Model;
using ndu.ClefInspect.ViewModel;
using System.ComponentModel;
using System.Text;
using System.Text.Json.Nodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace ndu.ClefInspect.ViewModel.ClefView
{
public partial class ClefViewModel
{
public class DataColumnView: INotifyPropertyChanged
public class DataColumnView : INotifyPropertyChanged
{
private bool _enabled;

Expand All @@ -22,7 +22,7 @@ public bool Enabled
get => _enabled;
set
{
if(_enabled != value)
if (_enabled != value)
{
_enabled = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Enabled)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ndu.ClefInspect.Model;
using ndu.ClefInspect.ViewModel.ClefView;
using System.Collections.Specialized;
using System.Windows;
using static ndu.ClefInspect.Model.LinesChangedEventArgs;
Expand Down Expand Up @@ -156,7 +155,7 @@ public Task Reload(FilteredClef clefLines,
if (changedAlot)
{
clefLines.NotifyCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));

}
else
{
Expand Down
Loading

0 comments on commit e8218c7

Please sign in to comment.