potiuk commented on PR #31879: URL: https://github.com/apache/airflow/pull/31879#issuecomment-1591753410
Yes - it should happen automatically when you run pre-commits. In vast majority of cases the images should be automatically regenerate for you when you have pre-commit installed and you should not worry about it, just commit the changes when they are generated. Funny thing that in this case breeze it's own dog food. What happens when you run precommit is .... .... it runs breeze to generate the images of breeze commands :D There is `breeze setup regenerate-command-images` that you can use to regenerate them <img width="1401" alt="Screenshot 2023-06-14 at 19 55 31" src="https://github.com/apache/airflow/assets/595491/81ec73c1-da32-4a84-ad7f-e83fcffb61e9"> You can run it manually and generte each command selectively if you want, you can even `--force` it - because when you run the command by default it will only regenerate the images where the commands changed (new flag, description, help etc). Sometimes you need to regenerate the images with `--force` - for example I needed to do it wihen I grouped the options, because grouping the options is not included in check if "anything changed". That's the only thing that is not checked. The image for each command should be generated automatically every time any description, flag etc. changes. We know when to regenerate each command because we store hash of each command in https://github.com/apache/airflow/blob/main/images/breeze/output-commands-hash.txt and whenever we (or pre-commit) runs `breeze setup regenerate-commands` it will compare hashes stored in the file with the defiition of command that @click has and it will generate the images (and update the hasj) when it finds they are different. Technology - it's done thanks to the fact that we use rich, click and rich-click. Rich has the capability of producing screenshots from whatever it displays, click provides commands (and ability to inspect them to see if they changed), rich-cllick binds the two together. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
