Category: recordVisitors

  • RecordVisitors–packages and thanks–part 12

    Now it is time to see the outdated packages and say thanks to the people that help me created all this project. For this I install https://github.com/KrystianKolad/DotnetThx . The result is https://github.com/ignatandrei/RecordVisitors/blob/main/src/RecordVisitors/thanks.md Also,I have installed dotnet outdated tool ( new version!) to see what I should improve Also,I have installed dotnet-project-licenses to let the user…

  • RecordVisitors–Static Analysis with SonarCloud–part 11

    Now I should see if the code that I have written is enough good. One way to determine is static analysis – and sonarclould.io is open for open source. It was pretty simple to setup 1.  I have install the tool  dotnet-sonarscanner 2. Add the secrets from sonnarcloud to Github 3. Add JAVA to the…

  • RecordVisitors- Readme for Nuget–part 10

    Nuget now allow for a package to see a Markdown document. I choose to embed the readme.md file I just embed into csproj file: <ItemGroup>     <None Include=”../../../readme.md” Pack=”true” PackagePath=”\” />   </ItemGroup> <PropertyGroup> <PackageReadmeFile>readme.md</PackageReadmeFile> </PropertyGroup> I needed also to make a small modif,to remove HTML comments that were seeing into nuget $path = “../../README.md” $path =Resolve-Path…

  • RecordVisitors- BDD–part 9

    It is recommended to have tests. And better is to  see the output of the tests in some readable format . On other hand,I do not like full BDD   frameworks as SpecFlow – I think that are too overkill in order to achieve less. So – something like https://github.com/LightBDD/LightBDD seems to fit the bill. After…

  • RecordVisitors–history of urls–part 8

    Extending scope :why not record also the history  ? So – again,let the programmer choose what he wants to store https://record-visitors.readthedocs.io/en/latest/RecordVisitors/IRecordVisitorFunctions/methods/GetUrl/  and where to store : https://record-visitors.readthedocs.io/en/latest/RecordVisitors/IUsersRepository/methods/SaveHistory/ . Created also 2 new endpoints : /recordVisitors/GetUserId/{userName} /recordVisitors/UserHistory/{userId}/{dateFrom:datetime:regex(\d{{4}}-\d{{2}}-\d{{2}})}/{dateTo?} Make a default implementation of having the URL – does not start with api/,does not contain api . Make…

  • Record visitors- work on issues–part 7

    Now it is time to solve some issues  There were 12 issues written by me – you can see here: https://github.com/ignatandrei/RecordVisitors/issues?q=is%3Aissue+is%3Aclosed Between the most important: Improve readme.md with more links and explanations for potential programmer and contributors Write version in static constructor – to know about the version,if some issue occurs Added custom link  lastvisitors/minutes/{time:int}…

  • RecordVisitors – xml docs – part 6

    Now it is time to write technical documentation  – XML comments to the rescue – first,read the https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/ . Second,in order to minimize work,make the classes private / internal . See what I REALLY need to use the project – it remains some interfaces and extension methods. It was helpful putting warning as errors at…

  • RecordVisitors- NuGet–part 5

    Now it the moment to deploy to NuGet. First,we should have automatic build and deploy to NuGet with GitHub Actions.  This is pretty simple –  the yml becomes     – name: Pack run: |         cd src/RecordVisitors/         # dotnet pwsh setVersion.ps1         cd RecordVisitors         dotnet pack -o nugetPackages     – name: ‘Upload Artifact’…

  • RecordVisitors–CI –part 4

    It will be perfect for any project to have a CI to improve feedback. GitHub actions is helpful here  – just put a gitlab.yml. After few iterations,mine looks like this name: BuildAndTest on: push: branches: [ main ]   pull_request:     branches: [ main ] jobs:   build:     #runs-on: ubuntu-latest     runs-on: windows-2019    …

  • RecordVisitors–code coverage–part 3

    Now I have to do some code coverage . The easy way is to test the web application – doing an integration test. Use this as a starting point: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-5.0 I have 2 kind of tests: HappyPath  -when all is working ok – and  TestErrors  – when it is not. The code for all working…