Skip to content

Provide a consistent developer experience for all function templates #572

Description

@omerbensaadon

Context

During the user interviews, we noticed there is a lot of variance between the templates of each language, and there are some issues with the templates as a whole. Namely, we need to...

  • Effectively highlight where the developer inserts their code (//CAN'T MISS COMMENT + Method at the top)
  • Make sure the code is effectively commented to assist in developer's understanding of said code
  • Make sure the template returns some value ("Hello World!" + message payload) when it is pinged

Story

As Deandra the Developer
I want to better understand how func templates work
So that I can better leverage the templates for my personal needs

Acceptance Criteria

  • Effectively highlight where the developer inserts their code, where the code handles incoming data
GIVEN I have created a new func project 
WHEN I inspect the "main" file (func.py. index.js, handler.go) 
THEN I see that the method for handling incoming data is listed as the first method 
AND THEN I see a comment within the method which makes it clear where I would put my business logic
  • Go
  • Node.js
  • Python
  • Quarkus
  • Rust
  • Springboot
  • TypeScript

The comment within the method should be something to the effect of: //YOUR CODE GOES HERE


  • Make sure code is effectively commented to assist in developer's understanding
GIVEN I have created a new func project 
WHEN I inspect the "main" file (func.py. index.js, handler.go) 
THEN I see that each method within the "main" file is effectively commented
AND THEN I see that each line is commented with an explanation of what that line does
  • Go
  • Node.js
  • Python
  • Quarkus
  • Rust
  • Springboot
  • TypeScript

  • Make sure the templates return similar data when invoked
GIVEN I have created a new func project 
AND GIVEN I have built and am currently running the project without any changes
WHEN I invoke the endpoint where the function is running locally using `func invoke`
THEN I see that the currently running function has returned the raw data which was sent to it

AND THEN on a new line, I see that the method returns "Hello from func!"
(Removed from acceptance criteria)

  • Go
  • Node.js
  • Python
  • Quarkus
  • Rust
  • Springboot
  • TypeScript

  • All templates come out of the box with unit tests
GIVEN I have created a new func project
WHEN I use tools appropriate for the runtime to run tests on a project
THEN I can successfully execute unit tests on my function
  • Go
  • Node.js
  • Python
  • Quarkus
  • Rust
  • Springboot
  • TypeScript

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions