You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will write a first draft of this. It will be incomplete but you have to start somewhere.
Everyone: please share in the comments suggestions for areas of CUE coding style to cover. If you have an opinion, please share it - if you don’t, that’s OK.
Action definition should be define by a verb (#Build, #Push...), otherwise it should be nouns
Inlined scripts (see kubernetes for example) should be in his own file with the extension .sh.cue and in a field _<Prefix_Name>Script
We should use bash.#Run for all call to bash script (and not use raw engine.#Exec)
Architecture
We must write test in tests directory located in the directory of the package
Action definition must be split in their own file, we shouldn't have one file that export 2 actions. We can keep a clean architecture. Indeed, other definition utils to the action but be in the action's file (#Build is a good example IMO)
Policy
All public fields must be documented with explanation & example of value
At least, all basic usage of a package must be tested before being merged
I propose that packages be written so that definitions and fields are in alphabetical order. This seem to help find them fast especially when definitions have many fields, or a file has many definitions. Thoughts?
@helderco since you're currently working on CUE API improvements, can I add this to your list? It doesn't have to be a complete list. Just a starting point that we can add to over time. You have most of the context anyway, if you're not sure about certain conventions, just ask and we can bikeshed over it :)
Activity
aluzzardi commentedon Jan 7, 2022
@shykes Assigning to you for a first draft since you have the implicit policies in mind with the Europa rewrite
shykes commentedon Jan 10, 2022
I will write a first draft of this. It will be incomplete but you have to start somewhere.
Everyone: please share in the comments suggestions for areas of CUE coding style to cover. If you have an opinion, please share it - if you don’t, that’s OK.
talentedmrjones commentedon Jan 12, 2022
I suggest taking a cue from Go (sorry couldn't resist):
engine.#Build)_#inputSecret)#for schemas (may include concrete defaults)let x) for immediate block scopeTomChv commentedon Jan 13, 2022
I think it would be relevant to create definition or component to force the coding style for further europa & user definition.
Below an example, this is not what we want but it's useful to illustrate my proposal.
This is also something we did on europa
dockerpackage, with#Step.Indeed, I also agree with @talentedmrjones suggestion, and I think we should find a way to verify that our package follow a pattern.
I'm not sure it' possible because how can a program know if a file should be public or no, but it's important.
TomChv commentedon Jan 13, 2022
I'm also adding other suggestions :
Style
verb(#Build,#Push...), otherwise it should benounskubernetesfor example) should be in his own file with the extension.sh.cueand in a field_<Prefix_Name>Scriptbash.#Runfor all call to bash script (and not use rawengine.#Exec)Architecture
testsdirectory located in the directory of the package#Buildis a good example IMO)Policy
aluzzardi commentedon Jan 31, 2022
Rolled over into the next milestone
talentedmrjones commentedon Feb 11, 2022
I propose that packages be written so that definitions and fields are in alphabetical order. This seem to help find them fast especially when definitions have many fields, or a file has many definitions. Thoughts?
shykes commentedon Feb 23, 2022
@aluzzardi I think you should own this... I have opinions as you know, but I know you will take them into account, and I am becoming a bottleneck.
shykes commentedon Mar 27, 2022
@helderco since you're currently working on CUE API improvements, can I add this to your list? It doesn't have to be a complete list. Just a starting point that we can add to over time. You have most of the context anyway, if you're not sure about certain conventions, just ask and we can bikeshed over it :)