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
The text was updated successfully, but these errors were encountered:
karunpoudel-chr
changed the title
check-azure-pipelines: doesn't support default value for boolean parameter?
check-azure-pipelines: doesn't handle default value for boolean parameter properly
Feb 29, 2024
The Azure Pipelines schema is provided by Microsoft and has numerous issues and inaccuracies.
I believe that their schema allows for "true" and "false" (the strings) in a number of cases in which "true", "false", true, false should all be allowed. I recommend trying "true" to see if Azure Pipelines and the schema are both happy with that.
I've tried to file upstream issues and even offered to help fix up their schema, and they either haven't understood me or haven't been interested in improving it. Their LSP tools simply patch over these cases by muddling the data before it goes through validation -- I can't remember the exact details, but it's nontrivial to replicate with the check-jsonschema technology stack.1
I don't think that there's an obvious improvement here, unfortunately. It's a pretty disappointing but the underlying schema is where the problem lies.
It's possible that there's some kind of hack which can be applied (like the MSFT LSP tools do), but I haven't figured that out.
Footnotes
Also, on a "pride of craftsmanship" note, I take serious issue with treating "true" and true as equivalent -- they're different values and it's a bad idea to pretend otherwise. It's impossible to scope that change down to the correct scope (what does "correct" even mean in this case?), and it's just as likely to cause harm somewhere else as it is to help here. ↩
With the last release, that rolled out to the stable docs, so for now I'm going to close this.
I'll note that I still think that there's an issue here, but I think someone would need to come up with an implementation plan before we could really consider trying to make a change. (Simply converting all bools to strings is probably not safe -- the MSFT schema is sufficiently badly behaved that I wouldn't be comfortable shipping that.)
Following
azure-pipelines.yml
although valid gives pre-commit error:gives error:
$.parameters[0].default: True is not of type 'string'
Following works (in both pre-commit and azure pipeline) but doesn't look correct to have
'true'
for booleanSetup:
The text was updated successfully, but these errors were encountered: