From 312f8c4586229fe458dc722141943dace89f62fa Mon Sep 17 00:00:00 2001 From: Vlad Iovanov Date: Fri, 24 Jul 2020 11:01:57 +0300 Subject: [PATCH 1/2] Create 005-bash-and-ruby.md --- .../decisions/005-bash-and-ruby.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/architecture/decisions/005-bash-and-ruby.md diff --git a/doc/architecture/decisions/005-bash-and-ruby.md b/doc/architecture/decisions/005-bash-and-ruby.md new file mode 100644 index 0000000000..4a456abafd --- /dev/null +++ b/doc/architecture/decisions/005-bash-and-ruby.md @@ -0,0 +1,20 @@ +# 5. only use bash and ruby for scripting and tooling in kubecf + +Date: 2020-07-24 + +## Status + +Accepted + +## Context + +As the project grows in numbers of contributors and lines of code, we want to make sure we keep the project readable and accessible by 3d party contributors. + +## Decision + +Only use bash and ruby for scripting and tooling in the KubeCF project. +Ruby scripts should be unit-tested if possible. + +## Consequences + +Any other existing scripts should be converted to bash or ruby. From 7261feefaaa258583d4dfc3f3d26ca61b3bb06ec Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Tue, 8 Sep 2020 15:56:46 -0700 Subject: [PATCH 2/2] Expand language recommendations to templating/tooling/data formats --- .../decisions/005-bash-and-ruby.md | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/doc/architecture/decisions/005-bash-and-ruby.md b/doc/architecture/decisions/005-bash-and-ruby.md index 4a456abafd..e9c2785b35 100644 --- a/doc/architecture/decisions/005-bash-and-ruby.md +++ b/doc/architecture/decisions/005-bash-and-ruby.md @@ -1,4 +1,4 @@ -# 5. only use bash and ruby for scripting and tooling in kubecf +# 5. Limit the languages, data formats, and tools used by kubecf Date: 2020-07-24 @@ -8,12 +8,50 @@ Accepted ## Context -As the project grows in numbers of contributors and lines of code, we want to make sure we keep the project readable and accessible by 3d party contributors. +As the project grows in numbers of contributors and lines of code, we want to +make sure we keep the project readable and accessible by external contributors. + +To do this we intentionally restrict the choices in scripting languages, data +formats, and supporting tools. + +These restrictions apply not only to the kubecf.git repo, but also to +kubecf-tools.git. ## Decision -Only use bash and ruby for scripting and tooling in the KubeCF project. -Ruby scripts should be unit-tested if possible. +### Scripting Languages + +Only use bash and ruby for scripting and tooling in the KubeCF project. Ruby +scripts should be unit-tested if possible. + +### Statically Typed and/or Compiled Languages + +We do not anticipate the need to write any tooling in a compiled language. +Should this become necessary, the Go language should be choosen. + +### Templating Languages + +Using Go `text/template` based templating is preferred whenever possible. + +### Data Formats + +Configuration data should be stored in YAML or JSON format. + +### External Tools + +External tools must be available on both Linux and macOS. + +Compiled tools should ideally be available as binary downloads from their Github +releases page. + +For tools implemented via scripting languages, tools written in bash or ruby +should be preferred over tools written in other languages whenever this is +possible and functionality is not compromised. It is acceptable to use tools +implemented in other languages if no alternative in bash/ruby exists. + +The number of external dependencies should be kept low whenever possible. E.g. +instead of adding a dependency on `yq` use a combination of `ruby` and `jq` to +achieve the same results with existing dependencies. ## Consequences