Last modified: Apr 22, 2024

Development

Cosmos DB

Querying documents in CosmosDB Use FeedResponse to retrieve all hits The documents in a collection might be stored in different partitions. When querying documents in a collection, the response will only contain documents from a single partition at a time, to retrieve your hits across all partitions you may utilize the the continuation token or the HasMoreResults property of the DocumentQuery. Avoid expensive queries CosmosDB uses indexes to find matches for the queries, if there is not value for the indexed property, all instances will have to be checked to figure out if there is a match for the query. »

Cypress

Cypress is a next generation front end open-source testing tool built for the modern web. Read more about Cypress here. Prerequisite Cypress lists the requirement for the tests here. Run the tests Cypress test project has a simple read me which describes how one can install the dependencies, start the solution and run the tests. Altinn Studio tests git clone https://github.com/Altinn/altinn-studio.git The tests on altinn studio are run from an azure devops pipeline and the results are recorded in cypress dashboard with tag: altinn-studio. »

Deployment

ci build devops pipeline pipelines Build process Build Pipelines Quality Build Building the docker image, running tests and checking code. Triggered by: Git Push Pull Request Altinn Studio and Runtime Docker Images Separate pipelines are made for Altinn Studio and Runtime. The pipeline will build and deploy the Altinn Studio Docker Image and the Runtime Docker Image to Azure Container Registry. Triggered by: Git Merge to Master Altinn Studio Release Build When the build for either Altinn Studio or Runtime is successfully ran a release build will start. »

Error flow

How to pass on error information from service to presentation layer ? We do not want the service layer to have any direct knowledge about HTTP status codes, however the controller does need to know which status code to return to the client if the service does provide a response indicating success. Currently, this is handled by the service returning a tuple if addition specification of the error is required. »

Error handling

This page is a work-in-progress. Because we do not have details on how potential errors should be shown to the users, this is only a general overview currently. More details will be added once we have a functional understanding of how users should experience errors. React components Error boundaries Error boundaries are React’s official way of handling errors that occur in a component. This functionality is available from React 16. Using this allows a component to fail without unmounting the whole application, and allows us to control how the user is exposed to unexpected errors. »

Exception handling

Exception Handling Exception handling is the act of catching an exception with the intention of handling the situation so that normal execution flow can continue. It should not be used as any part of an expected execution flow. It should also be avoided if the situation continue to be unrecoverable. .Net core provides a default middleware UseExceptionHandler that will catch exceptions and log them. You can read more about this here. »

Front-end

Getting startedGet started working with the frontend Adding components to StudioGet started making a new component available to the forms builder in Altinn Studio Developing locallyRunning the frontends locally for development Routines for developmentDescribes routines for developing frontend code for resources in the DevOps team. Creating componentsGet started creating new form components for the apps ReactGuidelines for using React in Altinn Studio ReduxGuidelines for using Redux in Altinn Studio »

General

TODO Git git add . git commit -m “” Revert local commit git reset --soft HEAD~1 Azure CLI az login --use-device-code Kubectl »