HodorNV / ALOps

ALOps
59 stars 24 forks source link

Please! make a setting for showing unimportant numbers in task. #648

Open NAVFreak opened 1 year ago

NAVFreak commented 1 year ago

Is your feature request related to a problem? Please describe. The problem is that I have become fed up with trying to troubleshoot puzzles with missing bits of information. Example, my pipeline fails and I need to troubleshoot which versions of dependencies it is using (ALOps App Publish). image

Not so easy, it takes some time find out what the stars are.

Another example, I'm running the license check and gets this. image Since the assigning of license objects is done with object id:s I have to lookup the id for each object specified here instead of justing filling in the object id directly.

Describe the solution you'd like I know that the stars is not ALOps fault but a standard thing due the fact we use key vault. BUT, there is a workaround that we have implemented in our own scripts.

Rewrite the output with changing the numbers to number words: image This can be done for all none-secret values such as artifact versions, filenames, object id:s and perhaps some more.

Here is an ugly way to do it:

 foreach($file in $files) {
       $mystring = "$($file.fullname)"; $i = 0;$NewString = ''
          while($i -le ($mystring.Length - 1)){  switch($mystring.Chars($i)) {   '1' { $NewString += 'One'}; '2' { $NewString += 'Two'};    '3' { 
             $NewString += 'Three'};    '4' { $NewString += 'Four'};    '5' { $NewString += 'Five'};    '6' { $NewString += 'Six'};    '7' { $NewString += 'Seven'};    '8' { $NewString += 'Eight'};    '9' { $NewString += 'Nine'};    '0' { $NewString += 'Zero'};    default { $NewString += $mystring.Chars($i)}   }    $i += 1   }
          Write-host "$newString"
       }
waldo1001 commented 1 year ago

Hi @NAVFreak ,

Can I ask - what do you put into your keyvault - as a secret?
If you put "settings" in a keyvault - like your version - you get things like this.

We don't want to change default DevOps behavior - especially not when it comes to "secrets".

In my opinion, you shouldn't be using settings as secrets - but rather use what it's intended for.

I didn't test this, but you can try to create the value somewhat different (like with trailing asterix) and remove the unnecessary chars when you use the secret?
Or - use libraries for non-secrets?

waldo1001 commented 1 year ago

@NAVFreak ?

NAVFreak commented 1 year ago

Sorry @waldo1001 , I'm currently on my third week of five weeks vacation 😊 We store a little bit of this and that in the key vault

So it is both "real" secrets and settings. Correct me if I'm wrong but last time I checked, key vault is the only option if you would like to use "one library" for multiple azure devops projects. Meaning that there is not another way of sharing a library with data/varibales between multiple azupre devops projects.

But back to the point. We use secrets and by default then it scrambles ALL THE NUMBERS in the output for ALL JOBS. So if I run a job with no secrets it still scrambles the output of all numbers. My feature suggestion is not that dramaticall. One setting [Write numbers with words] that when used for some outputs for some jobs that is not considered "secret" will be written in words instead. Like numbers in filenames, version number in artifacts, versions of dependencies and so on.