-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow placeholder in tags #23
Comments
@bomgar do you still need this? |
yes. because i have to specify a go tag per github group. with a placehoder that won't be nescessary |
Hmm ok but the workspace path is dependent on the git repo in the golang case. If you have to specifiy the github org in the project instead of setting the org tag then you've gained nothing. So we have to look into not just placeholders but some actual string processing magic I guess (python, lua?).
We could try to compute the github org and offer that as a placeholder (`$GITHUB_ORG`) but that seems awfully specific for a placeholder given that git urls are not guaranteed to be github ones
… On 5. May 2017, at 18:48, Patrick Haun ***@***.***> wrote:
yes. because i have to specify a go tag per github group. with a placehoder that won't be nescessary
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@bomgar now that you have integrated lua in fblog I think we could consider doing that here too. Spawn a lua func with all sorts of stuff as locals and use the value produced by the func as result. Maybe this could look like
Performance might become an actual concern because we have to evaluate most of the config greedily on load (to ensure sanity for instance) |
I don't think using an embedded interpreter is necessary here. # using bash
override_path = "/bin/sh: echo ${repo_name,,}"
# using lua
override_path = '/usr/bin/lua: print(strlower(os.getenv("repo_name")))' These would both return the name of the repo to lower case. Maybe we could also use a shebang like syntax for this, and then write the script to a file in # using bash
override_path = '''
#!/bin/sh
echo ${repo_name,,}
'''
# using lua
override_path = '''
#!/usr/bin/lua
print(strlower(os.getenv("repo_name")))
''' |
I'm not convinced executing arbitrary code is a good thing here. Maybe a template language like handlebars would be sufficient. But I'm not sure yet. |
Well, a template language would still not allow complicated operations, such as lower casing a string, or converting from camel case to snake_case for example (unless we manually add those functions, but we can't cover everything). Besides that, the proposed lua functionality would also allow executing arbitrary code unless it's sandboxed. I also don't really see a security concern here, as this is a user's personal config which should be trusted. |
Embedded lua would be fine I guess. Calling external processes adds a lot of complexity to everything and is harder to implement. |
Would help a lot to set
override-path
for go projectsThe text was updated successfully, but these errors were encountered: