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

chore: Bump to .NET 8.0 #297

Merged
merged 4 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/build.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
tokenSuffix: __

- task: UseDotNet@2
displayName: Use .Net SDK 7.x
displayName: Use .Net SDK
continueOnError: True
inputs:
version: 7.x
version: 8.x

- task: DotNetCoreCLI@2
displayName: dotnet restore
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/semantic-pr-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: write

jobs:
main:
name: validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:

# Configure additional validation for the subject based on a regex.
# We enforce that the subject starts with an uppercase character.
subjectPattern: ^([A-Z]).+$

# If `subjectPattern` is configured, you can use this property to override
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
subjectPatternError: >
The subject "**{subject}**" found in the pull request title "*{title}*"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.

# If the PR contains one of these newline-delimited labels, the
# validation is skipped. If you want to rerun the validation when
# labels change, you might want to use the `labeled` and `unlabeled`
# event triggers in your workflow.
ignoreLabels: |
bot
ignore-semantic-pull-request

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: >
### Hey there and thank you for opening this pull request! 👋🏼

It looks like your proposed **_Pull request title_** needs to be adjusted.

>🚩 **Error** » ${{ steps.lint_pr_title.outputs.error_message }}

#### Pull request title naming convention

Our PR title name taxonomy is `type: Subject`, where **type** is typically
*feat*, *fix*, or *chore*, and **subject** is a phrase (proper noun) that starts with a capitalized letter.
The *chore* type usually has a subject that starts with an action verb like *Add* or *Update*.
Examples: `feat: Admin portal login`, `fix: Divide by zero bug in SMA`, and `chore: Update user docs`.
See the [Conventional Commits specification](https://www.conventionalcommits.org) for more information.

# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
3 changes: 2 additions & 1 deletion Client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
],
"analytics": false
},
"schematics": {
"@angular-eslint/schematics:application": {
Expand Down
2 changes: 1 addition & 1 deletion Server/ChartBackend.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Functions", "Functions\Functions.csproj", "{5C774F35-FFB4-488A-8232-8D31F77557A7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Functions", "Functions\Functions.csproj", "{5C774F35-FFB4-488A-8232-8D31F77557A7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
12 changes: 6 additions & 6 deletions Server/Functions/Functions.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Alpaca.Markets" Version="6.2.5" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.19.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.15.1" />
<PackageReference Include="Alpaca.Markets" Version="7.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WebApi\WebApi.csproj" />
Expand All @@ -27,4 +27,4 @@
<ItemGroup>
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Server/Functions/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is used by Code Analysis to maintain SuppressMessage
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
Expand Down
9 changes: 2 additions & 7 deletions Server/Functions/UpdateQuotes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@

namespace Functions;

public class Jobs
public class Jobs(ILoggerFactory loggerFactory)
{
private readonly ILogger _logger;

public Jobs(ILoggerFactory loggerFactory)
{
_logger = loggerFactory.CreateLogger<Jobs>();
}
private readonly ILogger _logger = loggerFactory.CreateLogger<Jobs>();

[Function("UpdateQuotes")]
public async Task Run([TimerTrigger("0 */1 08-18 * * 1-5")] TimerInfo myTimer)
Expand Down
9 changes: 7 additions & 2 deletions Server/WebApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// STARTUP CONFIGURATION

using WebApi.Services;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

IServiceCollection services = builder.Services;
Expand All @@ -10,7 +12,7 @@

// get CORS origins from appsettings
IConfigurationSection corsOrigins = configuration.GetSection("CorsOrigins");
List<string> origins = new();
List<string> origins = [];
origins.Add(item: corsOrigins["Website"]);

// setup CORS for website
Expand All @@ -22,12 +24,15 @@
cors.AllowAnyHeader();
cors.AllowAnyMethod();
cors.AllowCredentials();
cors.WithOrigins(origins.ToArray());
cors.WithOrigins([.. origins]);
});
});

Console.WriteLine($"CORS Origins: {corsOrigins["Website"]}");

// register services
builder.Services.AddHostedService<StartupService>();

// build application
WebApplication app = builder.Build();

Expand Down
Loading