Skip to content

feat(function): send function result#27

Merged
k1LoW merged 1 commit intomainfrom
feat/function/2025-10-21-send-result
Oct 21, 2025
Merged

feat(function): send function result#27
k1LoW merged 1 commit intomainfrom
feat/function/2025-10-21-send-result

Conversation

@jackchuka
Copy link
Copy Markdown
Collaborator

@jackchuka jackchuka commented Oct 21, 2025

Overview

This pull request introduces an enhancement to how function execution results are handled and displayed in the tailor/function.go file. The main change is the addition of logic to parse and present execution results as JSON when possible, improving the clarity of log outputs. Additionally, a minor typo fix improves code consistency.

Function execution result handling:

  • Added logic to parse exec.Result as JSON if it is a valid JSON string, ensuring structured results are included in log attributes for easier consumption.
  • Included the parsed or raw result as the "tailor_platform.function.result" attribute in log output items.
  • Imported the encoding/json package to support JSON parsing.

Code consistency and typo fixes:

  • Fixed a typo in the constant name from SourceFuncitonUnspecified to SourceFunctionUnspecified throughout the file for consistency and correctness. [1] [2]

Example

Screenshot 2025-10-21 at 15 24 19

@github-actions
Copy link
Copy Markdown
Contributor

Code Metrics Report

main (22ba525) #27 (2e33819) +/-
Coverage 6.9% 6.8% -0.2%
Code to Test Ratio 1:0.1 1:0.1 -0.1
Test Execution Time 3s 5s +2s
Details
  |                     | main (22ba525) | #27 (2e33819) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |           6.9% |          6.8% | -0.2% |
  |   Files             |              9 |             9 |     0 |
  |   Lines             |            333 |           338 |    +5 |
  |   Covered           |             23 |            23 |     0 |
- | Code to Test Ratio  |          1:0.1 |         1:0.1 |  -0.1 |
  |   Code              |            796 |           805 |    +9 |
  |   Test              |            102 |           102 |     0 |
- | Test Execution Time |             3s |            5s |   +2s |

Code coverage of files in pull request scope (0.0% → 0.0%)

Files Coverage +/- Status
tailor/function.go 0.0% 0.0% modified

Reported by octocov

@jackchuka jackchuka marked this pull request as ready for review October 21, 2025 06:25
@k1LoW
Copy link
Copy Markdown
Owner

k1LoW commented Oct 21, 2025

@jackchuka Nice!!! Thank you!!

@k1LoW k1LoW added enhancement New feature or request tagpr:minor labels Oct 21, 2025
@k1LoW k1LoW merged commit 61b7e9c into main Oct 21, 2025
1 check passed
@k1LoW k1LoW deleted the feat/function/2025-10-21-send-result branch October 21, 2025 06:27
@github-actions github-actions Bot mentioned this pull request Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tagpr:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants