Extensibility: Command Hooks lib components#1236
Conversation
5d9c03d to
315f2c8
Compare
cli/azd/pkg/ext/models.go
Outdated
| // When running on windows use this override config | ||
| Windows *ScriptConfig `yaml:"windows,omitempty"` | ||
| // When running on linux/macos use this override config | ||
| Linux *ScriptConfig `yaml:"linux,omitempty"` |
There was a problem hiding this comment.
If you wanted the same script to run on both OSes than you would only configure the top level ScriptConfig and ensure your script is compatible with all your environments. You would not have to duplicate the config for both windows & linxux. The OS specific configurations are only for overrides when needed.
There was a problem hiding this comment.
No issues with overall approach. Love the OS specific config, and the ability to do things implicit conventionally and also explicit configuration.
Left some notes on models.go about if we should simplify inline vs. path, and also whether Interactive is a good idea if we can lead to confusing invisible prompts. Some minor comments on implementation details, but otherwise everything looks good.
bfc226d to
424eb4a
Compare
424eb4a to
36117a6
Compare
ellismg
left a comment
There was a problem hiding this comment.
I want to push back a little on the implicit hooks stuff. I'm not 100% sure what the use case is here (given that we encourage folks /not/ to check in the .azure folder) and I think it's existence is going to raise a lot of questions we don't want to have raised right now.
Are there cases where this is helpful vs the inline scripts and things defined explicitly in azure.yaml?
If we do want to keep this - I think we need to take a step back and think about how we want to structure the .azure folder. As is, right now we have assumptions baked into the system that the directories under the .azure folder are environments (see AzdContext::ListEnvironments for example) and we would need to adopt that. I think as we might have an issue if you ever tried to create an environment called "hooks" and also this hooks thing will show up in azd env list
I'm happy to simplify for the the time being and get some feedback from the community before rolling the |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSIContainerDocumentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference (preview)
|
|
/check-enforcer evaluate |
|
Check Enforcer evaluate was requested, but no Azure Pipelines or Github Actions have been triggered for the changed files. If you are initializing a new service, follow the new service docs. If no Azure Pipelines are desired, run For help using check enforcer, see https://aka.ms/azsdk/checkenforcer |
Adds command hook library components (Not wired up for e2e use)
Related to #1253
Included Features
preandpostcommand hooksbashandpowershellscriptsazure.yamlSupport for implicit hooks based on script files existing within the.azure/hooksdirectoryWindowsandLinuxQuestions
LinuxtoPosixor something else to denote that it applies for both?