Skip to content

Add method and subpath flags to timetrigger object for triggering a function #3017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

soharab-ic
Copy link
Contributor

@soharab-ic soharab-ic commented Sep 14, 2024

Description

  • Timetrigger can only trigger a function by HTTP POST method and it can only trigger the root of the function. If function exposes some routes then timetrigger can not trigger those routes.
  • This PR adds new flags method and subpath to timetrigger create and update commands. Now user can configure the HTTP method used to trigger the function and also configure a subpath to trigger an internal route exposed by the function.

Which issue(s) this PR fixes:

Fixes #3011 #3009

Testing

Checklist:

  • I ran tests as well as code linting locally to verify my changes.
  • I have done manual verification of my changes, changes working as expected.
  • I have added new tests to cover my changes.
  • My changes follow contributing guidelines of Fission.
  • I have signed all of my commits.

Update fission-cli to accept user input for method and subpath fields.
Update publisher package to utilize these fields for triggering a function.
Update timer controller to use method and subpath fields for publishing a request.
Add a new test TestPublisherSubpath in pulisher package.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Copy link

codecov bot commented Sep 14, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 44.36%. Comparing base (5d580e0) to head (3d052c6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/fission-cli/cmd/timetrigger/update.go 88.88% 1 Missing ⚠️
pkg/kubewatcher/kubewatcher.go 0.00% 1 Missing ⚠️
pkg/timer/timer.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3017      +/-   ##
==========================================
+ Coverage   44.32%   44.36%   +0.04%     
==========================================
  Files         236      236              
  Lines       24631    24650      +19     
==========================================
+ Hits        10917    10936      +19     
  Misses      12309    12309              
  Partials     1405     1405              
Flag Coverage Δ
unittests 44.36% <90.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Update test for fission-cli timetrigger create, update command to support method and subpath flags.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
@sanketsudake sanketsudake merged commit 93869d3 into main Sep 16, 2024
10 checks passed
@sanketsudake sanketsudake deleted the enhance-time-trigger branch September 26, 2024 16:16
@facorazza
Copy link
Contributor

facorazza commented Nov 21, 2024

The subpath allows to forward parameters with the query but is there a way to send a predetermined payload when using the POST method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimeTriggers: Invoke any URL instead of root of a function
3 participants