Skip to content

Conversation

@wilsoaa-ev
Copy link

Issue

Unable to write a different UI application and still use some of the reusable components of EG.

Description

The construction of EG solution made it such that we could not write our own UI application and still use the underlying features/functionality of EG. These changes primarily refactor several areas of the code to allow for the UI layer to be separate and swapped out by another UI in a different implementation without breaking this UI in this solution.

Copy link

@JDziurlaj JDziurlaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to build the ElectionGuard project on Windows, sans arm64 target.

There is one broken test, that appears to predate this PR. It is a failing test for Test_Save_TestDataOutput (part of ElectionGuard.Decryption.Tests.dll).

  Error Message:
   Newtonsoft.Json.JsonSerializationException : Error getting value from 'Pad' on 'ElectionGuard.HashedElGamalCiphertext'.
  ----> System.ArgumentNullException : SafeHandle cannot be null. (Parameter 'pHandle')`

The ElectionGuard.UI tests are commented out (prior to this PR) so it is hard to gauge how these changes affect its function.

We can update to .NET 9, but my preference is to only upgrade to .NET 8, which is the LTS version unless we need the features .NET 9 provides.

We will update the remaining .NET projects to the agreed upon .NET version post-merge.

There is a large number of whitespace-only changes in this PR. I am OK with using a linter/formatter, but it needs to be integrated into the build process (please point to where).

<!-- Package -->
<PackageId>Enhanced.ElectionGuard.Encryption</PackageId>
<Title>Enhanced ElectionGuard Encryption</Title>
<Description>Private fork of open source implementation of ElectionGuard's ballot encryption.</Description>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not be announced as a fork.

<PackageId>Enhanced.ElectionGuard.Encryption</PackageId>
<Title>Enhanced ElectionGuard Encryption</Title>
<Description>Private fork of open source implementation of ElectionGuard's ballot encryption.</Description>
<Authors>Enhanced Voting</Authors>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave as Microsoft. Attributes will given per the CLA.

<Authors>Enhanced Voting</Authors>
<PackageVersion>1.75.17</PackageVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Enhanced-Voting/electionguard</PackageProjectUrl>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use existing paths

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Enhanced-Voting/electionguard</PackageProjectUrl>
<RepositoryUrl>https://github.com/Enhanced-Voting/electionguard</RepositoryUrl>
<PackageTags>Enhanced;Electionguard;Encryption;Windows;Linux</PackageTags>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove tag

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<!-- <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> -->
<!-- <PackageReleaseNotes>Changelog</PackageReleaseNotes> -->
<Platforms>x64;x86</Platforms>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to understand why we are dropping ARM. It seems desirable to keep it given the relative state of x64/x86

<Nullable>enable</Nullable>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<Platforms>arm64;x64;x86</Platforms>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to understand why arm is being removed here.

using System.Xml.Linq;

var target = HasArgument("target") ? Argument("target", "Build") : Argument("t", "Build");
var target = HasArgument("target") ? Argument("target", "Build") : Argument("t", "Build");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's going on in this file at all.

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<!--<Configurations>Release;Debug</Configurations>-->
<Platforms Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">arm64;x64</Platforms>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we want to do this.

Comment on lines +19 to +26
<Title>Enhanced ElectionGuard Election Setup</Title>
<Description>Private fork of open source implementation of ElectionGuard's election setup.</Description>
<Authors>Enhanced Voting</Authors>
<PackageVersion>1.75.17</PackageVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Enhanced-Voting/electionguard</PackageProjectUrl>
<RepositoryUrl>https://github.com/Enhanced-Voting/electionguard</RepositoryUrl>
<PackageTags>Enhanced;Electionguard;Election;Setup;Windows;Linux</PackageTags>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove EV specific details

Comment on lines -40 to -59

<PropertyGroup Label="Debug|arm64" Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-maccatalyst|arm64'">
<CreatePackage>false</CreatePackage>
<RuntimeIdentifiers>maccatalyst-arm64;maccatalyst-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Label="Release|arm64" Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-maccatalyst|arm64'">
<CreatePackage>true</CreatePackage>
<RuntimeIdentifiers>maccatalyst-arm64;maccatalyst-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Label="Debug|x64" Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-maccatalyst|x64'">
<CreatePackage>false</CreatePackage>
<RuntimeIdentifiers>maccatalyst-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Label="Release|x64" Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-maccatalyst|x64'">
<CreatePackage>false</CreatePackage>
<RuntimeIdentifiers>maccatalyst-x64</RuntimeIdentifiers>
</PropertyGroup>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If MAUI is supported on mac, i see no need to remove this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants