Default Function (Stack) File Name
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 816
- Forks
- 230
- Avg merge
- 6h 4m
- Merged PRs (30d)
- 1
Description
There are multiple points in our documentation where we either ask the user to change the function file name to stack.yml or just basically reference the function file as stack.yml despite it not always being called that. It seems that we are heading in the direction while OpenFaaS is growing to begin enforcing a standard file name. This brings up the following discussion points to consider:
- Should we by default use
stack.ymlwhen creating new functions instead of the function name - Should we standardize and enforce the file name to become a
package.json-esque project file - Should we introduce an additional command to deal with function stacks
With regards to the first point, by doing this we also bring up the potential to eliminate the --append flag. By eliminating this flag and continuing to disallow duplicate function names, a more efficient flow is allowed by reducing the verbosity of the commands and eliminating user interference of file renaming. In addition, -f/ --yaml flag will be used to choose the file name for creating / appending to.
For the second point, the benefit of this would be more control over build consistency as the project grows. An alternative to this could be allowing the user to provide the file name other than stack.yml.
The third point references a suggestion brought up by @burtonr. His suggestion was to include a command (ex. faas stack) that would work with the multiple function files, and be able to combine / split them as needed. This is more of a tool expansion than the reduction that I was suggesting, but offers additional flexibility for the user such as the following: renaming the function file as suggested in the documentation, and handling multiple stack files in the same directory.
Impact Considerations
- If my current directory contains multiple function files, how will the following change(s) handle it?
- If the second point is agreed upon,
faas newwill combine all function files into a singlestack.ymlincluding the new desired function - If the third point is agreed upon, the function will continue along the current usage, while introducing the
faas stackcommand to manage the function files - Otherwise, files will remain untouched, and
faas newwill create / append tostack.ymlor included file name flag
- If the second point is agreed upon,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked function-name documentation and the current faas new workflow, including --append and -f/--yaml. Compare the three proposed approaches and their multiple-file impact; done requires an agreed direction and an explicitly defined behavior for creating, appending, or managing function stack files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100