Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Reformat VERSION.txt in YAML. #16

Closed
wants to merge 2 commits into from
Closed

Reformat VERSION.txt in YAML. #16

wants to merge 2 commits into from

Conversation

arnested
Copy link
Member

With this small change the format of VERSION.txt will actually be YAML.

I think that would be useful for easier parsing of the file.

@danquah, will this break something for IDA?

@xendk
Copy link
Member

xendk commented Jun 2, 2014

It's a YAML file that won't take much to break. We should look up proper YAML escaping of scalar values and pass the values through that (shouldn't be too difficult as it's only simple values). And likely change the key names.

Who do we expect will parse this file? Originally it was purely for human consumption.

@kasperg any thoughts?

@danquah
Copy link

danquah commented Jun 2, 2014

I added it originally to have a way to see which revision where deployed - it was purely for human consumption at that point, but I recall the IDA guys subsequently mentioned that they where considering having some tool inspect the file.

No matter what the contents of the file is pretty simple so any format should be somewhat human readable.

@kasperg
Copy link
Member

kasperg commented Jun 2, 2014

Agree with @xendk. If we want to go for YAML we might as well use the Symfony YAML Dumper. It should not be a problem as we already have the Symfony YAML component included in the project.

If we change this I also think we should rename the file to VERSION.yml for clarity.

@xendk
Copy link
Member

xendk commented Jun 2, 2014

YAML isn't included in Deployotron. I'm partial to creating a simple escaper rather than committing Sympony YAML. It's not like we need anything more advanced than a simple string.

@kasperg
Copy link
Member

kasperg commented Jun 2, 2014

@xendk: I mixing up Bandaid and Deployotron. My bad.

I agree with simple string escaping then.

@arnested
Copy link
Member Author

arnested commented Jun 3, 2014

I agree there could possibly be done more to really ensure the result will be valid YAML.

And I also agree that it would probably be better to renamed it to VERSION.yml (even more if this won't break existing tools / workflows).

The use case I had in mind was also adding the environment name (@prod, @stage, ...) to the file and have some Drupal module parse it and provide it for the environment_indicator module (like @troelslenda suggested on Flowdock before removing the idea again).

There is no usage of echo in deployotron anymore.

The assert could even give false positives.
@xendk
Copy link
Member

xendk commented Mar 16, 2015

So, do we add Symfony YAML, or do we grab this code: https://github.com/symfony/Yaml/blob/master/Escaper.php ?

@arnested
Copy link
Member Author

arnested commented Sep 9, 2018

Closing this -- I don't think we really care any more.

@arnested arnested closed this Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants