From 2a234445f1c669b39a10a1d04178c0bea0f2dd24 Mon Sep 17 00:00:00 2001 From: Omprakash Mishra Date: Sun, 23 Jun 2024 00:24:55 +0000 Subject: [PATCH] Adding or updating the confluence pages --- .../Coding Patterns & Practices/Coding Patterns & Practices.md | 2 +- patterns/docs/Coding Patterns & Practices/data.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patterns/docs/Coding Patterns & Practices/Coding Patterns & Practices.md b/patterns/docs/Coding Patterns & Practices/Coding Patterns & Practices.md index f61e54e..a294333 100644 --- a/patterns/docs/Coding Patterns & Practices/Coding Patterns & Practices.md +++ b/patterns/docs/Coding Patterns & Practices/Coding Patterns & Practices.md @@ -91,7 +91,7 @@ GitHub PRs - Commits PR Review and Practices ======================= -* PR titles should follow conventional commit. +* PR titles should follow conventional commit (eg. [https://www.conventionalcommits.org/en/v1.0.0/](https://www.conventionalcommits.org/en/v1.0.0/)). * Branches should also follow a similar pattern (eg. feat/$featurename) * A single PR should be for a single Feature/bug/hotfix/patch/etc and kept as small as possible and reasonable * Add appropriate labels established by your team. (eg. Adding labels to also indicate the applications being impacted by the PR, for instance, "web" or "API") diff --git a/patterns/docs/Coding Patterns & Practices/data.json b/patterns/docs/Coding Patterns & Practices/data.json index a752136..c922e6d 100644 --- a/patterns/docs/Coding Patterns & Practices/data.json +++ b/patterns/docs/Coding Patterns & Practices/data.json @@ -1 +1 @@ -{"id":"160074735","type":"page","status":"current","title":"Coding Patterns & Practices","body":{"storage":{"value":"
Status

GreenPublished 

Overview

The purpose of this page is to outline some coding practices when developing an application. Practices used by a team should be documented in the repository.

Languages Supported

Currently, most agile teams use one of these 4 languages and it is encouraged to stay within these languages, it may expand in the future. ( Typescript/JavaScript, Java On Native, Python, Go)

Native Deployments

Some Languages are interpreted by their runtime ex:(java on JVM, python, javascript, etc..) whereas some languages are compiled (Golang, Rust).

Use native(static binary) deployments wherever available. for ex: it is a MUST for teams using Java to deploy using GraalVM native image without the overhead of JVM interpreter. 

Focus on the scale-out vs scale-up as deployments are into containers or serverless.

Code Design Patterns and Principles

Folder Structure and Naming Conventions

Secret and Environment Variable Handling

Secure APIs

Error Handling


Code Formatters and Plugins

Infrastructure as Code

Pipeline

Align your CI/CD pipeline with your hosting environment (GitHub Actions for Openshift Silver/Gold, GitHub Actions with ArgoCD for Openshift Emerald, GiHub Actions with Terraform for AWS)

The below was created using the QuickStart OpenShift as a reference. Please refer to the repo for the most up to date information.

trueBranching Strategyfalseautotoptrue10111

GitHub PRs - Commits

PR Review and Practices

Dependency Management

API framework evaluation factors

The below outlines a few key considerations which would help in the decision-making of language/framework to use for API development for containerized environments.

Details around API Design are outlined here(https://developer.gov.bc.ca/Data-and-APIs/BC-Government-API-Guidelines). The below points are on top of the guidelines provided in the link.

  1. Developer friendly, community support and libraries.
  2. Resource Consumption(memory/CPU) the less the better, supports the move towards green computing.
  3. Automated Open API 3 Specification generation, Swagger UI.
  4. Automated DB schema management (flyway/Liquibase or something similar).
  5. ORM integration for Database, ACID, Transaction support, Nested Transactions, Advanced Query with pagination, filter, sorting support.
  6. Supports TDD(Test Driven Development) out of the box, which supports unit and integration testing.
  7. Easiness of testing for pipelines and other automation.
  8. Easiness of OAUTH2 integration.
  9. Easiness of Circuit breaker integration and Resiliency.
  10. API versioning.
  11. Support for REST, GraphQL and gRPC
  12. Asynchronous REST Client.
  13. API Health checks(for liveness/readiness checks in Kubernetes world) out of the box which includes checking DB Connections and Message Broker connection (If present).
  14. Easiness of writing to log files in different formats.
  15. Switching Between Relational Database should be config only.
  16. Easy Concurrency.
  17. Easiness of Integration with Distributed tracing frameworks.




","representation":"storage","_expandable":{"content":"/rest/api/content/160074735"}},"_expandable":{"editor":"","view":"","export_view":"","styled_view":"","anonymous_export_view":""}},"extensions":{"position":9},"_links":{"webui":"/pages/viewpage.action?pageId=160074735","edit":"/pages/resumedraft.action?draftId=160074735","tinyui":"/x/74uKCQ","collection":"/rest/api/content","base":"https://apps.nrs.gov.bc.ca/int/confluence","context":"/int/confluence","self":"https://apps.nrs.gov.bc.ca/int/confluence/rest/api/content/160074735"},"_expandable":{"container":"/rest/api/space/AR","metadata":"","operations":"","children":"/rest/api/content/160074735/child","restrictions":"/rest/api/content/160074735/restriction/byOperation","history":"/rest/api/content/160074735/history","ancestors":"","version":"","descendants":"/rest/api/content/160074735/descendant","space":"/rest/api/space/AR"}} \ No newline at end of file +{"id":"160074735","type":"page","status":"current","title":"Coding Patterns & Practices","body":{"storage":{"value":"
Status

GreenPublished 

Overview

The purpose of this page is to outline some coding practices when developing an application. Practices used by a team should be documented in the repository.

Languages Supported

Currently, most agile teams use one of these 4 languages and it is encouraged to stay within these languages, it may expand in the future. ( Typescript/JavaScript, Java On Native, Python, Go)

Native Deployments

Some Languages are interpreted by their runtime ex:(java on JVM, python, javascript, etc..) whereas some languages are compiled (Golang, Rust).

Use native(static binary) deployments wherever available. for ex: it is a MUST for teams using Java to deploy using GraalVM native image without the overhead of JVM interpreter. 

Focus on the scale-out vs scale-up as deployments are into containers or serverless.

Code Design Patterns and Principles

Folder Structure and Naming Conventions

Secret and Environment Variable Handling

Secure APIs

Error Handling


Code Formatters and Plugins

Infrastructure as Code

Pipeline

Align your CI/CD pipeline with your hosting environment (GitHub Actions for Openshift Silver/Gold, GitHub Actions with ArgoCD for Openshift Emerald, GiHub Actions with Terraform for AWS)

The below was created using the QuickStart OpenShift as a reference. Please refer to the repo for the most up to date information.

trueBranching Strategyfalseautotoptrue10111

GitHub PRs - Commits

PR Review and Practices

Dependency Management

API framework evaluation factors

The below outlines a few key considerations which would help in the decision-making of language/framework to use for API development for containerized environments.

Details around API Design are outlined here(https://developer.gov.bc.ca/Data-and-APIs/BC-Government-API-Guidelines). The below points are on top of the guidelines provided in the link.

  1. Developer friendly, community support and libraries.
  2. Resource Consumption(memory/CPU) the less the better, supports the move towards green computing.
  3. Automated Open API 3 Specification generation, Swagger UI.
  4. Automated DB schema management (flyway/Liquibase or something similar).
  5. ORM integration for Database, ACID, Transaction support, Nested Transactions, Advanced Query with pagination, filter, sorting support.
  6. Supports TDD(Test Driven Development) out of the box, which supports unit and integration testing.
  7. Easiness of testing for pipelines and other automation.
  8. Easiness of OAUTH2 integration.
  9. Easiness of Circuit breaker integration and Resiliency.
  10. API versioning.
  11. Support for REST, GraphQL and gRPC
  12. Asynchronous REST Client.
  13. API Health checks(for liveness/readiness checks in Kubernetes world) out of the box which includes checking DB Connections and Message Broker connection (If present).
  14. Easiness of writing to log files in different formats.
  15. Switching Between Relational Database should be config only.
  16. Easy Concurrency.
  17. Easiness of Integration with Distributed tracing frameworks.




","representation":"storage","_expandable":{"content":"/rest/api/content/160074735"}},"_expandable":{"editor":"","view":"","export_view":"","styled_view":"","anonymous_export_view":""}},"extensions":{"position":9},"_links":{"webui":"/pages/viewpage.action?pageId=160074735","edit":"/pages/resumedraft.action?draftId=160074735","tinyui":"/x/74uKCQ","collection":"/rest/api/content","base":"https://apps.nrs.gov.bc.ca/int/confluence","context":"/int/confluence","self":"https://apps.nrs.gov.bc.ca/int/confluence/rest/api/content/160074735"},"_expandable":{"container":"/rest/api/space/AR","metadata":"","operations":"","children":"/rest/api/content/160074735/child","restrictions":"/rest/api/content/160074735/restriction/byOperation","history":"/rest/api/content/160074735/history","ancestors":"","version":"","descendants":"/rest/api/content/160074735/descendant","space":"/rest/api/space/AR"}} \ No newline at end of file