You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+37-3Lines changed: 37 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,12 @@ If you have an idea of how to improve the project, please create a [new issue](h
16
16
17
17
Do you want to provide a bug fix or an inprovement? Great! :tada:
18
18
19
-
Before opening a pull request, make sure that there is a related issue. The issue helps to confirm that the behavior is unexpected, or the idea of the improvement is valid. (Following the rule "Talk, then code")
19
+
Before you start coding, make sure that there is a related issue. The issue helps to confirm that the behavior is unexpected, or the idea of the improvement is valid. (Following the rule "Talk, then code")
20
20
21
-
In order to verify that you don't break anything, you should build the whole project and run all tests. This also apply the code formatting.
21
+
Before you open a pull request:
22
+
* Make sure that you write new tests for the changed behavior
23
+
* Run all tests to verify you don't break anything
24
+
* Build the project with Maven to format the code
22
25
23
26
## Building the project from source
24
27
@@ -66,6 +69,37 @@ Available commit types:
66
69
*`build` - changes to the build (e.g. to Maven's `pom.xml`)
67
70
*`ci` - changes to the CI (e.g. to GitHub-related configs)
68
71
72
+
## Guide for common contributions
73
+
74
+
If you're new and want to contribute to the project, check out the following step-by-step guides for common contributions.
75
+
76
+
### Adding a new built-in function
77
+
78
+
The built-in functions are grouped by their main argument type, following the DMN specification.
79
+
80
+
Example: Add a new string function `reverse(value: string): string`
81
+
82
+
* Implement the function in [StringBuiltinFunctions.scala](src/main/scala/org/camunda/feel/impl/builtin/StringBuiltinFunctions.scala)
83
+
* Add a new private method `reverseFunction` and use the method `builtinFunction()`
84
+
*`params` returns the argument list: `params = List("value")`
85
+
*`invoke` is called when the function is invoked
86
+
* It uses pattern-matching for the function parameters, the parameter order is the same in the argument list: `invoke = { case List(ValString(value)) => ??? }`
87
+
* Return the function result `ValString(value.reverse)`
88
+
* If the function can't return a successful result, return `ValError("something went wrong")` instead
89
+
* Verify the behavior by writing test cases in [BuiltinStringFunctionsTest.scala](src/test/scala/org/camunda/feel/impl/builtin/BuiltinStringFunctionsTest.scala)
90
+
* Add a new test case following the pattern: `"A reverse() function" should "return a string in reverse order" in { ??? }`
91
+
* Add more test cases for other results, alternative parameters, or covering edge cases
92
+
* Group all test cases for a method using `it should "return null if the argument is not a string" in { ??? }`
93
+
* Add one test case that invokes the function with named arguments: `reverse(value: "adnumac")`
94
+
* Run all tests to verify the behavior
95
+
* Run the Maven build to format the code
96
+
* Open a pull request and link to the FEEL issue
97
+
* Then, document the function in the [Camunda docs](https://docs.camunda.io/docs/next/components/modeler/feel/builtin-functions/feel-built-in-functions-introduction/)
98
+
* Navigate to the page [String functions](https://docs.camunda.io/docs/next/components/modeler/feel/builtin-functions/feel-built-in-functions-string/)
99
+
* Click on `Edit this page` at the bottom
100
+
* Add the function to the page, describe the behavior, and provide a few examples
101
+
* Open a pull request and link to the FEEL issue and your pull request
102
+
69
103
## Public API and backward compatibility
70
104
71
105
The FEEL engine is integrated into Camunda 7 and Camunda 8. It's important to keep the public API stable and stay backward compatible to avoid breaking the integration in Camunda 7/8 or the userspace (i.e. the application that uses FEEL expressions).
@@ -91,7 +125,7 @@ Technically:
91
125
* The engine behavior is verified by the unit tests
92
126
* The supported environments are checked via GibHub actions
93
127
94
-
Any change or violation of the above must be accepted by the maintainers of Camunda 7 and Camunda 8 to avoid that a team/product getting "locked out".
128
+
Any change or violation of the above must be accepted by the maintainers of Camunda 7 and Camunda 8 to avoid a team/product getting "locked out".
0 commit comments