:
Last modified: Mar 8, 2024

Development

App template and deps

Process for updating app template and its dependencies Updating app template (Template files + depentent supporting projects) Complete changes in template Get PR approved Push alpha nugets & update reference in Altinn.Apps/AppTemplate Merge to master Complete testing of new feature Once testing is completed and successful Create new branch. Push nugets without alpha based on the branch Duplicate changes in Altinn Studio template Update nuget reference in Altinn Studio template. Updating Altinn Platform and app template Code that requires changes in platform are merged in a seperate PR The platform code must be rolled out to all environments. »

Async programming

The way our solution is built there is a large need for asynchrous functionality. It is important for the development teams to be aware of best practices as well as which antipatterns to avoid. Best Practices Async Antipatterns Keep an eye out for anti-patterns and help the team to maintain a high quality in our code base. Blocking on tasks with .Result When an asynchronous call is needed in a synchronous method, the implementation below is quite common. »

Azure DevOps

We use Azure DevOps for building and deploying both our solution and the app owners applications. PipelinesQuality checklist and overview of pipelines in Azure DevOps »

Back-end

App template and depsGuidelines for working with the app template and its dependencies Async programmingGuidelines for asynchronous programming Error flow Exception handlingGuidelines for exception handling in backend logic. LoggingGuidelines logging in backend NuGet PackageHow to work with NuGet packages in Altinn SwaggerGuidelines for setting up swagger »

Best practice for PostgreSQL

Introduction This is a work-in-progress. Reader discretion is adviced! Client library Use the newest Npgsql library - ref documentation for nuget package and recommended use. Make sure to use NpgsqlDataSource that was introduced in Npgsql 7.0. Configure npgsql with DI as described here (missing in the standard docs at the time of writing). Commands (Npgsql) Do not concatenate User-Defined types as strings into the SQL commands. (SQL injection preventation) Parameters Use parameters instead of embedding values in the SQL. »

Best practices

Altinn.studio best practices will be updated with more and better practices ;) Best practices Simple lists should be sorted alphabetically Form components (app-frontend) Form components (src/components) should, whenever possible, be “dumb” components that receive all their input from props. They should not have a direct connection to the store, and should not know anything about the store. Sagas All logic used in a saga should be an exported function in the utils-folder. »

Cheat Sheet

GIT git clone repourl git Docker docker ps to list all running docker containers. AKS kubectl get pods list all pods in current cluster kubectl -n default logs -f deployment/altinn-storage --all-containers=True - get logs for all components of the same deployment kubectl describe pod [pod name] describes current state and lists environment variables for a given pod kubectl delete pod [pod name] deletes a pod and a new pod of the same deployment will start »

Component Library

WARNING: Component library will be documented when the task is done. Summary All shared components are to be documented in Markdown with inline JSX. All shared components shall have a corresponding component.md file in the same directory. The shared component must hava a default export function AND also exporting the rendered function. React Styleguidist is used to build the documentation site. The Component Library is currently a local dev server Running dev server “yarn run styleguide” from src\react-apps\applications\shared »