Comment parsing and modifiers #535
Closed
opened 2023-11-14 14:21:51 +00:00 by p4u1
·
4 comments
Labels
Clear labels
abra
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
design
documentation
duplicate
enhancement
fedi
fedi-infra
finance
funding
good first issue
help wanted
installer
legal
performance
proposal
question
security
test
wontfix
Everything to do with abra
Ping/pong on comms
Something is not working
Go build related issues
Getting the robots into the mix
Opening this thing up
Contributors stuff
Our main website
Design thinking required
Let's write things together
This issue or pull request already exists
New feature
Democratic decision making
Money things
Anything related to grant funding
Easy start with development
Need some help
Installation related issues
Performance related
Large change which requires feedback & decisin making
More information is needed
Securing our shit
Unit or integration test suite
This won't be fixed
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
p4u1
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/organising#535
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Background
I'm currently investigating this failing test on the master branch:
I think this failure got introduced by
ccf0215495Proposal
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 (https://github.com/x1unix/godotenv/commit/b031ea1211e7fd297af4c7747ffb562ebe00cd33), 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).