Skip to content

Commit

Permalink
fix(ci): Bump to net8.0 and drop unused net7.0 target for grasshopper (
Browse files Browse the repository at this point in the history
…#3659)

* fix(ci): install net7.0 explicitly on CI

* test: Bump everything to net8 or drop

* test: Global.json points to net8 with `latestFeature`. This prevents using net9 accidentally

* fix: Typo in target framework

* fix: TargetFramework instead of plural

* fix: Use net8:0 image to build on mac

* Added deprecation warning to comments API

* reverted inputs change

* Removed inputs

---------

Co-authored-by: Jedd Morgan <[email protected]>
  • Loading branch information
AlanRynne and JR-Morgan authored Nov 27, 2024
1 parent 6354863 commit e2a593a
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 302 deletions.
9 changes: 5 additions & 4 deletions .circleci/scripts/config-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs: # Each project will have individual jobs for each specific task it has to
name: Install dotnet
command: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 7.0.410
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 8.0.206
$HOME/.dotnet/dotnet --version
- run:
Expand Down Expand Up @@ -200,9 +201,9 @@ jobs: # Each project will have individual jobs for each specific task it has to
shell: bash.exe
command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi
- unless: # Build Unsigned Installers for untagged, or wip/alpha/feature/etc. tags (non-stable, non-rc)
condition:
condition:
and:
- << pipeline.git.tag >>
- << pipeline.git.tag >>
- not:
matches:
pattern: "^.*-(?!rc).*$"
Expand All @@ -221,7 +222,7 @@ jobs: # Each project will have individual jobs for each specific task it has to
- when: # Setup certificates and build installers signed for tagged builds that aren't prerelease
condition:
and:
- << pipeline.git.tag >>
- << pipeline.git.tag >>
- not:
matches:
pattern: "^.*-(?!rc).*$"
Expand Down Expand Up @@ -445,7 +446,7 @@ jobs: # Each project will have individual jobs for each specific task it has to

build-connector-dotnet-mac:
docker:
- image: mcr.microsoft.com/dotnet/sdk:7.0
- image: mcr.microsoft.com/dotnet/sdk:8.0
parameters:
slnname:
type: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,41 @@
<PropertyGroup>
<RootNamespace>ConnectorGrasshopper</RootNamespace>
<AssemblyName>SpeckleConnectorGrasshopper</AssemblyName>
<TargetFrameworks>net7.0-windows;net48</TargetFrameworks>
<TargetFramework>net48</TargetFramework>
<TargetExt>.gha</TargetExt>
<Configurations>Debug;Release;Debug Mac;Release Mac</Configurations>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<DefineConstants>$(DefineConstants);RHINO8;GRASSHOPPER;RHINO6_OR_GREATER;RHINO7_OR_GREATER;RHINO8_OR_GREATER</DefineConstants>
<DefineConstants>
$(DefineConstants);RHINO8;GRASSHOPPER;RHINO6_OR_GREATER;RHINO7_OR_GREATER;RHINO8_OR_GREATER</DefineConstants>
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>
<EnableWindowsTargeting>true</EnableWindowsTargeting>

</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug Mac' Or '$(Configuration)'=='Release Mac'">
<DefineConstants>$(DefineConstants);MAC</DefineConstants>
</PropertyGroup>

<Import Project="..\ConnectorGrasshopperShared\ConnectorGrasshopperShared.projitems" Label="Shared" />
<Import Project="..\ConnectorGrasshopperShared\ConnectorGrasshopperShared.projitems"
Label="Shared"/>

<ItemGroup>
<ProjectReference Include="..\..\Core\Core\Core.csproj" />
<ProjectReference Include="..\..\Core\Transports\DiskTransport\DiskTransport.csproj" />
<ProjectReference Include="..\ConnectorGrasshopperUtils\ConnectorGrasshopperUtils.csproj" />
<ProjectReference Include="..\..\Core\Core\Core.csproj"/>
<ProjectReference Include="..\..\Core\Transports\DiskTransport\DiskTransport.csproj"/>
<ProjectReference Include="..\ConnectorGrasshopperUtils\ConnectorGrasshopperUtils.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="GrasshopperAsyncComponent" Version="1.2.3" />
<PackageReference Include="Grasshopper" Version="8.3.24009.15001" IncludeAssets="compile;build" />
<PackageReference Include="System.Drawing.Common" Version="8.0.1" />
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
<PackageReference Include="GrasshopperAsyncComponent" Version="1.2.3"/>
<PackageReference Include="Grasshopper" Version="8.3.24009.15001" IncludeAssets="compile;build"/>
<PackageReference Include="System.Drawing.Common" Version="8.0.1"/>
<PackageReference Include="System.Resources.Extensions" Version="7.0.0"/>
</ItemGroup>

<Target Name="GenerateT4">
<Message Text="Generating T4 templates..." Importance="high" />
<Exec Command="dotnet t4 -o $(ProjectDir)..\ConnectorGrasshopperShared\SchemaBuilder\SchemaBuilderGen.cs $(ProjectDir)..\ConnectorGrasshopperShared\SchemaBuilder\SchemaBuilderGen.tt -P=$(ProjectDir)" />
<Message Text="Generating T4 templates..." Importance="high"/>
<Exec
Command="dotnet t4 -o $(ProjectDir)..\ConnectorGrasshopperShared\SchemaBuilder\SchemaBuilderGen.cs $(ProjectDir)..\ConnectorGrasshopperShared\SchemaBuilder\SchemaBuilderGen.tt -P=$(ProjectDir)"/>
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net7.0</TargetFrameworks>
<TargetFramework>net462</TargetFramework>
<RootNamespace>ConnectorGrasshopperUtils</RootNamespace>
<RhinoPluginType>none</RhinoPluginType>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Grasshopper" Version="8.3.24009.15001" IncludeAssets="compile;build"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Grasshopper" Version="6.28.20199.17141" IncludeAssets="compile;build"/>
</ItemGroup>
Expand Down
17 changes: 0 additions & 17 deletions Core/Core/Api/GraphQL/Inputs/CommentInputs.cs

This file was deleted.

136 changes: 6 additions & 130 deletions Core/Core/Api/GraphQL/Resources/CommentResource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading;
using System;
using System.Threading;
using System.Threading.Tasks;
using GraphQL;
using Speckle.Core.Api.GraphQL.Inputs;
Expand All @@ -9,6 +10,8 @@ namespace Speckle.Core.Api.GraphQL.Resources;

public sealed class CommentResource
{
internal const string OBSOLETE_MESSAGE =
"This function is longer compatible with server >=2.22, update nuget reference to Speckle.Sdk for comment mutations";
private readonly ISpeckleGraphQLClient _client;

internal CommentResource(ISpeckleGraphQLClient client)
Expand Down Expand Up @@ -105,98 +108,12 @@ query CommentThreads($projectId: String!, $cursor: String, $limit: Int!, $filter
return response.project.commentThreads;
}

/// <remarks>
/// This function only exists here to be able to integration tests the queries.
/// The process of creating a comment is more complex and javascript specific than we can expose to our SDKs at this time.
/// </remarks>
/// <param name="input"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <inheritdoc cref="ISpeckleGraphQLClient.ExecuteGraphQLRequest{T}"/>
internal async Task<Comment> Create(CreateCommentInput input, CancellationToken cancellationToken = default)
{
//language=graphql
const string QUERY = """
mutation Mutation($input: CreateCommentInput!) {
data:commentMutations {
create(input: $input) {
archived
authorId
createdAt
hasParent
id
rawText
resources {
resourceId
resourceType
}
screenshot
updatedAt
viewedAt
viewerResources {
modelId
objectId
versionId
}
data
}
}
}
""";
GraphQLRequest request = new(QUERY, variables: new { input });
var res = await _client
.ExecuteGraphQLRequest<RequiredResponse<CommentMutation>>(request, cancellationToken)
.ConfigureAwait(false);
return res.data.create;
}

/// <remarks><inheritdoc cref="Create"/></remarks>
/// <param name="input"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <inheritdoc cref="ISpeckleGraphQLClient.ExecuteGraphQLRequest{T}"/>
internal async Task<Comment> Edit(EditCommentInput input, CancellationToken cancellationToken = default)
{
//language=graphql
const string QUERY = """
mutation Mutation($input: EditCommentInput!) {
data:commentMutations {
edit(input: $input) {
archived
authorId
createdAt
hasParent
id
rawText
resources {
resourceId
resourceType
}
screenshot
updatedAt
viewedAt
viewerResources {
modelId
objectId
versionId
}
data
}
}
}
""";
GraphQLRequest request = new(QUERY, variables: new { input });
var res = await _client
.ExecuteGraphQLRequest<RequiredResponse<CommentMutation>>(request, cancellationToken)
.ConfigureAwait(false);
return res.data.edit;
}

/// <param name="commentId"></param>
/// <param name="archive"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <inheritdoc cref="ISpeckleGraphQLClient.ExecuteGraphQLRequest{T}"/>
[Obsolete(OBSOLETE_MESSAGE)]
public async Task<bool> Archive(string commentId, bool archive = true, CancellationToken cancellationToken = default)
{
//language=graphql
Expand All @@ -218,6 +135,7 @@ mutation Mutation($commentId: String!, $archive: Boolean!) {
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <inheritdoc cref="ISpeckleGraphQLClient.ExecuteGraphQLRequest{T}"/>
[Obsolete(OBSOLETE_MESSAGE)]
public async Task<bool> MarkViewed(string commentId, CancellationToken cancellationToken = default)
{
//language=graphql
Expand All @@ -234,46 +152,4 @@ mutation Mutation($commentId: String!) {
.ConfigureAwait(false);
return res.data.markViewed;
}

/// <remarks><inheritdoc cref="Create"/></remarks>
/// <param name="input"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <inheritdoc cref="ISpeckleGraphQLClient.ExecuteGraphQLRequest{T}"/>
internal async Task<Comment> Reply(CreateCommentReplyInput input, CancellationToken cancellationToken = default)
{
//language=graphql
const string QUERY = """
mutation Mutation($input: CreateCommentReplyInput!) {
data:commentMutations {
reply(input: $input) {
archived
authorId
createdAt
hasParent
id
rawText
resources {
resourceId
resourceType
}
screenshot
updatedAt
viewedAt
viewerResources {
modelId
objectId
versionId
}
data
}
}
}
""";
GraphQLRequest request = new(QUERY, variables: new { input });
var res = await _client
.ExecuteGraphQLRequest<RequiredResponse<CommentMutation>>(request, cancellationToken)
.ConfigureAwait(false);
return res.data.reply;
}
}
Loading

0 comments on commit e2a593a

Please sign in to comment.