Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit ea21102

Browse files
authored
Merge pull request #2 from TechNobre/develop
Develop the StatusCode UNPROCESSABLE ENTITY 422
2 parents c4b9d84 + fb95678 commit ea21102

File tree

16 files changed

+756
-106
lines changed

16 files changed

+756
-106
lines changed

.editorconfig

Lines changed: 439 additions & 0 deletions
Large diffs are not rendered by default.

.github/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2
2+
updates:
3+
4+
# Maintain dependencies for GitHub Actions
5+
- package-ecosystem: "github-actions"
6+
directory: "/" # Location of package manifests
7+
schedule:
8+
interval: "daily"
9+
assignees:
10+
- "NelsonBN"
11+
reviewers:
12+
- "NelsonBN"
13+
commit-message:
14+
prefix: "GitHubActions"
15+
include: "scope"
16+
target-branch: "develop"
17+
18+
# Nuget packages
19+
- package-ecosystem: "nuget"
20+
directory: "/" # Location of package manifests
21+
schedule:
22+
interval: "daily"
23+
assignees:
24+
- "NelsonBN"
25+
reviewers:
26+
- "NelsonBN"
27+
commit-message:
28+
prefix: "NuGet"
29+
include: "scope"
30+
target-branch: "develop"
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
name: CI/CD
1+
name: 'Publish Nuget'
22

33
on:
44
push:
55
branches:
66
- main
77

8+
89
jobs:
9-
build-and-deploy:
10+
11+
deploy-nuget:
12+
name: "Deploy NuGet"
1013
runs-on: ubuntu-latest
1114

1215
steps:
1316
- uses: actions/checkout@main
1417

15-
- name: Set up .NET Core
18+
- name: Setup .NET
1619
uses: actions/setup-dotnet@v1
1720
with:
18-
dotnet-version: '6.0.x'
21+
dotnet-version: '6.0.200'
1922

20-
- name: Build with dotnet
21-
run: dotnet build --configuration Release
23+
- name: Restore dependencies
24+
run: dotnet restore
2225

23-
- name: Test
24-
run: dotnet test
26+
- name: Build
27+
run: dotnet build --configuration Release
2528

2629
- name: Create the Package
2730
run: dotnet pack --configuration Release
2831

2932
- name: Publish
30-
run: dotnet nuget push "./src/bin/PowerUtils.Net.Primitives.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json
33+
run: dotnet nuget push "./src/bin/PowerUtils.Net.Primitives.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json

