-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Misc project cleanup - props, editorconfig, refactorings, docs (#661)
- Loading branch information
1 parent
c36fc35
commit f1ed934
Showing
482 changed files
with
23,949 additions
and
24,873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# How to contribute | ||
|
||
Developer documentation for Altinn.App .NET libraries. | ||
|
||
Here are some important resources: | ||
|
||
* [Team Apps Github board](https://github.com/orgs/Altinn/projects/39/views/2) | ||
* [Altinn Studio docs](https://docs.altinn.studio/) | ||
|
||
## Reporting Issues | ||
|
||
Open [our Github issue tracker](https://github.com/Altinn/app-lib-dotnet/issues/new/choose) | ||
and choose an appropriate issue template. | ||
|
||
Feel free to query existing issues before creating a new one. | ||
|
||
## Contributing Changes | ||
|
||
* Fork and/or create branch | ||
* Push changes | ||
* Test your changes, see the testing changes below | ||
* Create PR - fill in the required sections | ||
* Try to provide reasoning/rationale for the changes if it hasn't already been discussed | ||
* Attach appropriate tags according to the change (`feature`, `kind/feature-request`, `bugfix`, `kind/bug`, `kind/chore`) | ||
* If you work on team Apps, attach the `Team Apps` project, add it to a sprint and input an estimate (if an issue isn't already added) | ||
* Make sure coding style is consistent | ||
* Csharpier for formatting (`editor.formatOnSave` is on by default, there should be an extension for your editor/IDE) | ||
* EditorConfig is configured, you should use an editor or IDE that supports it (that should cover other conventions) | ||
* We require 1 approval to merge changes | ||
* Make sure Sonar / CodeQL and other static analysis issues are resolved | ||
* We don't need 100% code coverage, effort and risk must be weighed | ||
* Use squash merge | ||
* Use a descriptive PR title, as it is used for release notes generation | ||
|
||
### Versioning | ||
|
||
We use semantic versioning. So we avoid breaking changes for anything that might break builds or change behavior. | ||
|
||
### Telemetry | ||
|
||
The Altinn app libraries are instrumented with `System.Diagnostics`, and telemetry is shipped via OpenTelemetry. | ||
When developing new features and code, failure modes should be considered carefully, and telemetry should be added | ||
such that we can observe that the code works correctly when running locally and in test and production environments. | ||
See existing code for tips and clues. | ||
|
||
Parts of the telemetry is considered public contract. | ||
Consumers may build alerting and dashboards based on this telemetry, so if we change names and tags | ||
that may break things downstream. Names and tags are in the `Telemetry` class. | ||
|
||
### Testing | ||
|
||
We have automated tests in the `test/` folder using mainly xUnit, FluentAssertions, Moq and Verify. | ||
Some tests invoke classes directly (while mocking dependencies as needed), | ||
while some construct adhoc DI containers or use ASP.NET Core `WebApplicationFactory<>`. | ||
The following resources are currently snapshot tested (some with Verify) | ||
|
||
* OpenAPI doc | ||
* Telemetry output (activities/spans and metrics) | ||
|
||
In addition to automated testing, we should do manual tests for any non-trivial change as well. | ||
|
||
#### Manual testing | ||
|
||
To manually test changes, simply make your app reference the libraries directly. See the diff below, | ||
and make sure the relative directory paths work for your setup. | ||
|
||
```csproj | ||
<!-- <PackageReference Include="Altinn.App.Api" Version="8.2.*"> | ||
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory> | ||
</PackageReference> | ||
<PackageReference Include="Altinn.App.Core" Version="8.2.*" /> --> | ||
<ProjectReference Include="../../../app-lib-dotnet/src/Altinn.App.Api/Altinn.App.Api.csproj"> | ||
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory> | ||
</ProjectReference> | ||
<ProjectReference Include="../../../app-lib-dotnet/src/Altinn.App.Core/Altinn.App.Core.csproj" /> | ||
``` | ||
|
||
Make sure [localtest](https://github.com/Altinn/app-localtest) is running | ||
Run your app | ||
|
||
```shell | ||
dotnet run --project App/ | ||
``` | ||
|
||
To debug changes in the libraries, you can | ||
|
||
* Add the `altinn-lib-donet/src` projects to your apps `App.sln` file | ||
* Create a `code-workspace` file in the case of VSCode | ||
|
||
Debug breakpoints should then work as normal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<Project> | ||
<PropertyGroup Condition="'$(DOTNET_TREATWARNINGSASERRORS)' == 'true' OR '$(CI)' == 'true'"> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(DOTNET_TREATWARNINGSASERRORS)' == 'true' OR '$(CI)' == 'true'"> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
<AnalysisMode>Minimum</AnalysisMode> | ||
<Features>strict</Features> | ||
<!-- <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors> --> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
<AnalysisMode>Minimum</AnalysisMode> | ||
<Features>strict</Features> | ||
<!-- <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors> --> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CSharpier.MsBuild" Version="0.28.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> | ||
<ItemGroup> | ||
<PackageReference Include="CSharpier.MsBuild" Version="0.28.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2017, Altinn | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of Altinn nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
# app-template-dotnet | ||
Altinn application template using .NET 6 | ||
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Altinn/app-lib-dotnet/dotnet-test.yml?branch=main)](https://github.com/Altinn/app-lib-dotnet/actions) | ||
[![GitHub](https://img.shields.io/github/license/Altinn/app-lib-dotnet?style=flat-square)](https://github.com/Altinn/app-lib-dotnet/blob/main/LICENSE)<br/> | ||
|
||
[![NuGet / Altinn.App.Core](https://img.shields.io/nuget/v/Altinn.App.Core?label=Altinn.App.Core)](https://www.nuget.org/packages/Altinn.App.Core) | ||
[![NuGet / Altinn.App.Api](https://img.shields.io/nuget/v/Altinn.App.Api?label=Altinn.App.Api)](https://www.nuget.org/packages/Altinn.App.Api) | ||
|
||
## Goal for template | ||
# Altinn.App .NET libraries | ||
|
||
The goal for this template is to give application owners using Altinn Studio a application template that covers common functional and technical needs. | ||
Altinn.App .NET libraries for apps running on Altinn 3, part of the [Altinn Studio product](https://docs.altinn.studio/altinn-studio/about/). | ||
|
||
- BPMN Process Support | ||
- Api for app-frontend and end user system | ||
These libraries support the runtime of Altinn apps by | ||
|
||
* Exposing APIs used by service owners and the [frontend (app-frontend-react)](https://github.com/Altinn/app-frontend-react) of an Altinn app | ||
* Exposing abstractions to interact with features of Altinn Studio and Altinn 3 Platform services | ||
|
||
## Contributing | ||
|
||
See [/CONTRIBUTING.md](/CONTRIBUTING.md). | ||
|
||
## Architecture | ||
|
||
This template is built using .NET | ||
|
||
The below diagram shows the different layers. | ||
The below diagram shows the different layers. | ||
|
||
|
||
![Template](https://raw.githubusercontent.com/Altinn/app-template-dotnet/main/apptemplate.drawio.svg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.