-
Notifications
You must be signed in to change notification settings - Fork 124
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
feature: allow bots to have hyphens in google cloud functions #218
Conversation
Thanks for doing this! Just for my own clarification: this change (which removes the replacement of '-' with '_' in folder names) will make it so that future bots will be able to export their functions in the manner you provided above? As far as I can tell, this would break other bots like |
@@ -43,9 +43,6 @@ for f in *; do | |||
( | |||
cd "$f" || exit 1 | |||
echo "$f" | |||
# Javascript does not allow function names with '-' so we need to | |||
# replace the directory name (which might have '-') with "_" | |||
functionname=${f//-/_} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without functionname
set, this will cause the gcloud functions deploy "$functionname"...
to fail a few lines down, perhaps replace with functionname=${f}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in my comment, thank you for working on making this a much easier to use repo!
As far as I can tell, this would break other bots like conventional-commit-lint
as there is now a discrepancy between the folder name (and therefore the function's name) and the exported function name, correct?
@bcoe Either that or we move everything at once (fixing the function names in the process) The problem with that is it would change the URL that the bots can be found at, and would then necessitate someone to fix the GitHub Application to point to the correct URL |
@sofisl I think we're going to need to figure out a migration strategy for the culprit bots before we land this, or we're going to break quite a few things. |
closing with tracking issue: #242 |
Related to Issue #177: after doing some digging with @bcoe, we found out that you can publish a Google Cloud function with a hyphen. I'm recommending we make the change in this PR to provide naming consistency in the bots we create and deploy to GCF. In generate-bot, I've changed the logic so that module.exports can export a function with a hyphen, like so:
`
which should work.