.github/workflows/sonarcloud.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: 'SonarCloud'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
branches:
10+
- main
11+
12+
13+
jobs:
14+
15+
sonar-scanner:
16+
name: "Sonar scanner"
17+
runs-on: windows-latest
18+
steps:
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: '6.0.200'
24+
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v3.0.0
27+
with:
28+
distribution: 'adopt'
29+
java-version: '11'
30+
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
34+
35+
- name: Cache SonarCloud packages
36+
uses: actions/cache@v2.1.7
37+
with:
38+
path: ~\sonar\cache
39+
key: ${{ runner.os }}-sonar
40+
restore-keys: ${{ runner.os }}-sonar
41+
42+
- name: Cache SonarCloud scanner
43+
id: cache-sonar-scanner
44+
uses: actions/cache@v2.1.7
45+
with:
46+
path: .\.sonar\scanner
47+
key: ${{ runner.os }}-sonar-scanner
48+
restore-keys: ${{ runner.os }}-sonar-scanner
49+
50+
- name: Install SonarCloud scanner
51+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
52+
shell: pwsh
53+
run: |
54+
New-Item -Path .\.sonar\scanner -ItemType Directory
55+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
56+
57+
- name: Build and analyze
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
60+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
61+
shell: pwsh
62+
run: |
63+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}" /o:"${{ secrets.SONAR_ORGANIZATION }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
64+
dotnet build --configuration Release
65+
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
66+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

.github/workflows/test-project.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 'Tests'
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
branches:
10+
- main
11+
12+
13+
jobs:
14+
15+
test-project:
16+
name: "Testing project"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: '6.0.200'
26+
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build --no-restore
32+
33+
- name: Test
34+
run: dotnet test --no-build

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,13 @@ $RECYCLE.BIN/
447447
##
448448
## Visual Studio Code
449449
##
450+
.vscode
450451
.vscode/*
451452
!.vscode/settings.json
452453
!.vscode/tasks.json
453454
!.vscode/launch.json
454455
!.vscode/extensions.json
456+
457+
## Sonar
458+
.sonarqube
459+
sonarscan.bat

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
4+
5+
6+
## [1.1.0] - 2022-02-25
7+
[Full Changelog](https://github.com/TechNobre/PowerUtils.Net.Primitives/compare/v1.0.0...v1.1.0)
8+
9+
10+
### New Features
11+
12+
- Added constant for Status Code UNPROCESSABLE ENTITY 422;
13+
14+
15+
### Enhancements
16+
17+
- Updated documentation;
18+
19+
20+
21+
22+
## [1.0.0] - 2021-11-21
23+
24+
- Start project

PowerUtils.Net.Primitives.sln

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,31 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{BECA00C2-6FEE-416B-BF8A-DFBFC067ED21}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1.project", "1.project", "{BECA00C2-6FEE-416B-BF8A-DFBFC067ED21}"
77
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
89
.gitignore = .gitignore
10+
CHANGELOG.md = CHANGELOG.md
911
global.json = global.json
1012
LICENSE = LICENSE
11-
.github\workflows\main.yml = .github\workflows\main.yml
1213
README.md = README.md
1314
EndProjectSection
1415
EndProject
1516
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1.PowerUtils.Net.Primitives", "src\1.PowerUtils.Net.Primitives.csproj", "{A3649905-3DE7-4BBA-BC5D-1D62089C7FFD}"
1617
EndProject
17-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2.PowerUtils.Net.Primitives.Tests", "test\2.PowerUtils.Net.Primitives.Tests.csproj", "{EACB7A09-1067-4312-B8D1-1D29897BA8D4}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2.PowerUtils.Net.Primitives.Tests", "tests\PowerUtils.Net.Primitives.Tests\2.PowerUtils.Net.Primitives.Tests.csproj", "{EACB7A09-1067-4312-B8D1-1D29897BA8D4}"
19+
EndProject
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.cicd", "2.cicd", "{2ED72909-1EFA-41DE-9E9A-BD15DB2A396B}"
21+
ProjectSection(SolutionItems) = preProject
22+
dependabot.yml = dependabot.yml
23+
publish-nuget.yml = publish-nuget.yml
24+
sonarcloud.yml = sonarcloud.yml
25+
test-project.yml = test-project.yml
26+
EndProjectSection
27+
EndProject
28+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.src", "3.src", "{6F5B2D55-69F7-43F7-8BA8-97BB4D79276D}"
29+
EndProject
30+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.tests", "4.tests", "{3B90E664-51A0-4997-B2F3-58E2931E3B03}"
1831
EndProject
1932
Global
2033
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -34,6 +47,10 @@ Global
3447
GlobalSection(SolutionProperties) = preSolution
3548
HideSolutionNode = FALSE
3649
EndGlobalSection
50+
GlobalSection(NestedProjects) = preSolution
51+
{A3649905-3DE7-4BBA-BC5D-1D62089C7FFD} = {6F5B2D55-69F7-43F7-8BA8-97BB4D79276D}
52+
{EACB7A09-1067-4312-B8D1-1D29897BA8D4} = {3B90E664-51A0-4997-B2F3-58E2931E3B03}
53+
EndGlobalSection
3754
GlobalSection(ExtensibilityGlobals) = postSolution
3855
SolutionGuid = {A48BE987-BAA5-4255-862F-32B60FD428A9}
3956
EndGlobalSection

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# PowerUtils.Net.Primitives
22
Provides additional types and constants for network-based libraries.
33

4-
![CI](https://github.com/TechNobre/PowerUtils.Net.Primitives/actions/workflows/main.yml/badge.svg)
4+
![Tests](https://github.com/TechNobre/PowerUtils.Net.Primitives/actions/workflows/test-project.yml/badge.svg)
5+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Net.Primitives&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Net.Primitives)
6+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Net.Primitives&metric=coverage)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Net.Primitives)
7+
58
[![NuGet](https://img.shields.io/nuget/v/PowerUtils.Net.Primitives.svg)](https://www.nuget.org/packages/PowerUtils.Net.Primitives)
69
[![Nuget](https://img.shields.io/nuget/dt/PowerUtils.Net.Primitives.svg)](https://www.nuget.org/packages/PowerUtils.Net.Primitives)
710
[![License: MIT](https://img.shields.io/github/license/ofpinewood/http-exceptions.svg)](https://github.com/TechNobre/PowerUtils.Net.Primitives/blob/main/LICENSE)
@@ -69,6 +72,7 @@ dotnet add package PowerUtils.Net.Primitives
6972
- `StatusCodeLink.UNSUPPORTED_MEDIA_TYPE`;
7073
- `StatusCodeLink.REQUESTED_RANGE_NOT_SATISFIABLE`;
7174
- `StatusCodeLink.EXPECTATION_FAILED`;
75+
- `StatusCodeLink.UNPROCESSABLE_ENTITY`;
7276
- `StatusCodeLink.UPGRADE_REQUIRED`;
7377
- `StatusCodeLink.INTERNAL_SERVER_ERROR`;
7478
- `StatusCodeLink.NOT_IMPLEMENTED`;
@@ -97,8 +101,6 @@ dotnet add package PowerUtils.Net.Primitives
97101

98102

99103

100-
## Release Notes
101-
104+
## Changelog
102105

103-
### v1.0.0 - 2021/11/21
104-
- Kick start project
106+
[Here](./CHANGELOG.md)

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "6.0.100"
3+
"version": "6.0.200"
44
}
55
}

0 commit comments

Comments
 (0)