Comment parsing and modifiers #535
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
I'm currently investigating this failing test on the master branch:
I think this failure got introduced by
ccf0215495
Proposal
While trying to fix this issue, i was not sure what the desired behaviour actually was. Here is a proposal, of how comment parsing could work in config env files:
About a possible implementation
We currently use a fork (https://github.com/Autonomic-Cooperative/godotenv) of the godotenv library. In this fork inline comment removal got removed (
b031ea1211
), probably to be able to implement modifiers. To implement proper comment parsing and modifiers, I think its best to either implement this in the fork or inline the library to abra (I would prefer this)also reported in coop-cloud/organising#524
Bumped up to "Critical fixes" and mentioned on the fedi channel. Think this needs some work to fix up ASAP.
Agree with your table listing @p4u1, that's the intended functionality as far as I understand.
I was looking at another library coop-cloud/organising#459 at some point for re-using instead of maintaining the fork. Whcih is now probably even broken? I'm not sure as that was definitely a hack on top of the comment parsing.
Hopefully someone can pick this up soon.
@knoflook thanks for the hotfix. i'd have preferred if you'd pinged us on the matrix channels or raised an issue that you're pushing it tho, would have saved the puzzling as to why the test suite is broken. for next time...
I can work on this in the next days. Will have a look at the library you linked and will also look for some other libraries. But I'm pretty certain, that we need a custom library for this custom behavior.
Thanks!
I think actually this needs to be fixed before coop-cloud/organising#464 can be fixed. The hotfix is borking the ability of other code to strip or include modifiers. Which I think highlights the code smell that the modifiers are not parsed immediately at load time, they are passed in strings until a later time (
config.ReadEnvOptions{...}
) 😬For #464, we need a single function that can read the recipe config (all compose files, see
ReadSecretsConfig
), parse modifiers etc. and give back a struct with the secret ID (the key in the compose secret config), secret name (all comments stripped) and secret version struct (with modifiers parsed).