openfaas / openfaas/faas-cli

Default Function (Stack) File Name

Open
#497 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

design/review proposal
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:

  1. Should we by default use stack.yml when creating new functions instead of the function name
  2. Should we standardize and enforce the file name to become a package.json-esque project file
  3. 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 new will combine all function files into a single stack.yml including the new desired function
    • If the third point is agreed upon, the function will continue along the current usage, while introducing the faas stack command to manage the function files
    • Otherwise, files will remain untouched, and faas new will create / append to stack.yml or included file name flag

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.