Compare commits

...

325 Commits

Author SHA1 Message Date
github-actions[bot]
fbbc0824ff chore(version): update to version '1.1.3' 2025-11-13 13:42:46 +00:00
Loïc Mathieu
842b8d604b fix(flow): don't URLEncode the fileName inside the Download task
Also provide a `fileName` property that when set would override any filename from the content disposition in case it causes issues.
2025-11-13 11:12:43 +01:00
Loïc Mathieu
bd5ac06c5b fix(system): consume the trigger queue so it is properly cleaned
Fixes https://github.com/kestra-io/kestra/issues/11671
2025-11-13 11:12:34 +01:00
Barthélémy Ledoux
335fe1e88c fix(executions): simplify LabelInput usage in execution labels dialog (#12921)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-11-13 14:38:19 +05:30
Piyush Bhaskar
5c52ab300a fix(flow): enhance error handling and validation for flow save operations (#12926) 2025-11-13 14:09:44 +05:30
Miloš Paunović
756069f1a6 fix(core): amend paths for consuming custom blueprints (#12925)
Closes https://github.com/kestra-io/kestra-ee/issues/5814.
2025-11-13 09:34:40 +01:00
Piyush Bhaskar
faba958f08 fix(core): adjust overflow behavior (#12879) 2025-11-13 13:59:01 +05:30
Piyush Bhaskar
a772a61d62 fix(core): update toast to use util (#12924) 2025-11-13 13:57:07 +05:30
Loïc Mathieu
f2cb79cb98 fix(system): access log configuration
Due to a change in the configuration file, access log configuration was in the wrong sub-document.

Fixes https://github.com/kestra-io/kestra-ee/issues/5670
2025-11-12 15:09:26 +01:00
Piyush Bhaskar
9ea0b1cebb fix(filters): conditionally include namespace/ flowId key based on route (#12840) 2025-11-12 13:58:02 +05:30
Piyush Bhaskar
867dc20d47 fix(core): handle potential null values for children (#12842) 2025-11-12 12:48:38 +05:30
Piyush Bhaskar
c669759afb fix(secrets): NS update for a secret should be disabled properly with correct prop (#12834) 2025-11-12 12:28:20 +05:30
Barthélémy Ledoux
7e3cd8a2cb fix: run validation when editing a dashboard (#12827) 2025-11-10 18:35:45 +01:00
YannC
f203c5f43a fix: where prop can be null (#12828) 2025-11-10 18:35:45 +01:00
github-actions[bot]
f4e90cc540 chore(version): update to version '1.1.2' 2025-11-10 14:36:53 +00:00
YannC
ce0fd58c94 fix: make sure datafilter is validated (#12822) 2025-11-10 13:29:59 +01:00
Loïc Mathieu
f1b950941c fix(executions): allow reading from subflow even if we have a parent
This fixes an issue where you cannot read from a Subflow file if the execution has iteself be triggered by another Subflow task.
It was caused by the trigger check beeing too aggressive, if it didn't pass the check it fail instead of return false so the other check would not be processed.

Fixes #12629
2025-11-10 13:26:44 +01:00
Piyush Bhaskar
559f3f2634 fix(core): bring the usage of restore url (#12762)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-11-10 16:06:06 +05:30
YannC
9bc65b84f1 fix: when removing a queued execution, directly delete instead of fetching then delete to reduce deadlock (#12789) 2025-11-10 10:32:48 +01:00
Piyush Bhaskar
223b137381 fix(core): add defaults for component (#12814) 2025-11-10 15:02:20 +05:30
Piyush Bhaskar
80d1df6eeb fix(core): bulk deletion of executions (#12813) 2025-11-10 14:05:16 +05:30
Piyush Bhaskar
a87e7f3b8d fix(core): filter the minichart by duration from api which is 30D (#12740) 2025-11-10 13:58:33 +05:30
Loïc Mathieu
710862ef33 fix(executions): don't urlencode files as they would already be inside the storage 2025-11-10 09:28:04 +01:00
Miloš Paunović
d74f535ea1 chore(flows): amend flow export filename to include namespace and id parameters (#12800)
Closes https://github.com/kestra-io/kestra/issues/12790.
2025-11-07 13:58:16 +01:00
Piyush Bhaskar
1673f24356 fix(core): bring dashboard selector in navbar and also keep the selected dashboard route specific (#12703)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-11-07 16:27:53 +05:30
brian-mulier-p
2ad90625b8 fix(tests): bump amount of threads on tests (#12777) 2025-11-07 09:44:19 +01:00
Piyush Bhaskar
e77b80a1a8 refactor(core): properly do trigger filter (#12780) 2025-11-07 11:35:59 +05:30
Ludovic DEHON
6223b1f672 feat(cli): add --flow-path on executor to preload some flows
close kestra-io/kestra-ee#5721
2025-11-06 19:26:17 +01:00
github-actions[bot]
23329f4d48 chore(version): update to version '1.1.1' 2025-11-06 17:18:11 +00:00
Loïc Mathieu
ed60cb6670 fix(core): relax assertion on ConcurrencyLimitServiceTest.findById() 2025-11-06 18:16:32 +01:00
brian-mulier-p
f6306883b4 fix(kv): all types properly handled and avoid trimming string KV values (#12765)
closes https://github.com/kestra-io/kestra-ee/issues/5718
2025-11-06 15:47:44 +01:00
Loïc Mathieu
89433dc04c fix(system): killing a paused flow should kill the Pause task attempt
Fixes #12421
2025-11-06 15:33:56 +01:00
Loïc Mathieu
4837408c59 chore(test): try to un-flaky ConcurrencyLimitServiceTest.findById().
By making sure the unqueueExecution() test wait for the unqueued execution to ends to avoid any potential races.
2025-11-06 15:33:56 +01:00
Miloš Paunović
5a8c36caa5 fix(variables): properly send kv value when the type is json (#12759)
Closes https://github.com/kestra-io/kestra/issues/12739.
2025-11-06 15:33:56 +01:00
Piyush Bhaskar
a2335abc0c fix(core): make the interval in triggers work (#12764) 2025-11-06 19:39:10 +05:30
Piyush Bhaskar
310a7bbbe9 Revert "fix(core): apply timeRange filter in triggers (#12721)" 2025-11-06 18:56:37 +05:30
Jay Balwani
162feaf38c Fix(UI)/kv type boolean (#12643)
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-11-06 16:37:01 +05:30
Piyush Bhaskar
94050be49c fix(core): apply timeRange filter in triggers (#12721) 2025-11-06 16:29:47 +05:30
brian-mulier-p
848a5ac9d7 fix(cli): metadata commands weren't working with external storages (#12743)
closes #12713
2025-11-06 11:47:59 +01:00
Barthélémy Ledoux
9ac7a9ce9a fix: responsive dashboard grid (#12608) 2025-11-06 11:03:26 +01:00
Piyush Bhaskar
c42838f3e1 feat(ui): persist scroll across No‑code, editor tabs, and docs via Pinia view-state and scroll-memory (#12358) 2025-11-06 11:53:07 +05:30
Irfan
c499d62b63 fix(core): going back from plugin doc will take to plugins home (#12621)
Co-authored-by: iitzIrFan <irfanlhawk@gmail.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-11-06 11:50:34 +05:30
Piyush Bhaskar
8fbc62e12c fix(core): proper deletion of single and multi ns files (#12618) 2025-11-06 11:49:51 +05:30
Vipin Chandra Sao
ae143f29f4 fix(ui): prevent "Invalid date" display in Gantt view for executions … (#12605)
* fix(ui): prevent "Invalid date" display in Gantt view for executions that never started

- Added defensive checks wherever histories arrays might be empty
- Now renders blank or safe values instead of "Invalid date"
- Improved comments for maintainability and future debugging
- Addresses issue #12583

* revert the changes

* fix: remove the card when invalid date

---------

Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-11-06 11:49:02 +05:30
Piyush Bhaskar
e4a11fc9ce fix(core): remove double info icon (#12623) 2025-11-06 11:48:36 +05:30
Piyush Bhaskar
ebacfc70b9 fix(core): use proper option after P30D in misc (#12624) 2025-11-06 11:47:57 +05:30
Loïc Mathieu
5bf67180a3 fix(system): trigger an execution once per condition on flow triggers
Fixes #12560
2025-11-05 15:31:41 +01:00
Roman Acevedo
1e670b5e7e test(kv): plain text header is sent now 2025-11-04 15:17:02 +01:00
brian.mulier
0dacad5ee1 chore(version): upgrade to v1.1.0 2025-11-04 13:58:32 +01:00
brian.mulier
ee63c33ef3 fix(ci): failsafe global-create-new-release-branch.yml 2025-11-04 13:49:59 +01:00
Roman Acevedo
d620dd7dec test: set retryWithFlowableErrors as FlakyTest 2025-11-04 13:46:14 +01:00
brian.mulier
02425586d6 fix(ci): failsafe global-create-new-release-branch.yml 2025-11-04 13:44:44 +01:00
brian.mulier
56d48ddf32 fix(ci): failsafe global-create-new-release-branch.yml 2025-11-04 13:41:32 +01:00
brian.mulier
1a5c79827b fix(ci): failsafe global-create-new-release-branch.yml 2025-11-04 13:36:06 +01:00
Florian Hussonnois
08b20fda68 fix(core): resolution of plugin must be done with a stable version 2025-11-04 11:29:47 +01:00
François Delbrayelle
7192ad1494 doc(http/request): fix doc about basic auth (#12626) 2025-11-04 10:44:36 +01:00
YannC
f164cddf7a Fix/sdk changes (#12411) (#12617)
* Fix/sdk changes (#12411)

* fix: kv controller remove namespace check

* clean(API): add query to filter parameter

* fix: flow update not deprecated

* clean(API): add deprecated on open api

* feat: executions annotations for skipping, follow method generation in sdk

* feat: add typing indication to validateTask

* fix(flowController): set correct hidden for json method in

* fix: optional params in delete executions endpoints

* fix: inputs/outputs as object

* change KV schema type to be object

* add back , deprecated = false on flow update, otherwise its marked as deprecated

* Revert "add back , deprecated = false on flow update, otherwise its marked as deprecated"

This reverts commit 3772404b68f14f0a80af9e0adb9952d58e9102b4.

* feat(API): add multipart to openAPI

* feat(API): add multipart to openAPI

* fix: only use plain-text for setKeyValue endpoint

* fix: KV command test

* chore: add multipart vendor annotations for custom generation on SDK

---------

Co-authored-by: YannC. <ycoornaert@kestra.io>
Co-authored-by: nKwiatkowski <nkwiatkowski@kestra.io>

* fix: kv test remove content type

---------

Co-authored-by: Roman Acevedo <roman.acevedo62@gmail.com>
Co-authored-by: nKwiatkowski <nkwiatkowski@kestra.io>
2025-11-04 08:37:08 +01:00
Barthélémy Ledoux
c1e18eb490 refactor: make typescript progress on logs (#12603) 2025-11-03 14:31:26 +01:00
Miloš Paunović
4365a108ac chore(core): enhance github issue templates (#12572) 2025-11-03 10:48:03 +00:00
brian-mulier-p
bb0e15a2cc fix(cli): avoid resaving existing metadata upon migration (#12607) 2025-11-03 11:16:03 +01:00
brian-mulier-p
3ab6d6a94f feat(cli): have separate commands for KV & secrets metadata migrations (#12585) 2025-11-03 09:33:26 +01:00
Krie
e116186201 feat: make charts default duration configurable, add kestra.ui.charts… (#12599)
* feat: make charts default duration configurable, add kestra.ui.charts.default-duration config parameter (default: PT720H/30 days)

* Update cli/src/main/resources/application.yml

Co-authored-by: YannC <37600690+Skraye@users.noreply.github.com>

* Update ui/src/components/flows/FlowRoot.vue

Co-authored-by: YannC <37600690+Skraye@users.noreply.github.com>

* Update ui/src/routes/routes.js

Co-authored-by: YannC <37600690+Skraye@users.noreply.github.com>

* feat: set P30D instead of PT720H for readability

---------

Co-authored-by: YannC <37600690+Skraye@users.noreply.github.com>
Co-authored-by: YannC. <ycoornaert@kestra.io>
2025-11-03 09:21:39 +01:00
Barthélémy Ledoux
6439671b91 fix: on producion, switch appear without fields (#12579) 2025-11-01 22:37:53 +01:00
Piyush Bhaskar
c044634381 fix(core): allow to show multiple labels and few cleanup (#12587) 2025-11-01 01:06:39 +05:30
Roman Acevedo
776ea0a93c ci: add dry run to release-docker.yml (#12586) 2025-10-31 20:02:21 +01:00
Piyush Bhaskar
a799ef8b64 fix(core): fix the pagination (#12569) 2025-10-31 20:57:17 +05:30
Loïc Mathieu
e2e4335771 fix(flows): fail flow validation for duplicate preconditions ID 2025-10-31 16:22:13 +01:00
Loïc Mathieu
f8b0d4217f fix(executions): Flow triggered twice when there are two multiple conditions
Fixes #12560
2025-10-31 16:22:13 +01:00
Pradumna Saraf
c594aa6764 chore(plugin): improve the OutputValues example 2025-10-31 15:15:44 +01:00
Piyush Bhaskar
d09bf5ac96 fix(core): lets have separate key and value input for labels for EQUALS, NOT_EQUALS operator (#12577) 2025-10-31 19:24:58 +05:30
Ishani Kundu
ef0a4e6b1a fix: Decrease the spacing between top of the filters and the bottom of the header (#12573)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-31 17:35:34 +05:30
Piyush Bhaskar
5f81c19fc7 refactor(triggers): clean usage of trigger_state (#12568) 2025-10-31 16:36:03 +05:30
Mohammad Zaki
701f7e22d8 refactor(core): convert LogLevelSelector.vue to TypeScript and Composition API (#12556)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-31 15:13:34 +05:30
Miloš Paunović
4bf469c992 fix(core): ensure "clicking fix with ai" button always shows and focuses the code panel (#12565)
Closes https://github.com/kestra-io/kestra/issues/12504.
2025-10-31 10:27:11 +01:00
Roman Acevedo
71e49f9eb5 feat(executions): add IN, NOT_IN, CONTAINS LABELS #11916
- advance on https://github.com/kestra-io/kestra/issues/11587
- companion PR: https://github.com/kestra-io/kestra-ee/pull/5617
2025-10-31 10:20:05 +01:00
Ishani Kundu
76e9b2269f refactor(core): convert Plugin.vue component to ts with Composition API (#12559)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-31 14:45:48 +05:30
github-actions[bot]
c3f34e1c2a chore(core): localize to languages other than english (#12555)
Extended localization support by adding translations for multiple languages using English as the base. This enhances accessibility and usability for non-English-speaking users while keeping English as the source reference.

Co-authored-by: GitHub Action <actions@github.com>
2025-10-31 08:10:36 +01:00
Ludovic DEHON
e01e8d8fe0 feat(tasks): add a params for http tasks
close #12507
2025-10-31 00:40:49 +01:00
Dnyanesh Pise
7c5092f281 fix(ui): prevent marking fields as error on login (Fix #12548) (#12554) 2025-10-30 23:34:34 +05:30
Loïc Mathieu
e025677e70 fix(executions): set the execution to KILLING and not RESTARTED when killing a paused flow
Fixes https://github.com/kestra-io/kestra/issues/12417
2025-10-30 18:11:17 +01:00
Bart Ledoux
a3195c8e64 feat(ui): add concurency limit page and route 2025-10-30 17:49:33 +01:00
Loïc Mathieu
9920d190c8 feat(system): add an administration page for concurrency limit
Closes  #11250
2025-10-30 17:49:33 +01:00
brian.mulier
2b29a36850 fix(kv): get value doesn't need metadata migration
Also purge expired kv in metadata migrate command
2025-10-30 16:57:57 +01:00
brian.mulier
07e90de835 fix(core): CrudEvent should not be done on the repository side for KV 2025-10-30 16:57:57 +01:00
Loïc Mathieu
1c097209ac fix(flows): subflow validation could fail in Elasticsearch
As you cannot eq on a null field
2025-10-30 16:29:41 +01:00
Krie
ca70743329 chore(core): clarify usage of vite environment variables in docs (#12520)
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-30 16:18:37 +01:00
github-actions[bot]
5d2c93b232 chore(core): localize to languages other than english (#12550)
Extended localization support by adding translations for multiple languages using English as the base. This enhances accessibility and usability for non-English-speaking users while keeping English as the source reference.

Co-authored-by: GitHub Action <actions@github.com>
2025-10-30 16:16:04 +01:00
Loïc Mathieu
bc7291b8e3 chore(deps): fix OpenTelemetry proto so it works with Protobuf 3
Fixes https://github.com/kestra-io/kestra/issues/12298
2025-10-30 15:47:10 +01:00
Loïc Mathieu
c06ffb3063 feat(system): set taskrun attempt to resubmitted when a taskrun is resubmitted to a worker
Closes https://github.com/kestra-io/kestra/issues/12481
2025-10-30 15:46:05 +01:00
Barthélémy Ledoux
7c89eec500 fix(nocode): switch statements should display corectly (#12509)
Co-authored-by: brian.mulier <bmmulier@hotmail.fr>
2025-10-30 15:34:15 +01:00
Ritoban Dutta
45592597e7 chore: convert StateChart.vue component to TypeScript with Composition API (#12537)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-30 17:32:47 +05:30
Hemant M Mehta
313fda153a fix: avoid reusing jq scope and revert unnecessary test changes
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
6c3bbcea4d fix: Move Scope initialization to static block
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
53b46f11aa fix: Increase wait timeout to 120s for restartFlowable tests to fix timing issues
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
9396e73f5a fix: Update ExecutionServiceTest replayFlowable
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
d02b6b0470 fix: static call issue
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
bdfd324a7d fix: update to version
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
551f6fe033 fix: updated the version
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
2025-10-30 12:53:44 +01:00
Hemant M Mehta
7a0b3843e1 fix: jq-filter-zip-exception
closes: #11683
2025-10-30 12:53:44 +01:00
Dheeraj_R_Gowda
d713f2753b refactor(ui): convert TemplateEdit.vue to TypeScript using script setup (#12530)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-30 16:55:35 +05:30
Loïc Mathieu
bc27e0ea9e chore(executions): deprecate the state store for the KVStore 2025-10-30 11:30:36 +01:00
Piyush Bhaskar
08f4b2ea22 fix(core): properly apply the saved filter containing date range. (#12541) 2025-10-30 15:31:43 +05:30
Barthélémy Ledoux
b64168f115 fix: save tabs state onCreate (#12517) 2025-10-30 10:44:53 +01:00
Piyush Bhaskar
b23aa3eb1a fix(core): make popper open fast (#12533) 2025-10-30 12:51:47 +05:30
Piyush Bhaskar
70b5c03fb2 fix(core): remove the scope from Logs and show the chart by default (#12532) 2025-10-30 12:39:22 +05:30
Piyush Bhaskar
094802dd85 fix(filter): make reset and reset to default of pre applied filter robust. (#12508) 2025-10-30 12:32:20 +05:30
brian.mulier
d9144c8c4f feat(core): introduce KV Metadata in-repository storing (#12342)
part of https://github.com/kestra-io/kestra/issues/12341
2025-10-29 17:18:43 +01:00
brian.mulier
b18d304b77 fix(kv): properly serialize durations 2025-10-29 17:18:43 +01:00
brian.mulier
c38cac5a9d fix(tests): concurrency-safe Template emits 2025-10-29 17:18:43 +01:00
brian.mulier
4ed44754ab fix(core): use index by adding deleted everytime in query 2025-10-29 17:18:43 +01:00
Florian Hussonnois
e62baaabe4 fix(core): fix PluginCatalogService resolve method 2025-10-29 17:10:32 +01:00
Nicolas K.
efac416863 feat(core): force telemetry when license requires it (#12512)
Co-authored-by: nKwiatkowski <nkwiatkowski@kestra.io>
2025-10-29 17:03:45 +01:00
François Delbrayelle
d26956fc89 doc(http/request): fix doc about basic auth (#12510) 2025-10-29 16:56:27 +01:00
Diksha Ajaykumar Nigam
03a5c52445 refactor(ui): convert LeftMenu.vue to TypeScript using script setup (#12440) 2025-10-29 15:49:24 +01:00
Barthélémy Ledoux
290e0c5ded fix: avoid refreshing token when impersonated (#12476) 2025-10-29 15:47:52 +01:00
Ashwini Kumar
1c0e0fd926 refactor(ui): Convert LeftMenuLink.vue to TypeScript (#12431) 2025-10-29 15:27:19 +01:00
YannC
9042e86f12 fix: make sure taskOutputs is never set as a Variables map (#12484)
close #11967
2025-10-29 15:25:09 +01:00
Barthélémy Ledoux
c6be8798d6 fix: show images in editor (#12503)
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-10-29 15:16:23 +01:00
Barthélémy Ledoux
452ac83b01 fix: open tasks from topo in other panel (#12432) 2025-10-29 15:15:33 +01:00
dependabot[bot]
3dd198f036 build(deps): bump software.amazon.awssdk:bom from 2.35.11 to 2.36.3
Bumps software.amazon.awssdk:bom from 2.35.11 to 2.36.3.

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:bom
  dependency-version: 2.36.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 15:01:51 +01:00
Florian Hussonnois
228863d91a fix(test): fix test on FlowValidationTest 2025-10-29 14:19:56 +01:00
dependabot[bot]
8b17a7c36d build(deps): bump dev.langchain4j:langchain4j-community-bom
Bumps [dev.langchain4j:langchain4j-community-bom](https://github.com/langchain4j/langchain4j-community) from 1.7.1-beta14 to 1.8.0-beta15.
- [Release notes](https://github.com/langchain4j/langchain4j-community/releases)
- [Commits](https://github.com/langchain4j/langchain4j-community/compare/1.7.1-beta14...1.8.0-beta15)

---
updated-dependencies:
- dependency-name: dev.langchain4j:langchain4j-community-bom
  dependency-version: 1.8.0-beta15
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 14:17:02 +01:00
Loïc Mathieu
55a8896181 chore(tests): set FlowControllerTest.updateFlowFlowFromJsonFromString as flaky
It fails often in CI and as the tested endpoint is deprecated it is not important that the test pass.
2025-10-29 14:12:32 +01:00
dependabot[bot]
fc600cc1e3 build(deps): bump dev.langchain4j:langchain4j-bom from 1.7.1 to 1.8.0
Bumps [dev.langchain4j:langchain4j-bom](https://github.com/langchain4j/langchain4j) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/langchain4j/langchain4j/releases)
- [Commits](https://github.com/langchain4j/langchain4j/compare/1.7.1...1.8.0)

---
updated-dependencies:
- dependency-name: dev.langchain4j:langchain4j-bom
  dependency-version: 1.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 14:11:54 +01:00
dependabot[bot]
fa23081207 build(deps): bump @swc/core-linux-x64-gnu from 1.13.21 to 1.14.0 in /ui (#12494)
Bumps [@swc/core-linux-x64-gnu](https://github.com/swc-project/swc) from 1.13.21 to 1.14.0.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.13.21...v1.14.0)

---
updated-dependencies:
- dependency-name: "@swc/core-linux-x64-gnu"
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-29 13:16:38 +01:00
Piyush Bhaskar
2b04192d1b fix(core): avoid hot reload on enter in input (#12490) 2025-10-29 17:46:29 +05:30
dependabot[bot]
b7fbdf8aed build(deps): bump @swc/core-darwin-x64 from 1.13.21 to 1.14.0 in /ui (#12495)
Bumps [@swc/core-darwin-x64](https://github.com/swc-project/swc) from 1.13.21 to 1.14.0.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.13.21...v1.14.0)

---
updated-dependencies:
- dependency-name: "@swc/core-darwin-x64"
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-29 13:15:40 +01:00
dependabot[bot]
5a95fcf1ff build(deps): bump @swc/core-darwin-arm64 from 1.13.21 to 1.14.0 in /ui (#12489)
Bumps [@swc/core-darwin-arm64](https://github.com/swc-project/swc) from 1.13.21 to 1.14.0.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.13.21...v1.14.0)

---
updated-dependencies:
- dependency-name: "@swc/core-darwin-arm64"
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-29 13:13:27 +01:00
Miloš Paunović
558ca24dac chore(deps): regular dependency update (#12473)
Performing a weekly round of dependency updates in the NPM ecosystem to keep everything up to date.
2025-10-29 13:03:00 +01:00
dependabot[bot]
1ffc60fe07 build(deps): bump org.sonarqube from 7.0.0.6105 to 7.0.1.6134
Bumps org.sonarqube from 7.0.0.6105 to 7.0.1.6134.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.0.1.6134
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 12:39:14 +01:00
Your Name
4cdbb5f57e Remove duplicate test and explicitly use Integer.valueOf in chunkWithIntegerVariable 2025-10-29 12:36:00 +01:00
Your Name
3f27645b3c test(core): add reproducer for Integer to Long casting issue in chunk filter 2025-10-29 12:36:00 +01:00
Your Name
a897618108 fix(core): handle integer size in chunk Pebble filter 2025-10-29 12:36:00 +01:00
Piyush Bhaskar
cb9662cbd7 fix(core): tweaks for dropdown bg and shadow (#12479) 2025-10-29 16:14:27 +05:30
Naveen Gowda MY
c60be5c9f8 feat: add error feedback and validation to login form Fixes #12361 (#12472)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-10-29 15:44:15 +05:30
dependabot[bot]
ec74c1ae51 build(deps): bump com.mysql:mysql-connector-j from 9.4.0 to 9.5.0
Bumps [com.mysql:mysql-connector-j](https://github.com/mysql/mysql-connector-j) from 9.4.0 to 9.5.0.
- [Changelog](https://github.com/mysql/mysql-connector-j/blob/release/9.x/CHANGES)
- [Commits](https://github.com/mysql/mysql-connector-j/compare/9.4.0...9.5.0)

---
updated-dependencies:
- dependency-name: com.mysql:mysql-connector-j
  dependency-version: 9.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 11:02:06 +01:00
dependabot[bot]
ded9e8c13a build(deps): bump software.amazon.awssdk.crt:aws-crt
Bumps [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java) from 0.39.3 to 0.39.4.
- [Release notes](https://github.com/awslabs/aws-crt-java/releases)
- [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.39.3...v0.39.4)

---
updated-dependencies:
- dependency-name: software.amazon.awssdk.crt:aws-crt
  dependency-version: 0.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 11:00:40 +01:00
dependabot[bot]
fcb2d18beb build(deps): bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 11:00:09 +01:00
dependabot[bot]
c3bc919891 build(deps): bump com.google.cloud:libraries-bom from 26.70.0 to 26.71.0
Bumps [com.google.cloud:libraries-bom](https://github.com/googleapis/java-cloud-bom) from 26.70.0 to 26.71.0.
- [Release notes](https://github.com/googleapis/java-cloud-bom/releases)
- [Changelog](https://github.com/googleapis/java-cloud-bom/blob/main/release-please-config.json)
- [Commits](https://github.com/googleapis/java-cloud-bom/compare/v26.70.0...v26.71.0)

---
updated-dependencies:
- dependency-name: com.google.cloud:libraries-bom
  dependency-version: 26.71.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 10:59:40 +01:00
brian-mulier-p
03542e91f3 fix(core): show tasks in JSON Schema for Switch.cases (#12478)
part of #10508
2025-10-29 10:26:38 +01:00
Florian Hussonnois
958ee1ef8a fix(system): add resolveVersions method to PluginCatalogService
Related-to: kestra-io/kestra-ee#5171
2025-10-29 10:16:59 +01:00
Piyush Bhaskar
a27348b872 feat(core): add support for single datetime as well (#12471) 2025-10-29 13:35:37 +05:30
Roman Acevedo
36aedec8f0 ci: add skip test param to pre-release.yml 2025-10-28 17:53:57 +01:00
Pratik Murari
9499cfc955 refactor: convert RouterMd.vue component to TypeScript (#12429)
Co-authored-by: Barthélémy Ledoux <ledouxb@me.com>
2025-10-28 16:41:32 +01:00
Anna Geller
d3d14a252b feat: add cloud formation template to deploy Kestra (#12412)
* feat: add cloud formation template to deploy Kestra

* Update README.md
2025-10-28 15:45:43 +01:00
Ridham Anand
425af2a530 refactor(layout): convert DefaultLayout.vue to TypeScript using Composition API (#12424)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-28 15:32:57 +01:00
Arya Soni
0bae8cdbe9 Convert ErrorToastContainer.vue component to TS (#12418)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-28 15:28:41 +01:00
Ravi kumar
b9a5a74674 refactor(ui): convert Settings.vue to TS composition API (#12413)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-28 15:24:19 +01:00
Piyush Bhaskar
222fae2a22 fix(core): add dynamic rowKey for selection handling (#12428) 2025-10-28 19:11:14 +05:30
Loïc Mathieu
4502c52d2b fix(executions): remove errors and finally tasks when restarting
Otherwize we would detect that an error or a finally branch is processing and the flowable state would not be correctly taken.

Moreover, it prevent this branch to be taken again after a restart.

Fixes #11731
2025-10-28 14:29:27 +01:00
Florian Hussonnois
153ac27040 fix(flows): KV pebble expressions with input defaults (#12314)
Fixes: #12314
2025-10-28 14:29:03 +01:00
Florian Hussonnois
6361a02deb feat(core): add prefill prop to input to allow nullable value (#11819)
Added a new 'prefill' property for all inputs
to specify an optional UI hint for pre-filling the input,while
allowing the input to be nullable.

Fixes: #11819
2025-10-28 14:21:26 +01:00
Piyush Bhaskar
163e1e2c8b chore(version): bump ui-libs for a fix. (#12425) 2025-10-28 18:20:54 +05:30
(Tum) Poomtum Rattanarat
07b5e89a2f fix(ui): align label form field in no-code editor (#12144)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-10-28 17:14:57 +05:30
github-actions[bot]
a3ff8f5c2b chore(core): localize to languages other than english (#12423)
Extended localization support by adding translations for multiple languages using English as the base. This enhances accessibility and usability for non-English-speaking users while keeping English as the source reference.

Co-authored-by: GitHub Action <actions@github.com>
2025-10-28 12:35:33 +01:00
Irfan
4cd369e44d feat(core): add type validation to file inputs (#12176)
Closes https://github.com/kestra-io/kestra/issues/11266.

Co-authored-by: iitzIrFan <irfanlhawk@gmail.com>
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-28 12:33:10 +01:00
Carlos Longhi
364540c45a chore(flows): highlight the id field as a link (#12414)
Closes https://github.com/kestra-io/kestra/issues/12365.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-28 12:22:55 +01:00
Pratik Murari
65b8958fe8 fix(core): use correct formatting for tags in blueprints for list and details view (#12374)
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-28 16:40:57 +05:30
Dheeraj_R_Gowda
e9be141463 Fix: update menu background color (#12366) 2025-10-28 16:39:33 +05:30
Omar Moustafa
69804790fb Fix code snippets overlaying main UI in execution outputs (#12371) 2025-10-28 15:42:10 +05:30
Shatrughan
4a524196d4 refactor(core): convert vue component to typescript and composition api (#12416)
Closes https://github.com/kestra-io/kestra/issues/12397.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-28 11:11:30 +01:00
Barthélémy Ledoux
eeddfc7b1e fix(no-code): When anyof has array with different items (#12419) 2025-10-28 10:31:02 +01:00
Piyush Bhaskar
9f35f05188 feat(filter): introducing redesigned implemention of new filter. (#12265)
Co-authored-by: GitHub Action <actions@github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-28 15:00:03 +05:30
Adinath R
3984e92004 feat(ui): Redesigned the No Execution Flow Page to align with the rest (#12357)
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-28 12:07:09 +05:30
Florian Hussonnois
78c01999ad feat(triggers): add inputs property to webhook trigger
Add a new `inputs` property to the Webhook trigger, allowing input
data to be passed to the triggered flow. If no inputs are defined on the trigger,
the flow will not receive any inputs, even if some have default values.

This behavior ensures backward compatibility with how the Webhook trigger currently works.
2025-10-27 17:02:03 +01:00
Ludovic DEHON
ad13a64ccc fix: make dind example working, and add note for ubuntu users 2025-10-27 16:53:32 +01:00
Mohammad Shahid Beigh
b4017e96c3 refactor(core): convert FlowConcurrency.vue to TypeScript with Composition API (#12119)
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-10-27 18:31:23 +05:30
Piyush Bhaskar
b12b64fa40 fix(core): keep the selection with refresh or periodic refresh (#12343)
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-27 17:30:47 +05:30
SarthakBorude
5b3ebae8e7 chore(core): update the color of addition line highlight for light mode in monaco editor (#12149)
Closes https://github.com/kestra-io/kestra/issues/11956.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-27 12:31:02 +01:00
Manikanta Pallapothu
516b1fb1c3 chore(core): update design details on news panel (#12155)
Closes https://github.com/kestra-io/kestra/issues/12032.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-27 11:44:17 +01:00
Pavan YDG
80befa98e9 chore(core): remove the top pagination from table views (#12335)
Closes https://github.com/kestra-io/kestra/issues/12293.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-27 11:21:43 +01:00
Piyush Bhaskar
322532a955 fix(core): handle namespace removal applied from setting (#12381) 2025-10-27 15:49:10 +05:30
skayliu
70ad7b5fa2 chore(core): clean code for "Warning: [text blocks] will remove trailing spaces" (#10511) 2025-10-27 10:24:26 +01:00
Piyush Bhaskar
1e14f92d6f fix(core): makke flow search reactive (#12376) 2025-10-27 14:06:49 +05:30
Ravi kumar
fb4e2ca950 fix: auto-refresh namespace Files panel after Playground execution completes (#12114)
* fix: ui-playground-namespace-files-refresh

* fix: refresh tab and duplicates file removal fix

* fix: use the loadNodes function to refresh

---------

Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-26 17:14:36 +05:30
Barthélémy Ledoux
ed352f8a2e fix: avoid multiple dropdowns in file explorer (#12369) 2025-10-26 12:28:28 +01:00
Barthélémy Ledoux
bd8670e9a5 refactor(ui): extract file tree store (#12299) 2025-10-24 15:12:56 +02:00
Akshay Yadav
1e1b954d0a fix(ui/no-code-editor): Style the disabled section like other items (#12064)
Co-authored-by: Barthélémy Ledoux <bledoux@kestra.io>
2025-10-24 14:35:26 +02:00
Miloš Paunović
4c636578ac chore(core): pass prop as a boolean to resolve console warning (#12339) 2025-10-24 13:44:56 +02:00
Abhyshek Bhalaji
0d1ccb2910 chore(core): add use button to the system namespace blueprints tab (#12336)
Closes https://github.com/kestra-io/kestra/issues/12169.

Co-authored-by: MilosPaunovic <paun992@hotmail.com>
2025-10-24 13:30:37 +02:00
Sanjay Ramsinghani
edc4abc80e chore(core): introduce stronger repelling forces in the dependency view graph (#11910)
Closes https://github.com/kestra-io/kestra/issues/11583.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-24 12:14:22 +02:00
Prayag
ddf5690325 chore(core): prevent blinking on the dependencies page during loading (#11902)
Closes https://github.com/kestra-io/kestra/issues/11125.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-24 11:54:15 +02:00
brian-mulier-p
25fcf9695a fix(kv): don't throw in KV function with errorOnMissing=false for expired kv (#12321)
closes #12294
2025-10-24 11:20:40 +02:00
Abhyshek Bhalaji
920c614cc0 chore(core): update copilot button styles for accept and decline actions (#12277)
Closes https://github.com/kestra-io/kestra/issues/12057.

Co-authored-by: MilosPaunovic <paun992@hotmail.com>
2025-10-24 09:49:13 +02:00
Miloš Paunović
1dc18fdb66 chore(deps): regular dependency update (#12328)
Performing a weekly round of dependency updates in the NPM ecosystem to keep everything up to date.
2025-10-24 08:36:17 +02:00
Barthélémy Ledoux
86c7b2f6ae fix(ui): avoid eating comments when changing desc (#12316) 2025-10-24 06:57:46 +02:00
Roman Acevedo
296ddb3b19 test(flaky): mark noGroup and flowWaitFailed as flaky 2025-10-23 20:44:27 +02:00
Maru Karthik Reddy
f3befd174c fix(system): replace deprecated setSerializationInclusion with setDefaultPropertyInclusion (#12315)
The method was deprecated in Jackson 2.7 and will be removed in Jackson 3.0.
This is a direct 1:1 replacement with identical serialization behavior.
2025-10-23 16:53:03 +02:00
dependabot[bot]
d09ce90be4 build(deps): bump opensearchRestVersion from 3.3.0 to 3.3.1
Bumps `opensearchRestVersion` from 3.3.0 to 3.3.1.

Updates `org.opensearch.client:opensearch-rest-client` from 3.3.0 to 3.3.1
- [Release notes](https://github.com/opensearch-project/OpenSearch/releases)
- [Changelog](https://github.com/opensearch-project/OpenSearch/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opensearch-project/OpenSearch/compare/3.3.0...3.3.1)

Updates `org.opensearch.client:opensearch-rest-high-level-client` from 3.3.0 to 3.3.1
- [Release notes](https://github.com/opensearch-project/OpenSearch/releases)
- [Changelog](https://github.com/opensearch-project/OpenSearch/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opensearch-project/OpenSearch/compare/3.3.0...3.3.1)

---
updated-dependencies:
- dependency-name: org.opensearch.client:opensearch-rest-client
  dependency-version: 3.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.opensearch.client:opensearch-rest-high-level-client
  dependency-version: 3.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 16:39:25 +02:00
dependabot[bot]
87e059a76b build(deps): bump protobufVersion from 3.25.5 to 3.25.8
Bumps `protobufVersion` from 3.25.5 to 3.25.8.

Updates `com.google.protobuf:protobuf-java` from 3.25.5 to 3.25.8
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.25.5...v3.25.8)

Updates `com.google.protobuf:protobuf-java-util` from 3.25.5 to 3.25.8

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-version: 3.25.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.protobuf:protobuf-java-util
  dependency-version: 3.25.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 16:38:41 +02:00
Miloš Paunović
e58b271824 chore(deps): regular dependency update (#12268)
Performing a weekly round of dependency updates in the NPM ecosystem to keep everything up to date.
2025-10-23 15:51:42 +02:00
Loïc Mathieu
c1c46da324 fix(deps): dependabot config ignore in the wrong section 2025-10-23 15:48:58 +02:00
Barthélémy Ledoux
de6abc7650 fix: set lang properly with workers (#12286) 2025-10-23 14:56:50 +02:00
François Delbrayelle
6da0a74ac7 build: add plugin-jms in .plugins (temp for conapi) (#12289) 2025-10-23 14:19:11 +02:00
Bala Yokesh Mani A
df755361e1 refactor: remove unused Status component (#12287) 2025-10-23 17:23:55 +05:30
dependabot[bot]
918c026781 build(deps): bump com.github.oshi:oshi-core from 6.9.0 to 6.9.1
Bumps [com.github.oshi:oshi-core](https://github.com/oshi/oshi) from 6.9.0 to 6.9.1.
- [Release notes](https://github.com/oshi/oshi/releases)
- [Changelog](https://github.com/oshi/oshi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/oshi/oshi/compare/oshi-parent-6.9.0...oshi-parent-6.9.1)

---
updated-dependencies:
- dependency-name: com.github.oshi:oshi-core
  dependency-version: 6.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 12:37:55 +02:00
Manuj Chadha
e03b1dbcbb fix: connect timeline dots by setting width to 100% in SCSS (#12281) 2025-10-23 15:41:01 +05:30
Loïc Mathieu
25acd73de0 chore(versions): ignore protobuf 4 versions as we still need 3 2025-10-23 12:05:52 +02:00
Loïc Mathieu
68ee7b80a0 chore(system): don't manage Micrometer and Micronaut OpenAPI
Their version from the Micronaut BOM is now recent enought for our usage.

Closes https://github.com/kestra-io/kestra/pull/12222
2025-10-23 12:05:40 +02:00
Nicolas K.
893e8c1a49 feat(flows): add human task (#12276)
* feat(flows): add human task

* clean(flows): move models and validation into plugin packages and move validation logic to the task

---------

Co-authored-by: nKwiatkowski <nkwiatkowski@kestra.io>
2025-10-23 11:39:00 +02:00
Barthélémy Ledoux
f0ba570c3d refactor: remove FlowEditor.vue component (#12284) 2025-10-23 10:37:30 +02:00
Aniket Rathod
c2ab63ceba feat(ui): convert Curl.vue to TypeScript using Composition API #12079 (#12261)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-23 10:17:38 +02:00
Shubham Singh
7a126d71e5 refactor(ui): Convert Timeline.vue to TS (#12270)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-23 13:40:47 +05:30
Dheeraj_R_Gowda
453477ecb9 fix(ui):improved opening animation for Copilot popin (#12156) 2025-10-23 08:54:43 +02:00
Ananya44444
3f83aaa437 Convert InheritedKVs.vue to TypeScript (#12280) 2025-10-23 08:54:20 +02:00
Piyush Bhaskar
1ca8264391 fix(core): bring export logs in navbar (#12264) 2025-10-22 19:24:12 +05:30
Florian Hussonnois
832378af07 chore(core): update StorageContext to use FlowId class 2025-10-22 15:30:34 +02:00
SteveK
e9c96d4f5b chore(core): update icon colors and spacing in the top header (#12137)
Closes https://github.com/kestra-io/kestra/issues/12033.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-22 15:25:13 +02:00
Filip
0b5e6c25ed feat(ui): convert SubFlowLink.vue to TypeScript with Composition API (#12146)
Co-authored-by: Barthélémy Ledoux <ledouxb@me.com>
Co-authored-by: Barthélémy Ledoux <bledoux@kestra.io>
2025-10-22 15:21:38 +02:00
Sakshi Srivastava
991de1a0d9 chore(plugins): update the plugin count in the search placeholder (#12186)
Closes https://github.com/kestra-io/kestra/issues/12034.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-22 14:47:55 +02:00
Barthélémy Ledoux
a8ac968afd fix: changes indicator more clear (#12134)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
Co-authored-by: MilosPaunovic <paun992@hotmail.com>
Co-authored-by: alikhan0616 <m.alikhan0616@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Pratap Chandra Deo <61131823+Pratapchandradeo@users.noreply.github.com>
Co-authored-by: Mohammad Zaki <zakilol21427@gmail.com>
Co-authored-by: Akshay Yadav <91173835+akshaywritescode@users.noreply.github.com>
Co-authored-by: Narasimha Asuri <64534011+noone1235@users.noreply.github.com>
Co-authored-by: Muhammad Ali Khan <ak098boy@gmail.com>
Co-authored-by: mady20 <165700212+mady20@users.noreply.github.com>
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-10-22 14:39:46 +02:00
(Tum) Poomtum Rattanarat
2ce7841aa3 disable id field when editing and make it required field (#12217) 2025-10-22 14:35:16 +02:00
mustafatarek
999804f474 fix(tests): fix restartExecutionFromLastFailedWithPauseExecution() at ExecutionControllerRunnerTest 2025-10-22 14:26:13 +02:00
mustafatarek
58fd6c1c48 refactor(core): move flowable attempt state change into termination ensuring task termination 2025-10-22 14:26:13 +02:00
mustafatarek
85dc3ec788 fix(core): synchronize creation/running flowable attempt states in Jdbc executor 2025-10-22 14:26:13 +02:00
mustafatarek
c6e7ff9436 fix(core): transfer flowable attempt creation from saveFlowableOutput() to TaskRun to fix tests 2025-10-22 14:26:13 +02:00
mustafatarek
6e7d6de2e2 test: try to fix 2025-10-22 14:26:13 +02:00
Loïc Mathieu
01d79f34a4 Update executor/src/main/java/io/kestra/executor/ExecutorService.java 2025-10-22 14:26:13 +02:00
mustafatarek
bddb8fef89 fix(tests): fix markAsEachPara() test at ExecutionServiceTest 2025-10-22 14:26:13 +02:00
mustafatarek
24e2f5a0f6 feat(core): add unit tests for flowable task attempts( If and Sequential) 2025-10-22 14:26:13 +02:00
mustafatarek
aee3854155 refactor: remove unnecessary comments 2025-10-22 14:26:13 +02:00
mustafatarek
1771955717 feat(core): handle flowable task attempts state transitions 2025-10-22 14:26:13 +02:00
mustafatarek
7c7d606b48 feat(core): add attempts for flowable tasks 2025-10-22 14:26:13 +02:00
Miloš Paunović
154f380860 feat(core): fetch blueprints directly from the API (#12197)
Closes https://github.com/kestra-io/kestra-ee/issues/4808.
2025-10-22 14:20:38 +02:00
Barthélémy Ledoux
6e3c4f47cc fix: load node types for ts files (#12205) 2025-10-22 14:04:21 +02:00
杨利伟
7e68274cf4 fix(jdbc): add comment 2025-10-22 10:36:15 +02:00
杨利伟
1d58f3be34 fix(jdbc): add deleted field condition when allowDeleted=true 2025-10-22 10:36:15 +02:00
dependabot[bot]
becd1256db build(deps): bump software.amazon.awssdk:bom from 2.35.8 to 2.35.11
Bumps software.amazon.awssdk:bom from 2.35.8 to 2.35.11.

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:bom
  dependency-version: 2.35.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-22 10:20:26 +02:00
dependabot[bot]
1ce9d710b6 build(deps): bump flyingSaucerVersion from 10.0.0 to 10.0.3
Bumps `flyingSaucerVersion` from 10.0.0 to 10.0.3.

Updates `org.xhtmlrenderer:flying-saucer-core` from 10.0.0 to 10.0.3
- [Release notes](https://github.com/flyingsaucerproject/flyingsaucer/releases)
- [Changelog](https://github.com/flyingsaucerproject/flyingsaucer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyingsaucerproject/flyingsaucer/compare/v10.0.0...v10.0.3)

Updates `org.xhtmlrenderer:flying-saucer-pdf` from 10.0.0 to 10.0.3
- [Release notes](https://github.com/flyingsaucerproject/flyingsaucer/releases)
- [Changelog](https://github.com/flyingsaucerproject/flyingsaucer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyingsaucerproject/flyingsaucer/compare/v10.0.0...v10.0.3)

---
updated-dependencies:
- dependency-name: org.xhtmlrenderer:flying-saucer-core
  dependency-version: 10.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.xhtmlrenderer:flying-saucer-pdf
  dependency-version: 10.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-22 10:20:00 +02:00
dependabot[bot]
93de36b25b build(deps): bump com.microsoft.playwright:playwright
Bumps [com.microsoft.playwright:playwright](https://github.com/microsoft/playwright-java) from 1.55.0 to 1.56.0.
- [Release notes](https://github.com/microsoft/playwright-java/releases)
- [Commits](https://github.com/microsoft/playwright-java/compare/v1.55.0...v1.56.0)

---
updated-dependencies:
- dependency-name: com.microsoft.playwright:playwright
  dependency-version: 1.56.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-22 10:19:34 +02:00
dependabot[bot]
213b4ed1f3 build(deps): bump software.amazon.awssdk.crt:aws-crt
Bumps [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java) from 0.39.2 to 0.39.3.
- [Release notes](https://github.com/awslabs/aws-crt-java/releases)
- [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.39.2...v0.39.3)

---
updated-dependencies:
- dependency-name: software.amazon.awssdk.crt:aws-crt
  dependency-version: 0.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-22 10:10:54 +02:00
Maru Karthik Reddy
832c6eb313 fix(executions): ExecutionUpdatableTask attempt state tracking to record proper duration (#12206)
* fix(executor): record CREATED/RUNNING/SUCCESS states for ExecutionUpdatableTask attempts

Previously, ExecutionUpdatableTask attempts were created with only the
terminal state, skipping RUNNING and causing zero duration and incorrect UI display.

Update attempts through all state transitions:
- CREATED → RUNNING before task.update() call
- RUNNING → terminal state after execution

This preserves complete state history and enables accurate duration tracking.

* refactor: simplify attempt creation in handleExecutionUpdatingTask

Remove null/empty check for attempts list as no attempts exist at this
execution stage. Create attempt directly with RUNNING state using
`new State().withState(State.Type.RUNNING)`.

This simplifies the code while maintaining correct state transitions
(CREATED → RUNNING → terminal).

* test(RuntimeLabels): add state transition assertions
for ExecutionUpdatableTask in Labels tests

Verify that ExecutionUpdatableTask attempts record complete state transitions
(CREATED → RUNNING → SUCCESS) across all Labels test scenarios
2025-10-22 09:49:18 +02:00
Bala Yokesh Mani A
51e55a2543 refactor: remove FlowEdit component (#12255) 2025-10-22 09:18:58 +02:00
Barthélémy Ledoux
6e13dfa009 fix: combine a local schema when there is more (#12216) 2025-10-22 08:52:41 +02:00
brian.mulier
2b3df66406 fix(core): secrets table wasn't shown 2025-10-21 19:28:03 +02:00
brian-mulier-p
2c024c2586 feat: add global secret search controller (#12036)
closes kestra-io/kestra-ee#5130
closes kestra-io/kestra-ee#5132
closes kestra-io/kestra-ee#3476
2025-10-21 19:09:53 +02:00
Bala Yokesh Mani A
da39dbca01 feat(editor): add syntax highlighting to no-code editor (#12154)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-21 16:22:00 +02:00
Ashwini Kumar
693f582314 chore(core): amend blueprint page translation key (#12207)
Closes https://github.com/kestra-io/kestra/issues/12193.

Co-authored-by: MilosPaunovic <paun992@hotmail.com>
2025-10-21 16:17:15 +02:00
Manuj Chadha
095def6024 refactor: replace deprecated Property(String) constructor with Property.ofValue / Property.ofExpression (#12202) 2025-10-21 15:29:54 +02:00
Rutam Bhagat | Gen AI Pro | Freelancer
8531ed78bc fix(core): limit image size for empty state (#12201)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-21 18:06:24 +05:30
Ridham Anand
cef79689be fix(core): add hover over element (#12116)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-21 17:53:08 +05:30
Ruturaj Pawar
1e0eb180a6 fix(core): add border-radius to bookmarked. (#12111)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-21 17:35:56 +05:30
atulvishw240
b704a55a39 feat(system): Add Gauge Metric to Kestra Metrics System (#12138)
* feat(core): add gauge metric to metrics system

* Fix increment method to set value correctly
2025-10-21 13:58:49 +02:00
Manshu Saini
8e8af2ecf8 refactor(core): convert the ExecutionRoot.vue properly to ts (#11989)
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-21 16:53:17 +05:30
Piyush Bhaskar
4b7baba605 fix(test): fix multipaneltabs story test (#12196) 2025-10-21 16:41:58 +05:30
Piyush Bhaskar
63b887c9ed fix(core): handle 404 error in kv retrieval with message (#12191) 2025-10-21 15:10:14 +05:30
Carlos Longhi
3faee2c84b refactor: convert LabelInput.vue component to TypeScript using Composition API (#12112) 2025-10-21 14:54:42 +05:30
Nicolas K.
ff11ff9006 feat(flows): add truncate parameter for log shipper (#12131)
Co-authored-by: nKwiatkowski <nkwiatkowski@kestra.io>
2025-10-21 10:43:37 +02:00
Ravi kumar
dd7892ef28 feat(ui): scrollable editor tabs with VS Code–style wheel scrolling and right‑aligned close icon (#12152) 2025-10-21 10:37:28 +02:00
Miloš Paunović
b23fdc2376 chore(core): hide video container if there's no network access (#12166)
Closes https://github.com/kestra-io/kestra-ee/issues/4809.
2025-10-21 10:25:28 +02:00
Roman Acevedo
f347cea28b fix(flows): allow using OSS CLI to deploy EE flows
- fixes https://github.com/kestra-io/kestra-ee/issues/5490
2025-10-21 08:19:50 +02:00
Roman Acevedo
0b08d614c1 ci: improve slack notif to forward error (#12187)
* ci: improve slack notif to forward error

* more test

* more test

* cleanup
2025-10-20 18:54:23 +02:00
Roman Acevedo
d92fd0040a ci: fix slack notif when main build failed
- fixes https://github.com/kestra-io/kestra/issues/11905
2025-10-20 17:36:04 +02:00
Julio Daniel Reyes
004a85f701 fix(core): pass flow variables on trigger execution (#12161)
* fix(core): pass flow variables on trigger execution

closes #11891

* fix(core): Test passing variables for triggers
2025-10-20 15:53:57 +02:00
Roman Acevedo
f9f3b004d7 ci: try to fix ee trigger and slack message on main-build.yml
- try again on https://github.com/kestra-io/kestra/issues/11905
2025-10-20 15:03:26 +02:00
mady20
35799a2e01 refactor: truncate json preview (#11899)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-20 14:00:35 +02:00
Muhammad Ali Khan
d428609c61 refactor(ui): migrate FlowsSearch component to TypeScript (#12130)
Co-authored-by: alikhan0616 <m.alikhan0616@gmail.com>
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-20 13:59:56 +02:00
Narasimha Asuri
5f26f72a81 docs:update README,modified docker command for wsl (#12168) 2025-10-20 13:58:05 +02:00
Miloš Paunović
63ef33bd80 build(core): update auto translation CI cron to skip weekends (#12167) 2025-10-20 13:55:47 +02:00
Akshay Yadav
2cc6adfd88 chore(core): make plugin icon in left menu appear as outline (#12143)
Co-authored-by: MilosPaunovic <paun992@hotmail.com>
2025-10-20 11:51:25 +02:00
Mohammad Zaki
f5df4c1bf6 Refactor: Convert FlowCreate.vue to TypeScript and Composition API (#12103)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-20 11:49:17 +02:00
Pratap Chandra Deo
3ab993a43a fix(ui): render alert blocks in plugin documentation - Convert ::alert syntax to markdown containers and support all alert types - Fixes #12019 (#12108) 2025-10-20 11:48:28 +02:00
Kishore Kumar D
4f7d762705 chore(core): introduce fallback fonts for air-gapped environments (#11448)
Closes https://github.com/kestra-io/kestra/issues/11305.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-20 11:07:46 +02:00
Shubhang-Sagar-Shukla
5b8eb77fe4 fix(ui): Updated dialog close button color on hover (Fixes #12029) (#12109) 2025-10-18 19:39:48 +02:00
Darshan Thakare
897f2fedd7 refactor(core): convert vue component to typescript and composition api (#12110)
Closes https://github.com/kestra-io/kestra/issues/12084.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-18 08:12:34 +02:00
Akshay Yadav
2c5f34a2df chore(core): amend coloring of blueprint tags (#12058)
Closes https://github.com/kestra-io/kestra/issues/12024.

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
2025-10-18 08:04:27 +02:00
Loïc Mathieu
6473a48655 chore(docs): upgrade minimum Node and NPM version in CONTRIBUTING.md (#12125) 2025-10-17 18:27:29 +05:30
Piyush Bhaskar
0ebbc13301 fix(core): blank editor while creating flow (#12127) 2025-10-17 14:18:40 +02:00
Manikanta Pallapothu
474276e6ce Remove left border to fix overlapping line near category titles (#12041) (#12117) 2025-10-17 13:17:42 +02:00
Florian Hussonnois
4d8b737b39 fix(core): allow secrets to be render for multiselect (#12045)
Fix: #12045
2025-10-17 11:32:28 +02:00
Loïc Mathieu
abe1509ccf fix(tests): mark LogConsumerTest.logs() as flaky 2025-10-17 11:21:53 +02:00
Loïc Mathieu
0a13d378f4 fix(tests): mark ExecutionControllerRunnerTest.triggerExecutionAndFollowDependencies as flaky 2025-10-17 11:21:53 +02:00
Loïc Mathieu
4ec8306976 fix(tests): Load flows for the PauseTest 2025-10-17 11:21:53 +02:00
YannC
9c4656714a Fix/validate endpoint fix (#12121)
* fix: validateTask & validateTrigger endpoint changes for SDK

* fix: validateTask & validateTrigger endpoint changes for SDK
2025-10-17 11:11:54 +02:00
Barthélémy Ledoux
86a1fa7f82 feat: add ts and js workers to monaco editor (#11979) 2025-10-17 10:56:08 +02:00
Roman Acevedo
2d030be434 test: fix two assertion messages in DockerTest 2025-10-16 20:00:12 +02:00
Roman Acevedo
e89d209a8a ci: probably fix coverage upload to sonar 2025-10-16 19:53:09 +02:00
Roman Acevedo
7a0d388ed6 fix(flows): allow using OSS CLI to validate EE flows (#12104)
* fix(flows): allow using OSS CLI to validate EE flows

https://github.com/kestra-io/kestra/pull/12047 was not enough

- fixxes https://github.com/kestra-io/kestra-ee/issues/5455

* f
2025-10-16 19:33:16 +02:00
Roman Acevedo
f69594d6db fix(security): make BasicAuthService optional to not be used in EE 2025-10-16 17:33:30 +02:00
Julio Daniel Reyes
3e4eed3306 feat(script): Resume of container for the Docker task runner (#11964)
* feat(script): Implements resume of container for the Docker task runner

closes #4129

* feat(script): docker resume review recommendations

* feat(script): Get volume name and update resume Docker tests

* feat(script): Fix tests for docker resume

* feat(script): test same container id created/reused

* feat(script): delete container after second run

* feat(script): Docker resume should be true by default

* feat(script): fix spacing
2025-10-16 16:01:47 +02:00
Barthélémy Ledoux
f7031ec596 fix: better building of ui-libs should fix shiki rendering (#12094) 2025-10-16 16:00:19 +02:00
Malay Dewangan
ef76d6cf9f refactor(triggers): make StatefulTriggerService methods static (#12073) 2025-10-16 18:52:17 +05:30
Miloš Paunović
3f64e42daf refactor(core): remove unnecessary export of a constant (#12097) 2025-10-16 15:16:21 +02:00
Miloš Paunović
67fa06fa4e fix(iam): prevent infinite loop when permissions are missing while loading custom blueprints (#12092)
Closes https://github.com/kestra-io/kestra-ee/issues/5405.
2025-10-16 14:37:18 +02:00
Barthélémy Ledoux
c965a112e6 fix(nocode): id should not be editable (#12069) 2025-10-16 13:06:32 +02:00
dependabot[bot]
c97033c25c build(deps): bump io.micrometer:micrometer-core from 1.15.4 to 1.15.5
Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.15.4 to 1.15.5.
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.15.4...v1.15.5)

---
updated-dependencies:
- dependency-name: io.micrometer:micrometer-core
  dependency-version: 1.15.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 12:44:40 +02:00
Irfan
caffb3bc74 feat(plugins): enhance documentation request handling to prevent unnecessary reloads (#11911)
Co-authored-by: Barthélémy Ledoux <ledouxb@me.com>
Co-authored-by: iitzIrFan <irfanlhawk@gmail.com>
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-16 11:31:48 +02:00
Roman Acevedo
d15ffd6c52 ci: fix version of peter-evans/repository-dispatch and trivy actions 2025-10-16 11:24:22 +02:00
yuri
4909af97fb feat(tests): add E2E on Executions view (#11556) 2025-10-16 11:16:16 +02:00
Ramesh Kuntigorla
af9ab4adc6 fix(flows): improved save logic, updated the dirty flag to target actuat current flow tab (#12050)
Co-authored-by: Barthélémy Ledoux <bledoux@kestra.io>
2025-10-16 11:12:43 +02:00
dependabot[bot]
ea6b1e9082 build(deps): bump org.owasp.dependencycheck from 12.1.6 to 12.1.8
Bumps org.owasp.dependencycheck from 12.1.6 to 12.1.8.

---
updated-dependencies:
- dependency-name: org.owasp.dependencycheck
  dependency-version: 12.1.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:53:31 +02:00
dependabot[bot]
3c386ad883 build(deps): bump software.amazon.awssdk:bom from 2.35.3 to 2.35.7
Bumps software.amazon.awssdk:bom from 2.35.3 to 2.35.7.

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:bom
  dependency-version: 2.35.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:53:03 +02:00
dependabot[bot]
acc0fa6af3 build(deps): bump actions/setup-node from 5 to 6
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:51:02 +02:00
dependabot[bot]
40eca75f77 build(deps): bump opensearchRestVersion from 3.2.0 to 3.3.0
Bumps `opensearchRestVersion` from 3.2.0 to 3.3.0.

Updates `org.opensearch.client:opensearch-rest-client` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/opensearch-project/OpenSearch/releases)
- [Changelog](https://github.com/opensearch-project/OpenSearch/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opensearch-project/OpenSearch/compare/3.2.0...3.3.0)

Updates `org.opensearch.client:opensearch-rest-high-level-client` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/opensearch-project/OpenSearch/releases)
- [Changelog](https://github.com/opensearch-project/OpenSearch/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opensearch-project/OpenSearch/compare/3.2.0...3.3.0)

---
updated-dependencies:
- dependency-name: org.opensearch.client:opensearch-rest-client
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.opensearch.client:opensearch-rest-high-level-client
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:40:31 +02:00
dependabot[bot]
1b4d7ca514 build(deps): bump de.siegmar:fastcsv from 4.0.0 to 4.1.0
Bumps [de.siegmar:fastcsv](https://github.com/osiegmar/FastCSV) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/osiegmar/FastCSV/releases)
- [Changelog](https://github.com/osiegmar/FastCSV/blob/main/CHANGELOG.md)
- [Commits](https://github.com/osiegmar/FastCSV/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: de.siegmar:fastcsv
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:39:43 +02:00
dependabot[bot]
23ccf0360a build(deps): bump org.sonarqube from 6.3.1.5724 to 7.0.0.6105
Bumps org.sonarqube from 6.3.1.5724 to 7.0.0.6105.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.0.0.6105
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:38:50 +02:00
dependabot[bot]
a9301faf97 build(deps): bump software.amazon.awssdk.crt:aws-crt
Bumps [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java) from 0.39.0 to 0.39.2.
- [Release notes](https://github.com/awslabs/aws-crt-java/releases)
- [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.39.0...v0.39.2)

---
updated-dependencies:
- dependency-name: software.amazon.awssdk.crt:aws-crt
  dependency-version: 0.39.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:38:19 +02:00
dependabot[bot]
2eb947d582 build(deps): bump com.google.cloud:libraries-bom from 26.69.0 to 26.70.0
Bumps [com.google.cloud:libraries-bom](https://github.com/googleapis/java-cloud-bom) from 26.69.0 to 26.70.0.
- [Release notes](https://github.com/googleapis/java-cloud-bom/releases)
- [Changelog](https://github.com/googleapis/java-cloud-bom/blob/main/release-please-config.json)
- [Commits](https://github.com/googleapis/java-cloud-bom/compare/v26.69.0...v26.70.0)

---
updated-dependencies:
- dependency-name: com.google.cloud:libraries-bom
  dependency-version: 26.70.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-16 10:37:53 +02:00
Miloš Paunović
eaa178c219 fix(core): amend playground horizontal panel visibility when toggling on or off (#12063)
Closes https://github.com/kestra-io/kestra/issues/12055.
2025-10-16 10:02:00 +02:00
Mustafa Tarek
3689042757 fix(core): adjust date property of PublicHoliday condition (#11605)
* fix(core): Add warning logs for mismatched (Parent-Subflow) inputs for subflow plugin.

* fix(core): adjust date time property in PublicHoliday condition

* fix(core): pass condition context variables map when rendering date at PublicHoliday.test() method

* refactor(tests): remove added code at ConditionService and transfer to tests directly
2025-10-16 09:26:51 +02:00
yuri1969
a4f257b6ea Switch to ServiceRegistry 2025-10-16 08:55:12 +02:00
yuri1969
33628107c3 fix(core): keep web up during graceful shutdown
The `@PreDestroy` hook is triggered very late in the lifecycle.

Started the graceful clean using the global `ShutdownEvent`.
2025-10-16 08:55:12 +02:00
Roman Acevedo
5ec869b1cc fix(flows): allow using OSS CLI to validate EE flows
- fixes https://github.com/kestra-io/kestra-ee/issues/5455
2025-10-16 08:27:04 +02:00
Florian Hussonnois
7896c96f24 fix(core): ignore not found plugin types for schema generation 2025-10-15 22:26:20 +02:00
Roman Acevedo
ec1ca232b0 fix(security): do not load OSS BasicAuthService in EE
BasicAuthService was loaded by mistake in EE, and it was changed
recently in OSS to persist different data
2025-10-15 17:46:04 +02:00
Malay Dewangan
4227ce8fc5 feat(triggers): introduce stateful behaviour for triggers (#11978)
* fix test

* review feedback
2025-10-15 19:00:09 +05:30
Miloš Paunović
12fd7f81c0 feat(core): make the right sidebar usable in offline mode (#12022)
Closes https://github.com/kestra-io/kestra-ee/issues/4810.
2025-10-15 14:18:36 +02:00
Akshay Yadav
3cd340f972 fix(secrets-page): adjust top margin for empty secrets block (#12020) 2025-10-15 13:27:09 +02:00
Khushal Sarode
721dc61aa4 Converting TimeSelect.vue into typescript script (#11990)
Co-authored-by: Bart Ledoux <bledoux@kestra.io>
2025-10-15 11:16:35 +02:00
Barthélémy Ledoux
d12a33e9ba feat(flows): add days rendering to the duration picker (#11987)
Co-authored-by: Piyush Bhaskar <102078527+Piyush-r-bhaskar@users.noreply.github.com>
2025-10-15 11:15:13 +02:00
Miloš Paunović
56caaa2a91 refactor(core): prevent npe & console errors for charts (#12018) 2025-10-15 10:56:25 +02:00
Barthélémy Ledoux
52dda7621c fix: keep required fields from schema (#11984) 2025-10-15 10:42:09 +02:00
Roman Acevedo
88ab8e2a71 fix(security): webhook requiring basicauth
- fix https://github.com/kestra-io/kestra-ee/issues/5416

The issue was that BasicAuthConfiguration.openUrls was discarded by mistake after a basic auth creds creation.

What has been done:
- make BasicAuthConfiguration a POJO representing the yaml configuration
- dont persist BasicAuthConfiguration
- when fetching the configured Basic auth setup, fetch Credentials from DB and additional configuration from BasicAuthConfiguration
2025-10-15 10:41:34 +02:00
Barthélémy Ledoux
545ed57000 refactor: use multipanel for namespace files (#11972) 2025-10-15 10:31:54 +02:00
Bikash Agarwala
31de6660fa fix(core): limit the maximum height of the notification content element (#11977)
Closes https://github.com/kestra-io/kestra/issues/11924.

Co-authored-by: MilosPaunovic <paun992@hotmail.com>
2025-10-15 10:25:00 +02:00
Lucas Barreto Oliveira
db1ef67a69 fix(frontend): Backfill SELECT input override from trigger (#10627) (#11943)
Co-authored-by: Barthélémy Ledoux <bledoux@kestra.io>
2025-10-14 17:34:16 +02:00
Aditya Ray
b7fbb3af66 refactor(ui): convert VarValue.vue to TypeScript (#11971)
Co-authored-by: Barthélémy Ledoux <ledouxb@me.com>
Co-authored-by: Barthélémy Ledoux <bledoux@kestra.io>
2025-10-14 17:21:38 +02:00
Bikash Agarwala
50f412a11e feat(ui): Redesign blueprint browser cards #11534 (#11947)
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-14 18:39:21 +05:30
Barthélémy Ledoux
5bced31e1b refactor: convert usePluginsStore to Composition API (#11965) 2025-10-14 14:37:08 +02:00
brian-mulier-p
76d349d57e fix(flows): pebble autocompletion performance optimization (#11981)
closes #11881
2025-10-14 11:32:50 +02:00
YannC
63df8e3e46 Fix: openapi tweaks (#11970)
* fix: added some on @ApiResponse annotation + added nullable annotation for TaskRun class

* fix: review changes
2025-10-14 10:23:31 +02:00
Malay Dewangan
4e4e082b79 fix(trigger): prevent scheduler crash on large duration (#10897)
* add tests
2025-10-13 19:13:18 +05:30
wangk
7b67f9a0f5 fix(system): missing BREAKPOINT state for MySQL (#11954)
* Update V1_45__taskrun_submitted.sql

* fix(core) Add missing breakpoint type
2025-10-13 15:07:17 +02:00
Barthélémy Ledoux
b59098e61f refactor: use rolldown-vite for build speed (#11904) 2025-10-13 12:17:41 +02:00
Anukalp Pandey
43f02e7e33 Convert ForEachStatus.vue to TypeScript with Composition API (#11810)
Co-authored-by: Anukalp <pandeyanukalp@gmail.com>
Co-authored-by: Miloš Paunović <paun992@hotmail.com>
Co-authored-by: Piyush Bhaskar <impiyush0012@gmail.com>
2025-10-13 15:41:18 +05:30
594 changed files with 30294 additions and 16394 deletions

View File

@@ -32,11 +32,6 @@ In the meantime, you can move onto the next step...
### Development:
- (Optional) By default, your dev server will target `localhost:8080`. If your backend is running elsewhere, you can create `.env.development.local` under `ui` folder with this content:
```
VITE_APP_API_URL={myApiUrl}
```
- Navigate into the `ui` folder and run `npm install` to install the dependencies for the frontend project.
- Now go to the `cli/src/main/resources` folder and create a `application-override.yml` file.

View File

@@ -32,7 +32,7 @@ Watch out for duplicates! If you are creating a new issue, please check existing
#### Requirements
The following dependencies are required to build Kestra locally:
- Java 21+
- Node 18+ and npm
- Node 22+ and npm 10+
- Python 3, pip and python venv
- Docker & Docker Compose
- an IDE (Intellij IDEA, Eclipse or VS Code)

View File

@@ -1,5 +1,8 @@
name: Bug report
description: File a bug report
description: Report a bug or unexpected behavior in the project
labels: ["bug", "area/backend", "area/frontend"]
body:
- type: markdown
attributes:
@@ -20,7 +23,3 @@ body:
- Kestra Version: develop
validations:
required: false
labels:
- bug
- area/backend
- area/frontend

View File

@@ -1,4 +1,4 @@
contact_links:
- name: Chat
url: https://kestra.io/slack
about: Chat with us on Slack.
about: Chat with us on Slack

View File

@@ -1,5 +1,8 @@
name: Feature request
description: Create a new feature request
description: Suggest a new feature or improvement to enhance the project
labels: ["enhancement", "area/backend", "area/frontend"]
body:
- type: textarea
attributes:
@@ -7,7 +10,3 @@ body:
placeholder: Tell us more about your feature request. Don't forget to give us a star! ⭐
validations:
required: true
labels:
- enhancement
- area/backend
- area/frontend

View File

@@ -26,6 +26,10 @@ updates:
open-pull-requests-limit: 50
labels:
- "dependency-upgrade"
ignore:
- dependency-name: "com.google.protobuf:*"
# Ignore versions of Protobuf that are equal to or greater than 4.0.0 as Orc still uses 3
versions: [ "[4,)" ]
# Maintain dependencies for NPM modules
- package-ecosystem: "npm"

View File

@@ -2,7 +2,7 @@ name: Auto-Translate UI keys and create PR
on:
schedule:
- cron: "0 9-21/3 * * *" # Every 3 hours from 9 AM to 9 PM
- cron: "0 9-21/3 * * 1-5" # Every 3 hours from 9 AM to 9 PM, Monday to Friday
workflow_dispatch:
inputs:
retranslate_modified_keys:
@@ -39,7 +39,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Set up Node
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: "20.x"

View File

@@ -64,7 +64,8 @@ jobs:
cd kestra
# Create and push release branch
git checkout -b "$PUSH_RELEASE_BRANCH";
git checkout -B "$PUSH_RELEASE_BRANCH";
git pull origin "$PUSH_RELEASE_BRANCH" --rebase || echo "No existing branch to pull";
git push -u origin "$PUSH_RELEASE_BRANCH";
# Run gradle release

View File

@@ -68,20 +68,23 @@ jobs:
end:
runs-on: ubuntu-latest
needs: [backend-tests, frontend-tests, publish-develop-docker, publish-develop-maven]
if: always()
if: "always() && github.repository == 'kestra-io/kestra'"
steps:
- run: echo "debug repo ${{github.repository}} ref ${{github.ref}} res ${{needs.publish-develop-maven.result}} jobStatus ${{job.status}} isNotFork ${{github.repository == 'kestra-io/kestra'}} isDevelop ${{github.ref == 'refs/heads/develop'}}"
- run: echo "end CI of failed or success"
- name: Trigger EE Workflow
uses: peter-evans/repository-dispatch@v4
if: github.ref == 'refs/heads/develop' && needs.publish-develop-maven == 'success'
uses: peter-evans/repository-dispatch@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f # v4
if: "!contains(needs.*.result, 'failure') && github.ref == 'refs/heads/develop'"
with:
token: ${{ secrets.GH_PERSONAL_TOKEN }}
repository: kestra-io/kestra-ee
event-type: "oss-updated"
# Slack
- run: echo "mark job as failure to forward error to Slack action" && exit 1
if: ${{ contains(needs.*.result, 'failure') }}
- name: Slack - Notification
if: ${{ failure() && github.repository == 'kestra-io/kestra' && (github.ref == 'refs/heads/develop') }}
if: ${{ always() && contains(needs.*.result, 'failure') }}
uses: kestra-io/actions/composite/slack-status@main
with:
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
channel: 'C09FF36GKE1'

View File

@@ -5,6 +5,15 @@ on:
tags:
- 'v*'
workflow_dispatch:
inputs:
skip-test:
description: 'Skip test'
type: choice
required: true
default: 'false'
options:
- "true"
- "false"
jobs:
build-artifacts:
@@ -14,6 +23,7 @@ jobs:
backend-tests:
name: Backend tests
uses: kestra-io/actions/.github/workflows/kestra-oss-backend-tests.yml@main
if: ${{ github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '' }}
secrets:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -23,6 +33,7 @@ jobs:
frontend-tests:
name: Frontend tests
uses: kestra-io/actions/.github/workflows/kestra-oss-frontend-tests.yml@main
if: ${{ github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '' }}
secrets:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -13,11 +13,11 @@ on:
required: true
type: boolean
default: false
plugin-version:
description: 'Plugin version'
required: false
type: string
default: "LATEST"
dry-run:
description: 'Dry run mode that will not write or release anything'
required: true
type: boolean
default: false
jobs:
publish-docker:
@@ -25,9 +25,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
uses: kestra-io/actions/.github/workflows/kestra-oss-publish-docker.yml@main
with:
plugin-version: ${{ inputs.plugin-version }}
retag-latest: ${{ inputs.retag-latest }}
retag-lts: ${{ inputs.retag-lts }}
dry-run: ${{ inputs.dry-run }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}

View File

@@ -43,7 +43,7 @@ jobs:
# Upload dependency check report
- name: Upload dependency check report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
if: ${{ always() }}
with:
name: dependency-check-report
@@ -71,7 +71,7 @@ jobs:
# Run Trivy image scan for Docker vulnerabilities, see https://github.com/aquasecurity/trivy-action
- name: Docker Vulnerabilities Check
uses: aquasecurity/trivy-action@0.33.1
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
with:
image-ref: kestra/kestra:develop
format: 'template'
@@ -108,7 +108,7 @@ jobs:
# Run Trivy image scan for Docker vulnerabilities, see https://github.com/aquasecurity/trivy-action
- name: Docker Vulnerabilities Check
uses: aquasecurity/trivy-action@0.33.1
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
with:
image-ref: kestra/kestra:latest
format: table

View File

@@ -66,6 +66,7 @@
#plugin-jdbc:io.kestra.plugin:plugin-jdbc-sybase:LATEST
#plugin-jenkins:io.kestra.plugin:plugin-jenkins:LATEST
#plugin-jira:io.kestra.plugin:plugin-jira:LATEST
#plugin-jms:io.kestra.plugin:plugin-jms:LATEST
#plugin-kafka:io.kestra.plugin:plugin-kafka:LATEST
#plugin-kestra:io.kestra.plugin:plugin-kestra:LATEST
#plugin-kubernetes:io.kestra.plugin:plugin-kubernetes:LATEST

View File

@@ -68,6 +68,12 @@ Kestra is an open-source, event-driven orchestration platform that makes both **
## 🚀 Quick Start
### Launch on AWS (CloudFormation)
Deploy Kestra on AWS using our CloudFormation template:
[![Launch Stack](https://cdn.rawgit.com/buildkite/cloudformation-launch-stack-button-svg/master/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home#/stacks/create/review?templateURL=https://kestra-deployment-templates.s3.eu-west-3.amazonaws.com/aws/cloudformation/ec2-rds-s3/kestra-oss.yaml&stackName=kestra-oss)
### Get Started Locally in 5 Minutes
#### Launch Kestra in Docker
@@ -98,7 +104,7 @@ If you're on Windows and use WSL (Linux-based environment in Windows):
```bash
docker run --pull=always --rm -it -p 8080:8080 --user=root \
-v "/var/run/docker.sock:/var/run/docker.sock" \
-v "C:/Temp:/tmp" kestra/kestra:latest server local
-v "/mnt/c/Temp:/tmp" kestra/kestra:latest server local
```
Check our [Installation Guide](https://kestra.io/docs/installation) for other deployment options (Docker Compose, Podman, Kubernetes, AWS, GCP, Azure, and more).

View File

@@ -21,7 +21,7 @@ plugins {
// test
id "com.adarshr.test-logger" version "4.0.0"
id "org.sonarqube" version "6.3.1.5724"
id "org.sonarqube" version "7.0.1.6134"
id 'jacoco-report-aggregation'
// helper
@@ -37,7 +37,7 @@ plugins {
id "com.vanniktech.maven.publish" version "0.34.0"
// OWASP dependency check
id "org.owasp.dependencycheck" version "12.1.6" apply false
id "org.owasp.dependencycheck" version "12.1.8" apply false
}
idea {
@@ -372,7 +372,7 @@ tasks.named('testCodeCoverageReport') {
subprojects {
sonar {
properties {
property "sonar.coverage.jacoco.xmlReportPaths", "$projectDir.parentFile.path/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml,$projectDir.parentFile.path/build/reports/jacoco/test//testCodeCoverageReport.xml"
property "sonar.coverage.jacoco.xmlReportPaths", "$projectDir.parentFile.path/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml,$projectDir.parentFile.path/build/reports/jacoco/test/testCodeCoverageReport.xml"
}
}
}

View File

@@ -117,7 +117,7 @@ public abstract class AbstractValidateCommand extends AbstractApiCommand {
try(DefaultHttpClient client = client()) {
MutableHttpRequest<String> request = HttpRequest
.POST(apiUri("/flows/validate", tenantService.getTenantId(tenantId)), body).contentType(MediaType.APPLICATION_YAML);
.POST(apiUri("/flows/validate", tenantService.getTenantIdAndAllowEETenants(tenantId)), body).contentType(MediaType.APPLICATION_YAML);
List<ValidateConstraintViolation> validations = client.toBlocking().retrieve(
this.requestOptions(request),

View File

@@ -24,7 +24,8 @@ public class FlowValidateCommand extends AbstractValidateCommand {
private FlowService flowService;
@Inject
private TenantIdSelectorService tenantService;
private TenantIdSelectorService tenantIdSelectorService;
@Override
public Integer call() throws Exception {
@@ -39,7 +40,7 @@ public class FlowValidateCommand extends AbstractValidateCommand {
FlowWithSource flow = (FlowWithSource) object;
List<String> warnings = new ArrayList<>();
warnings.addAll(flowService.deprecationPaths(flow).stream().map(deprecation -> deprecation + " is deprecated").toList());
warnings.addAll(flowService.warnings(flow, tenantService.getTenantId(tenantId)));
warnings.addAll(flowService.warnings(flow, tenantIdSelectorService.getTenantIdAndAllowEETenants(tenantId)));
return warnings;
},
(Object object) -> {

View File

@@ -64,7 +64,7 @@ public class FlowNamespaceUpdateCommand extends AbstractServiceNamespaceUpdateCo
}
try(DefaultHttpClient client = client()) {
MutableHttpRequest<String> request = HttpRequest
.POST(apiUri("/flows/", tenantService.getTenantId(tenantId)) + namespace + "?delete=" + delete, body).contentType(MediaType.APPLICATION_YAML);
.POST(apiUri("/flows/", tenantService.getTenantIdAndAllowEETenants(tenantId)) + namespace + "?delete=" + delete, body).contentType(MediaType.APPLICATION_YAML);
List<UpdateResult> updated = client.toBlocking().retrieve(
this.requestOptions(request),

View File

@@ -2,6 +2,7 @@ package io.kestra.cli.commands.migrations;
import io.kestra.cli.AbstractCommand;
import io.kestra.cli.App;
import io.kestra.cli.commands.migrations.metadata.MetadataMigrationCommand;
import io.micronaut.configuration.picocli.PicocliRunner;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
@@ -13,6 +14,7 @@ import picocli.CommandLine;
mixinStandardHelpOptions = true,
subcommands = {
TenantMigrationCommand.class,
MetadataMigrationCommand.class
}
)
@Slf4j

View File

@@ -0,0 +1,31 @@
package io.kestra.cli.commands.migrations.metadata;
import io.kestra.cli.AbstractCommand;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;
@CommandLine.Command(
name = "kv",
description = "populate metadata for KV"
)
@Slf4j
public class KvMetadataMigrationCommand extends AbstractCommand {
@Inject
private Provider<MetadataMigrationService> metadataMigrationServiceProvider;
@Override
public Integer call() throws Exception {
super.call();
try {
metadataMigrationServiceProvider.get().kvMigration();
} catch (Exception e) {
System.err.println("❌ KV Metadata migration failed: " + e.getMessage());
e.printStackTrace();
return 1;
}
System.out.println("✅ KV Metadata migration complete.");
return 0;
}
}

View File

@@ -0,0 +1,23 @@
package io.kestra.cli.commands.migrations.metadata;
import io.kestra.cli.AbstractCommand;
import jakarta.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;
@CommandLine.Command(
name = "metadata",
description = "populate metadata for entities",
subcommands = {
KvMetadataMigrationCommand.class,
SecretsMetadataMigrationCommand.class
}
)
@Slf4j
public class MetadataMigrationCommand extends AbstractCommand {
@Override
public Integer call() throws Exception {
super.call();
return 0;
}
}

View File

@@ -0,0 +1,89 @@
package io.kestra.cli.commands.migrations.metadata;
import io.kestra.core.models.kv.PersistedKvMetadata;
import io.kestra.core.repositories.FlowRepositoryInterface;
import io.kestra.core.repositories.KvMetadataRepositoryInterface;
import io.kestra.core.storages.FileAttributes;
import io.kestra.core.storages.StorageContext;
import io.kestra.core.storages.StorageInterface;
import io.kestra.core.storages.kv.InternalKVStore;
import io.kestra.core.storages.kv.KVEntry;
import io.kestra.core.tenant.TenantService;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.time.Instant;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import static io.kestra.core.utils.Rethrow.throwConsumer;
import static io.kestra.core.utils.Rethrow.throwFunction;
@Singleton
public class MetadataMigrationService {
@Inject
private TenantService tenantService;
@Inject
private FlowRepositoryInterface flowRepository;
@Inject
private KvMetadataRepositoryInterface kvMetadataRepository;
@Inject
private StorageInterface storageInterface;
protected Map<String, List<String>> namespacesPerTenant() {
String tenantId = tenantService.resolveTenant();
return Map.of(tenantId, flowRepository.findDistinctNamespace(tenantId));
}
public void kvMigration() throws IOException {
this.namespacesPerTenant().entrySet().stream()
.flatMap(namespacesForTenant -> namespacesForTenant.getValue().stream().map(namespace -> Map.entry(namespacesForTenant.getKey(), namespace)))
.flatMap(throwFunction(namespaceForTenant -> {
InternalKVStore kvStore = new InternalKVStore(namespaceForTenant.getKey(), namespaceForTenant.getValue(), storageInterface, kvMetadataRepository);
List<FileAttributes> list = listAllFromStorage(storageInterface, namespaceForTenant.getKey(), namespaceForTenant.getValue());
Map<Boolean, List<KVEntry>> entriesByIsExpired = list.stream()
.map(throwFunction(fileAttributes -> KVEntry.from(namespaceForTenant.getValue(), fileAttributes)))
.collect(Collectors.partitioningBy(kvEntry -> Optional.ofNullable(kvEntry.expirationDate()).map(expirationDate -> Instant.now().isAfter(expirationDate)).orElse(false)));
entriesByIsExpired.get(true).forEach(kvEntry -> {
try {
storageInterface.delete(
namespaceForTenant.getKey(),
namespaceForTenant.getValue(),
kvStore.storageUri(kvEntry.key())
);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
return entriesByIsExpired.get(false).stream().map(kvEntry -> PersistedKvMetadata.from(namespaceForTenant.getKey(), kvEntry));
}))
.forEach(throwConsumer(kvMetadata -> {
if (kvMetadataRepository.findByName(kvMetadata.getTenantId(), kvMetadata.getNamespace(), kvMetadata.getName()).isEmpty()) {
kvMetadataRepository.save(kvMetadata);
}
}));
}
public void secretMigration() throws Exception {
throw new UnsupportedOperationException("Secret migration is not needed in the OSS version");
}
private static List<FileAttributes> listAllFromStorage(StorageInterface storage, String tenant, String namespace) throws IOException {
try {
return storage.list(tenant, namespace, URI.create(StorageContext.KESTRA_PROTOCOL + StorageContext.kvPrefix(namespace)));
} catch (FileNotFoundException e) {
return Collections.emptyList();
}
}
}

View File

@@ -0,0 +1,31 @@
package io.kestra.cli.commands.migrations.metadata;
import io.kestra.cli.AbstractCommand;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;
@CommandLine.Command(
name = "secrets",
description = "populate metadata for secrets"
)
@Slf4j
public class SecretsMetadataMigrationCommand extends AbstractCommand {
@Inject
private Provider<MetadataMigrationService> metadataMigrationServiceProvider;
@Override
public Integer call() throws Exception {
super.call();
try {
metadataMigrationServiceProvider.get().secretMigration();
} catch (Exception e) {
System.err.println("❌ Secrets Metadata migration failed: " + e.getMessage());
e.printStackTrace();
return 1;
}
System.out.println("✅ Secrets Metadata migration complete.");
return 0;
}
}

View File

@@ -49,7 +49,7 @@ public class NamespaceFilesUpdateCommand extends AbstractApiCommand {
try (var files = Files.walk(from); DefaultHttpClient client = client()) {
if (delete) {
client.toBlocking().exchange(this.requestOptions(HttpRequest.DELETE(apiUri("/namespaces/", tenantService.getTenantId(tenantId)) + namespace + "/files?path=" + to, null)));
client.toBlocking().exchange(this.requestOptions(HttpRequest.DELETE(apiUri("/namespaces/", tenantService.getTenantIdAndAllowEETenants(tenantId)) + namespace + "/files?path=" + to, null)));
}
KestraIgnore kestraIgnore = new KestraIgnore(from);
@@ -67,7 +67,7 @@ public class NamespaceFilesUpdateCommand extends AbstractApiCommand {
client.toBlocking().exchange(
this.requestOptions(
HttpRequest.POST(
apiUri("/namespaces/", tenantService.getTenantId(tenantId)) + namespace + "/files?path=" + destination,
apiUri("/namespaces/", tenantService.getTenantIdAndAllowEETenants(tenantId)) + namespace + "/files?path=" + destination,
body
).contentType(MediaType.MULTIPART_FORM_DATA)
)

View File

@@ -62,7 +62,7 @@ public class KvUpdateCommand extends AbstractApiCommand {
Duration ttl = expiration == null ? null : Duration.parse(expiration);
MutableHttpRequest<String> request = HttpRequest
.PUT(apiUri("/namespaces/", tenantService.getTenantId(tenantId)) + namespace + "/kv/" + key, value)
.contentType(MediaType.APPLICATION_JSON_TYPE);
.contentType(MediaType.TEXT_PLAIN);
if (ttl != null) {
request.header("ttl", ttl.toString());

View File

@@ -1,7 +1,9 @@
package io.kestra.cli.commands.servers;
import com.google.common.collect.ImmutableMap;
import io.kestra.cli.services.TenantIdSelectorService;
import io.kestra.core.models.ServerType;
import io.kestra.core.repositories.LocalFlowRepositoryLoader;
import io.kestra.core.runners.ExecutorInterface;
import io.kestra.core.services.SkipExecutionService;
import io.kestra.core.services.StartExecutorService;
@@ -10,6 +12,8 @@ import io.micronaut.context.ApplicationContext;
import jakarta.inject.Inject;
import picocli.CommandLine;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -19,6 +23,9 @@ import java.util.Map;
description = "Start the Kestra executor"
)
public class ExecutorCommand extends AbstractServerCommand {
@CommandLine.Spec
CommandLine.Model.CommandSpec spec;
@Inject
private ApplicationContext applicationContext;
@@ -28,22 +35,28 @@ public class ExecutorCommand extends AbstractServerCommand {
@Inject
private StartExecutorService startExecutorService;
@CommandLine.Option(names = {"--skip-executions"}, split=",", description = "The list of execution identifiers to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"-f", "--flow-path"}, description = "Tenant identifier required to load flows from the specified path")
private File flowPath;
@CommandLine.Option(names = "--tenant", description = "Tenant identifier, Required to load flows from path")
private String tenantId;
@CommandLine.Option(names = {"--skip-executions"}, split=",", description = "List of execution IDs to skip, separated by commas; for troubleshooting only")
private List<String> skipExecutions = Collections.emptyList();
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "The list of flow identifiers (tenant|namespace|flowId) to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "List of flow identifiers (tenant|namespace|flowId) to skip, separated by a coma; for troubleshooting only")
private List<String> skipFlows = Collections.emptyList();
@CommandLine.Option(names = {"--skip-namespaces"}, split=",", description = "The list of namespace identifiers (tenant|namespace) to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-namespaces"}, split=",", description = "List of namespace identifiers (tenant|namespace) to skip, separated by a coma; for troubleshooting only")
private List<String> skipNamespaces = Collections.emptyList();
@CommandLine.Option(names = {"--skip-tenants"}, split=",", description = "The list of tenants to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-tenants"}, split=",", description = "List of tenants to skip, separated by a coma; for troubleshooting only")
private List<String> skipTenants = Collections.emptyList();
@CommandLine.Option(names = {"--start-executors"}, split=",", description = "The list of Kafka Stream executors to start, separated by a command. Use it only with the Kafka queue, for debugging purpose.")
@CommandLine.Option(names = {"--start-executors"}, split=",", description = "List of Kafka Stream executors to start, separated by a command. Use it only with the Kafka queue; for debugging only")
private List<String> startExecutors = Collections.emptyList();
@CommandLine.Option(names = {"--not-start-executors"}, split=",", description = "The list of Kafka Stream executors to not start, separated by a command. Use it only with the Kafka queue, for debugging purpose.")
@CommandLine.Option(names = {"--not-start-executors"}, split=",", description = "Lst of Kafka Stream executors to not start, separated by a command. Use it only with the Kafka queue; for debugging only")
private List<String> notStartExecutors = Collections.emptyList();
@SuppressWarnings("unused")
@@ -64,6 +77,16 @@ public class ExecutorCommand extends AbstractServerCommand {
super.call();
if (flowPath != null) {
try {
LocalFlowRepositoryLoader localFlowRepositoryLoader = applicationContext.getBean(LocalFlowRepositoryLoader.class);
TenantIdSelectorService tenantIdSelectorService = applicationContext.getBean(TenantIdSelectorService.class);
localFlowRepositoryLoader.load(tenantIdSelectorService.getTenantId(this.tenantId), this.flowPath);
} catch (IOException e) {
throw new CommandLine.ParameterException(this.spec.commandLine(), "Invalid flow path", e);
}
}
ExecutorInterface executorService = applicationContext.getBean(ExecutorInterface.class);
executorService.run();

View File

@@ -23,7 +23,7 @@ public class IndexerCommand extends AbstractServerCommand {
@Inject
private SkipExecutionService skipExecutionService;
@CommandLine.Option(names = {"--skip-indexer-records"}, split=",", description = "a list of indexer record keys, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-indexer-records"}, split=",", description = "a list of indexer record keys, separated by a coma; for troubleshooting only")
private List<String> skipIndexerRecords = Collections.emptyList();
@SuppressWarnings("unused")

View File

@@ -42,7 +42,7 @@ public class StandAloneCommand extends AbstractServerCommand {
@Nullable
private FileChangedEventListener fileWatcher;
@CommandLine.Option(names = {"-f", "--flow-path"}, description = "the flow path containing flow to inject at startup (when running with a memory flow repository)")
@CommandLine.Option(names = {"-f", "--flow-path"}, description = "Tenant identifier required to load flows from the specified path")
private File flowPath;
@CommandLine.Option(names = "--tenant", description = "Tenant identifier, Required to load flows from path with the enterprise edition")
@@ -51,19 +51,19 @@ public class StandAloneCommand extends AbstractServerCommand {
@CommandLine.Option(names = {"--worker-thread"}, description = "the number of worker threads, defaults to eight times the number of available processors. Set it to 0 to avoid starting a worker.")
private int workerThread = defaultWorkerThread();
@CommandLine.Option(names = {"--skip-executions"}, split=",", description = "a list of execution identifiers to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-executions"}, split=",", description = "a list of execution identifiers to skip, separated by a coma; for troubleshooting only")
private List<String> skipExecutions = Collections.emptyList();
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "a list of flow identifiers (namespace.flowId) to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "a list of flow identifiers (namespace.flowId) to skip, separated by a coma; for troubleshooting only")
private List<String> skipFlows = Collections.emptyList();
@CommandLine.Option(names = {"--skip-namespaces"}, split=",", description = "a list of namespace identifiers (tenant|namespace) to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-namespaces"}, split=",", description = "a list of namespace identifiers (tenant|namespace) to skip, separated by a coma; for troubleshooting only")
private List<String> skipNamespaces = Collections.emptyList();
@CommandLine.Option(names = {"--skip-tenants"}, split=",", description = "a list of tenants to skip, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-tenants"}, split=",", description = "a list of tenants to skip, separated by a coma; for troubleshooting only")
private List<String> skipTenants = Collections.emptyList();
@CommandLine.Option(names = {"--skip-indexer-records"}, split=",", description = "a list of indexer record keys, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-indexer-records"}, split=",", description = "a list of indexer record keys, separated by a coma; for troubleshooting only")
private List<String> skipIndexerRecords = Collections.emptyList();
@CommandLine.Option(names = {"--no-tutorials"}, description = "Flag to disable auto-loading of tutorial flows.")

View File

@@ -40,7 +40,7 @@ public class WebServerCommand extends AbstractServerCommand {
@Option(names = {"--no-indexer"}, description = "Flag to disable starting an embedded indexer.")
private boolean indexerDisabled = false;
@CommandLine.Option(names = {"--skip-indexer-records"}, split=",", description = "a list of indexer record keys, separated by a coma; for troubleshooting purpose only")
@CommandLine.Option(names = {"--skip-indexer-records"}, split=",", description = "a list of indexer record keys, separated by a coma; for troubleshooting only")
private List<String> skipIndexerRecords = Collections.emptyList();
@Override

View File

@@ -49,7 +49,7 @@ public class TemplateNamespaceUpdateCommand extends AbstractServiceNamespaceUpda
try (DefaultHttpClient client = client()) {
MutableHttpRequest<List<Template>> request = HttpRequest
.POST(apiUri("/templates/", tenantService.getTenantId(tenantId)) + namespace + "?delete=" + delete, templates);
.POST(apiUri("/templates/", tenantService.getTenantIdAndAllowEETenants(tenantId)) + namespace + "?delete=" + delete, templates);
List<UpdateResult> updated = client.toBlocking().retrieve(
this.requestOptions(request),

View File

@@ -0,0 +1,69 @@
package io.kestra.cli.listeners;
import io.kestra.core.server.LocalServiceState;
import io.kestra.core.server.Service;
import io.kestra.core.server.ServiceRegistry;
import io.micronaut.context.annotation.Requires;
import io.micronaut.context.event.ApplicationEventListener;
import io.micronaut.context.event.ShutdownEvent;
import io.micronaut.core.annotation.Order;
import io.micronaut.core.order.Ordered;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ForkJoinPool;
/**
* Global application shutdown handler.
* This handler gets effectively invoked before {@link jakarta.annotation.PreDestroy} does.
*/
@Singleton
@Slf4j
@Order(Ordered.LOWEST_PRECEDENCE)
@Requires(property = "kestra.server-type")
public class GracefulEmbeddedServiceShutdownListener implements ApplicationEventListener<ShutdownEvent> {
@Inject
ServiceRegistry serviceRegistry;
/**
* {@inheritDoc}
**/
@Override
public boolean supports(ShutdownEvent event) {
return ApplicationEventListener.super.supports(event);
}
/**
* Wait for services' close actions
*
* @param event the event to respond to
*/
@Override
public void onApplicationEvent(ShutdownEvent event) {
List<LocalServiceState> states = serviceRegistry.all();
if (states.isEmpty()) {
return;
}
log.debug("Shutdown event received");
List<CompletableFuture<Void>> futures = states.stream()
.map(state -> CompletableFuture.runAsync(() -> closeService(state), ForkJoinPool.commonPool()))
.toList();
// Wait for all services to close, before shutting down the embedded server
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
}
private void closeService(LocalServiceState state) {
final Service service = state.service();
try {
service.unwrap().close();
} catch (Exception e) {
log.error("[Service id={}, type={}] Unexpected error on close", service.getId(), service.getType(), e);
}
}
}

View File

@@ -16,4 +16,11 @@ public class TenantIdSelectorService {
}
return MAIN_TENANT;
}
public String getTenantIdAndAllowEETenants(String tenantId) {
if (StringUtils.isNotBlank(tenantId)){
return tenantId;
}
return MAIN_TENANT;
}
}

View File

@@ -30,15 +30,15 @@ micronaut:
read-idle-timeout: 60m
write-idle-timeout: 60m
idle-timeout: 60m
netty:
max-zstd-encode-size: 67108864 # increased to 64MB from the default of 32MB
max-chunk-size: 10MB
max-header-size: 32768 # increased from the default of 8k
responses:
file:
cache-seconds: 86400
cache-control:
public: true
netty:
max-zstd-encode-size: 67108864 # increased to 64MB from the default of 32MB
max-chunk-size: 10MB
max-header-size: 32768 # increased from the default of 8k
# Access log configuration, see https://docs.micronaut.io/latest/guide/index.html#accessLogger
access-logger:
@@ -243,6 +243,10 @@ kestra:
ui-anonymous-usage-report:
enabled: true
ui:
charts:
default-duration: P30D
anonymous-usage-report:
enabled: true
uri: https://api.kestra.io/v1/reports/server-events

View File

@@ -68,7 +68,8 @@ class NoConfigCommandTest {
assertThat(exitCode).isNotZero();
assertThat(out.toString()).isEmpty();
// check that the only log is an access log: this has the advantage to also check that access log is working!
assertThat(out.toString()).contains("POST /api/v1/main/flows HTTP/1.1 | status: 500");
assertThat(err.toString()).contains("No bean of type [io.kestra.core.repositories.FlowRepositoryInterface] exists");
}
}

View File

@@ -27,6 +27,26 @@ class FlowValidateCommandTest {
}
}
@Test
// github action kestra-io/validate-action requires being able to validate Flows from OSS CLI against a remote EE instance
void runForEEInstance() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
try (ApplicationContext ctx = ApplicationContext.builder().deduceEnvironment(false).start()) {
String[] args = {
"--tenant",
"some-ee-tenant",
"--local",
"src/test/resources/helper/include.yaml"
};
Integer call = PicocliRunner.call(FlowValidateCommand.class, ctx, args);
assertThat(call).isZero();
assertThat(out.toString()).contains("✓ - io.kestra.cli / include");
}
}
@Test
void warning() {
ByteArrayOutputStream out = new ByteArrayOutputStream();

View File

@@ -0,0 +1,147 @@
package io.kestra.cli.commands.migrations.metadata;
import io.kestra.cli.App;
import io.kestra.core.exceptions.ResourceExpiredException;
import io.kestra.core.models.flows.Flow;
import io.kestra.core.models.flows.GenericFlow;
import io.kestra.core.models.kv.PersistedKvMetadata;
import io.kestra.core.repositories.FlowRepositoryInterface;
import io.kestra.core.repositories.KvMetadataRepositoryInterface;
import io.kestra.core.serializers.JacksonMapper;
import io.kestra.core.storages.StorageContext;
import io.kestra.core.storages.StorageInterface;
import io.kestra.core.storages.StorageObject;
import io.kestra.core.storages.kv.*;
import io.kestra.core.tenant.TenantService;
import io.kestra.core.utils.TestsUtils;
import io.kestra.plugin.core.log.Log;
import io.micronaut.configuration.picocli.PicocliRunner;
import io.micronaut.context.ApplicationContext;
import io.micronaut.context.env.Environment;
import io.micronaut.core.annotation.NonNull;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URI;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
public class KvMetadataMigrationCommandTest {
@Test
void run() throws IOException, ResourceExpiredException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
ByteArrayOutputStream err = new ByteArrayOutputStream();
System.setErr(new PrintStream(err));
try (ApplicationContext ctx = ApplicationContext.run(Environment.CLI, Environment.TEST)) {
/* Initial setup:
* - namespace 1: key, description, value
* - namespace 1: expiredKey
* - namespace 2: anotherKey, anotherDescription
* - Nothing in database */
String namespace = TestsUtils.randomNamespace();
String key = "myKey";
StorageInterface storage = ctx.getBean(StorageInterface.class);
String description = "Some description";
String value = "someValue";
putOldKv(storage, namespace, key, description, value);
String anotherNamespace = TestsUtils.randomNamespace();
String anotherKey = "anotherKey";
String anotherDescription = "another description";
putOldKv(storage, anotherNamespace, anotherKey, anotherDescription, "anotherValue");
String tenantId = TenantService.MAIN_TENANT;
// Expired KV should not be migrated + should be purged from the storage
String expiredKey = "expiredKey";
putOldKv(storage, namespace, expiredKey, Instant.now().minus(Duration.ofMinutes(5)), "some expired description", "expiredValue");
assertThat(storage.exists(tenantId, null, getKvStorageUri(namespace, expiredKey))).isTrue();
KvMetadataRepositoryInterface kvMetadataRepository = ctx.getBean(KvMetadataRepositoryInterface.class);
assertThat(kvMetadataRepository.findByName(tenantId, namespace, key).isPresent()).isFalse();
/* Expected outcome from the migration command:
* - no KV has been migrated because no flow exist in the namespace so they are not picked up because we don't know they exist */
String[] kvMetadataMigrationCommand = {
"migrate", "metadata", "kv"
};
PicocliRunner.call(App.class, ctx, kvMetadataMigrationCommand);
assertThat(out.toString()).contains("✅ KV Metadata migration complete.");
// Still it's not in the metadata repository because no flow exist to find that kv
assertThat(kvMetadataRepository.findByName(tenantId, namespace, key).isPresent()).isFalse();
assertThat(kvMetadataRepository.findByName(tenantId, anotherNamespace, anotherKey).isPresent()).isFalse();
// A flow is created from namespace 1, so the KV in this namespace should be migrated
FlowRepositoryInterface flowRepository = ctx.getBean(FlowRepositoryInterface.class);
flowRepository.create(GenericFlow.of(Flow.builder()
.tenantId(tenantId)
.id("a-flow")
.namespace(namespace)
.tasks(List.of(Log.builder().id("log").type(Log.class.getName()).message("logging").build()))
.build()));
/* We run the migration again:
* - namespace 1 KV is seen and metadata is migrated to database
* - namespace 2 KV is not seen because no flow exist in this namespace
* - expiredKey is deleted from storage and not migrated */
out.reset();
PicocliRunner.call(App.class, ctx, kvMetadataMigrationCommand);
assertThat(out.toString()).contains("✅ KV Metadata migration complete.");
Optional<PersistedKvMetadata> foundKv = kvMetadataRepository.findByName(tenantId, namespace, key);
assertThat(foundKv.isPresent()).isTrue();
assertThat(foundKv.get().getDescription()).isEqualTo(description);
assertThat(kvMetadataRepository.findByName(tenantId, anotherNamespace, anotherKey).isPresent()).isFalse();
KVStore kvStore = new InternalKVStore(tenantId, namespace, storage, kvMetadataRepository);
Optional<KVEntry> actualKv = kvStore.get(key);
assertThat(actualKv.isPresent()).isTrue();
assertThat(actualKv.get().description()).isEqualTo(description);
Optional<KVValue> actualValue = kvStore.getValue(key);
assertThat(actualValue.isPresent()).isTrue();
assertThat(actualValue.get().value()).isEqualTo(value);
assertThat(kvMetadataRepository.findByName(tenantId, namespace, expiredKey).isPresent()).isFalse();
assertThat(storage.exists(tenantId, null, getKvStorageUri(namespace, expiredKey))).isFalse();
/* We run one last time the migration without any change to verify that we don't resave an existing metadata.
* It covers the case where user didn't perform the migrate command yet but they played and added some KV from the UI (so those ones will already be in metadata database). */
out.reset();
PicocliRunner.call(App.class, ctx, kvMetadataMigrationCommand);
assertThat(out.toString()).contains("✅ KV Metadata migration complete.");
foundKv = kvMetadataRepository.findByName(tenantId, namespace, key);
assertThat(foundKv.get().getVersion()).isEqualTo(1);
}
}
private static void putOldKv(StorageInterface storage, String namespace, String key, String description, String value) throws IOException {
putOldKv(storage, namespace, key, Instant.now().plus(Duration.ofMinutes(5)), description, value);
}
private static void putOldKv(StorageInterface storage, String namespace, String key, Instant expirationDate, String description, String value) throws IOException {
URI kvStorageUri = getKvStorageUri(namespace, key);
KVValueAndMetadata kvValueAndMetadata = new KVValueAndMetadata(new KVMetadata(description, expirationDate), value);
storage.put(TenantService.MAIN_TENANT, namespace, kvStorageUri, new StorageObject(
kvValueAndMetadata.metadataAsMap(),
new ByteArrayInputStream(JacksonMapper.ofIon().writeValueAsBytes(kvValueAndMetadata.value()))
));
}
private static @NonNull URI getKvStorageUri(String namespace, String key) {
return URI.create(StorageContext.KESTRA_PROTOCOL + StorageContext.kvPrefix(namespace) + "/" + key + ".ion");
}
}

View File

@@ -0,0 +1,29 @@
package io.kestra.cli.commands.migrations.metadata;
import io.kestra.cli.App;
import io.micronaut.configuration.picocli.PicocliRunner;
import io.micronaut.context.ApplicationContext;
import io.micronaut.context.env.Environment;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static org.assertj.core.api.Assertions.assertThat;
public class SecretsMetadataMigrationCommandTest {
@Test
void run() {
ByteArrayOutputStream err = new ByteArrayOutputStream();
System.setErr(new PrintStream(err));
try (ApplicationContext ctx = ApplicationContext.run(Environment.CLI, Environment.TEST)) {
String[] secretMetadataMigrationCommand = {
"migrate", "metadata", "secrets"
};
PicocliRunner.call(App.class, ctx, secretMetadataMigrationCommand);
assertThat(err.toString()).contains("❌ Secrets Metadata migration failed: Secret migration is not needed in the OSS version");
}
}
}

View File

@@ -7,6 +7,8 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
/**
* Top-level marker interface for Kestra's plugin of type App.
*/
@@ -18,6 +20,6 @@ public interface AppBlockInterface extends io.kestra.core.models.Plugin {
)
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
String getType();
}

View File

@@ -7,6 +7,8 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
/**
* Top-level marker interface for Kestra's plugin of type App.
*/
@@ -18,6 +20,6 @@ public interface AppPluginInterface extends io.kestra.core.models.Plugin {
)
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
String getType();
}

View File

@@ -15,6 +15,7 @@ import com.github.victools.jsonschema.generator.impl.DefinitionKey;
import com.github.victools.jsonschema.generator.naming.DefaultSchemaDefinitionNamingStrategy;
import com.github.victools.jsonschema.module.jackson.JacksonModule;
import com.github.victools.jsonschema.module.jackson.JacksonOption;
import com.github.victools.jsonschema.module.jackson.JsonUnwrappedDefinitionProvider;
import com.github.victools.jsonschema.module.jakarta.validation.JakartaValidationModule;
import com.github.victools.jsonschema.module.jakarta.validation.JakartaValidationOption;
import com.github.victools.jsonschema.module.swagger2.Swagger2Module;
@@ -45,6 +46,9 @@ import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.*;
import java.time.*;
@@ -58,7 +62,9 @@ import static io.kestra.core.docs.AbstractClassDocumentation.required;
import static io.kestra.core.serializers.JacksonMapper.MAP_TYPE_REFERENCE;
@Singleton
@Slf4j
public class JsonSchemaGenerator {
private static final List<Class<?>> TYPES_RESOLVED_AS_STRING = List.of(Duration.class, LocalTime.class, LocalDate.class, LocalDateTime.class, ZonedDateTime.class, OffsetDateTime.class, OffsetTime.class);
private static final List<Class<?>> SUBTYPE_RESOLUTION_EXCLUSION_FOR_PLUGIN_SCHEMA = List.of(Task.class, AbstractTrigger.class);
@@ -270,8 +276,22 @@ public class JsonSchemaGenerator {
.with(Option.DEFINITIONS_FOR_ALL_OBJECTS)
.with(Option.DEFINITION_FOR_MAIN_SCHEMA)
.with(Option.PLAIN_DEFINITION_KEYS)
.with(Option.ALLOF_CLEANUP_AT_THE_END);;
.with(Option.ALLOF_CLEANUP_AT_THE_END);
// HACK: Registered a custom JsonUnwrappedDefinitionProvider prior to the JacksonModule
// to be able to return an CustomDefinition with an empty node when the ResolvedType can't be found.
builder.forTypesInGeneral().withCustomDefinitionProvider(new JsonUnwrappedDefinitionProvider(){
@Override
public CustomDefinition provideCustomSchemaDefinition(ResolvedType javaType, SchemaGenerationContext context) {
try {
return super.provideCustomSchemaDefinition(javaType, context);
} catch (NoClassDefFoundError e) {
// This error happens when a non-supported plugin type exists in the classpath.
log.debug("Cannot create schema definition for type '{}'. Cause: NoClassDefFoundError", javaType.getTypeName());
return new CustomDefinition(context.getGeneratorConfig().createObjectNode(), true);
}
}
});
if (!draft7) {
builder.with(new JacksonModule(JacksonOption.IGNORE_TYPE_INFO_TRANSFORM));
} else {
@@ -300,6 +320,7 @@ public class JsonSchemaGenerator {
// inline some type
builder.forTypesInGeneral()
.withCustomDefinitionProvider(new CustomDefinitionProviderV2() {
@Override
public CustomDefinition provideCustomSchemaDefinition(ResolvedType javaType, SchemaGenerationContext context) {
if (javaType.isInstanceOf(Map.class) || javaType.isInstanceOf(Enum.class)) {

View File

@@ -0,0 +1,15 @@
package io.kestra.core.exceptions;
public class InvalidTriggerConfigurationException extends KestraRuntimeException {
public InvalidTriggerConfigurationException() {
super();
}
public InvalidTriggerConfigurationException(String message) {
super(message);
}
public InvalidTriggerConfigurationException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@@ -91,11 +91,13 @@ public class HttpConfiguration {
@Deprecated
private final String proxyPassword;
@Schema(title = "The username for HTTP basic authentication.")
@Schema(title = "The username for HTTP basic authentication. " +
"Deprecated, use `auth` property with a `BasicAuthConfiguration` instance instead.")
@Deprecated
private final String basicAuthUser;
@Schema(title = "The password for HTTP basic authentication.")
@Schema(title = "The password for HTTP basic authentication. " +
"Deprecated, use `auth` property with a `BasicAuthConfiguration` instance instead.")
@Deprecated
private final String basicAuthPassword;

View File

@@ -0,0 +1,7 @@
package io.kestra.core.models;
public enum FetchVersion {
LATEST,
OLD,
ALL
}

View File

@@ -100,7 +100,7 @@ public record QueryFilter(
LABELS("labels") {
@Override
public List<Op> supportedOp() {
return List.of(Op.EQUALS, Op.NOT_EQUALS);
return List.of(Op.EQUALS, Op.NOT_EQUALS, Op.IN, Op.NOT_IN, Op.CONTAINS);
}
},
FLOW_ID("flowId") {
@@ -109,6 +109,12 @@ public record QueryFilter(
return List.of(Op.EQUALS, Op.NOT_EQUALS, Op.CONTAINS, Op.STARTS_WITH, Op.ENDS_WITH, Op.REGEX);
}
},
UPDATED("updated") {
@Override
public List<Op> supportedOp() {
return List.of(Op.GREATER_THAN_OR_EQUAL_TO, Op.GREATER_THAN, Op.LESS_THAN_OR_EQUAL_TO, Op.LESS_THAN, Op.EQUALS, Op.NOT_EQUALS);
}
},
START_DATE("startDate") {
@Override
public List<Op> supportedOp() {
@@ -250,6 +256,25 @@ public record QueryFilter(
Field.START_DATE, Field.END_DATE, Field.TRIGGER_ID
);
}
},
SECRET_METADATA {
@Override
public List<Field> supportedField() {
return List.of(
Field.QUERY,
Field.NAMESPACE
);
}
},
KV_METADATA {
@Override
public List<Field> supportedField() {
return List.of(
Field.QUERY,
Field.NAMESPACE,
Field.UPDATED
);
}
};
public abstract List<Field> supportedField();

View File

@@ -0,0 +1,3 @@
package io.kestra.core.models;
public record TenantAndNamespace(String tenantId, String namespace) {}

View File

@@ -12,6 +12,8 @@ import lombok.experimental.SuperBuilder;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@io.kestra.core.models.annotations.Plugin
@SuperBuilder
@Getter
@@ -20,6 +22,6 @@ import jakarta.validation.constraints.Pattern;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public abstract class Condition implements Plugin, Rethrow.PredicateChecked<ConditionContext, InternalException> {
@NotNull
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
protected String type;
}

View File

@@ -32,6 +32,8 @@ public class Dashboard implements HasUID, DeletedInterface {
private String tenantId;
@Hidden
@NotNull
@NotBlank
private String id;
@NotNull

View File

@@ -5,6 +5,8 @@ import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.models.dashboards.filters.AbstractFilter;
import io.kestra.core.repositories.QueryBuilderInterface;
import io.kestra.plugin.core.dashboard.data.IData;
import jakarta.annotation.Nullable;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
@@ -20,6 +22,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@SuperBuilder(toBuilder = true)
@Getter
@NoArgsConstructor
@@ -28,12 +32,15 @@ import java.util.Set;
public abstract class DataFilter<F extends Enum<F>, C extends ColumnDescriptor<F>> implements io.kestra.core.models.Plugin, IData<F> {
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
private String type;
@Valid
private Map<String, C> columns;
@Setter
@Valid
@Nullable
private List<AbstractFilter<F>> where;
private List<OrderBy> orderBy;

View File

@@ -19,6 +19,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@SuperBuilder(toBuilder = true)
@Getter
@NoArgsConstructor
@@ -27,7 +29,7 @@ import java.util.Set;
public abstract class DataFilterKPI<F extends Enum<F>, C extends ColumnDescriptor<F>> implements io.kestra.core.models.Plugin, IData<F> {
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
private String type;
private C columns;

View File

@@ -12,6 +12,8 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@SuperBuilder(toBuilder = true)
@Getter
@NoArgsConstructor
@@ -26,7 +28,7 @@ public abstract class Chart<P extends ChartOption> implements io.kestra.core.mod
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
protected String type;
@Valid

View File

@@ -5,6 +5,7 @@ import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.models.dashboards.ChartOption;
import io.kestra.core.models.dashboards.DataFilter;
import io.kestra.core.validations.DataChartValidation;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -20,6 +21,7 @@ import lombok.experimental.SuperBuilder;
@DataChartValidation
public abstract class DataChart<P extends ChartOption, D extends DataFilter<?, ?>> extends Chart<P> implements io.kestra.core.models.Plugin {
@NotNull
@Valid
private D data;
public Integer minNumberOfAggregations() {

View File

@@ -1,8 +1,11 @@
package io.kestra.core.models.dashboards.filters;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.micronaut.core.annotation.Introspected;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@@ -32,6 +35,9 @@ import lombok.experimental.SuperBuilder;
@SuperBuilder
@Introspected
public abstract class AbstractFilter<F extends Enum<F>> {
@NotNull
@JsonProperty(value = "field", required = true)
@Valid
private F field;
private String labelKey;

View File

@@ -28,6 +28,7 @@ import io.kestra.core.utils.IdUtils;
import io.kestra.core.utils.ListUtils;
import io.kestra.core.utils.MapUtils;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
@@ -77,10 +78,12 @@ public class Execution implements DeletedInterface, TenantInterface {
@With
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Schema(implementation = Object.class)
Map<String, Object> inputs;
@With
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Schema(implementation = Object.class)
Map<String, Object> outputs;
@JsonSerialize(using = ListOrMapOfLabelSerializer.class)
@@ -88,6 +91,7 @@ public class Execution implements DeletedInterface, TenantInterface {
List<Label> labels;
@With
@Schema(implementation = Object.class)
Map<String, Object> variables;
@NotNull
@@ -941,7 +945,15 @@ public class Execution implements DeletedInterface, TenantInterface {
for (TaskRun current : taskRuns) {
if (!MapUtils.isEmpty(current.getOutputs())) {
if (current.getIteration() != null) {
taskOutputs = MapUtils.merge(taskOutputs, outputs(current, byIds));
Map<String, Object> merged = MapUtils.merge(taskOutputs, outputs(current, byIds));
// If one of two of the map is null in the merge() method, we just return the other
// And if the not null map is a Variables (= read only), we cast it back to a simple
// hashmap to avoid taskOutputs becoming read-only
// i.e this happen in nested loopUntil tasks
if (merged instanceof Variables) {
merged = new HashMap<>(merged);
}
taskOutputs = merged;
} else {
taskOutputs.putAll(outputs(current, byIds));
}

View File

@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.Hidden;
import jakarta.annotation.Nullable;
import lombok.Builder;
import lombok.Value;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.event.Level;
import jakarta.validation.constraints.NotNull;
@@ -120,6 +121,16 @@ public class LogEntry implements DeletedInterface, TenantInterface {
return logEntry.getTimestamp().toString() + " " + logEntry.getLevel() + " " + logEntry.getMessage();
}
public static String toPrettyString(LogEntry logEntry, Integer maxMessageSize) {
String message;
if (maxMessageSize != null && maxMessageSize > 0) {
message = StringUtils.truncate(logEntry.getMessage(), maxMessageSize);
} else {
message = logEntry.getMessage();
}
return logEntry.getTimestamp().toString() + " " + logEntry.getLevel() + " " + message;
}
public Map<String, String> toMap() {
return Stream
.of(

View File

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import io.kestra.core.models.DeletedInterface;
import io.kestra.core.models.TenantInterface;
import io.kestra.core.models.executions.metrics.Counter;
import io.kestra.core.models.executions.metrics.Gauge;
import io.kestra.core.models.executions.metrics.Timer;
import io.swagger.v3.oas.annotations.Hidden;
import jakarta.annotation.Nullable;
@@ -82,6 +83,10 @@ public class MetricEntry implements DeletedInterface, TenantInterface {
return counter.getValue();
}
if (metricEntry instanceof Gauge gauge) {
return gauge.getValue();
}
if (metricEntry instanceof Timer timer) {
return (double) timer.getValue().toMillis();
}

View File

@@ -3,10 +3,13 @@ package io.kestra.core.models.executions;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.kestra.core.models.TenantInterface;
import io.kestra.core.models.flows.State;
import io.kestra.core.models.tasks.FlowableTask;
import io.kestra.core.models.tasks.ResolvedTask;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.models.tasks.retrys.AbstractRetry;
import io.kestra.core.utils.IdUtils;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
@@ -52,6 +55,8 @@ public class TaskRun implements TenantInterface {
@With
@JsonInclude(JsonInclude.Include.ALWAYS)
@Nullable
@Schema(implementation = Object.class)
Variables outputs;
@NotNull
@@ -64,7 +69,6 @@ public class TaskRun implements TenantInterface {
Boolean dynamic;
// Set it to true to force execution even if the execution is killed
@Nullable
@With
Boolean forceExecution;
@@ -193,17 +197,17 @@ public class TaskRun implements TenantInterface {
taskRunBuilder.attempts = new ArrayList<>();
taskRunBuilder.attempts.add(TaskRunAttempt.builder()
.state(new State(this.state, State.Type.KILLED))
.state(new State(this.state, State.Type.RESUBMITTED))
.build()
);
} else {
ArrayList<TaskRunAttempt> taskRunAttempts = new ArrayList<>(taskRunBuilder.attempts);
TaskRunAttempt lastAttempt = taskRunAttempts.get(taskRunBuilder.attempts.size() - 1);
if (!lastAttempt.getState().isTerminated()) {
taskRunAttempts.set(taskRunBuilder.attempts.size() - 1, lastAttempt.withState(State.Type.KILLED));
taskRunAttempts.set(taskRunBuilder.attempts.size() - 1, lastAttempt.withState(State.Type.RESUBMITTED));
} else {
taskRunAttempts.add(TaskRunAttempt.builder()
.state(new State().withState(State.Type.KILLED))
.state(new State().withState(State.Type.RESUBMITTED))
.build()
);
}
@@ -217,7 +221,7 @@ public class TaskRun implements TenantInterface {
public boolean isSame(TaskRun taskRun) {
return this.getId().equals(taskRun.getId()) &&
((this.getValue() == null && taskRun.getValue() == null) || (this.getValue() != null && this.getValue().equals(taskRun.getValue()))) &&
((this.getIteration() == null && taskRun.getIteration() == null) || (this.getIteration() != null && this.getIteration().equals(taskRun.getIteration()))) ;
((this.getIteration() == null && taskRun.getIteration() == null) || (this.getIteration() != null && this.getIteration().equals(taskRun.getIteration())));
}
public String toString(boolean pretty) {
@@ -249,7 +253,7 @@ public class TaskRun implements TenantInterface {
* This method is used when the retry is apply on a task
* but the retry type is NEW_EXECUTION
*
* @param retry Contains the retry configuration
* @param retry Contains the retry configuration
* @param execution Contains the attempt number and original creation date
* @return The next retry date, null if maxAttempt || maxDuration is reached
*/
@@ -270,6 +274,7 @@ public class TaskRun implements TenantInterface {
/**
* This method is used when the Retry definition comes from the flow
*
* @param retry The retry configuration
* @return The next retry date, null if maxAttempt || maxDuration is reached
*/

View File

@@ -0,0 +1,78 @@
package io.kestra.core.models.executions.metrics;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.annotation.Nullable;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import io.kestra.core.metrics.MetricRegistry;
import io.kestra.core.models.executions.AbstractMetricEntry;
import jakarta.validation.constraints.NotNull;
import java.util.Map;
@ToString
@EqualsAndHashCode
@Getter
@NoArgsConstructor
public class Gauge extends AbstractMetricEntry<Double> {
public static final String TYPE = "gauge";
@NotNull
@JsonInclude
private final String type = TYPE;
@NotNull
@EqualsAndHashCode.Exclude
private Double value;
private Gauge(@NotNull String name, @Nullable String description, @NotNull Double value, String... tags) {
super(name, description, tags);
this.value = value;
}
public static Gauge of(@NotNull String name, @NotNull Double value, String... tags) {
return new Gauge(name, null, value, tags);
}
public static Gauge of(@NotNull String name, @Nullable String description, @NotNull Double value, String... tags) {
return new Gauge(name, description, value, tags);
}
public static Gauge of(@NotNull String name, @NotNull Integer value, String... tags) {
return new Gauge(name, null, (double) value, tags);
}
public static Gauge of(@NotNull String name, @Nullable String description, @NotNull Integer value, String... tags) {
return new Gauge(name, description, (double) value, tags);
}
public static Gauge of(@NotNull String name, @NotNull Long value, String... tags) {
return new Gauge(name, null, (double) value, tags);
}
public static Gauge of(@NotNull String name, @Nullable String description, @NotNull Long value, String... tags) {
return new Gauge(name, description, (double) value, tags);
}
public static Gauge of(@NotNull String name, @NotNull Float value, String... tags) {
return new Gauge(name, null, (double) value, tags);
}
public static Gauge of(@NotNull String name, @Nullable String description, @NotNull Float value, String... tags) {
return new Gauge(name, description, (double) value, tags);
}
@Override
public void register(MetricRegistry meterRegistry, String name, String description, Map<String, String> tags) {
meterRegistry
.gauge(this.metricName(name), description, this.value, this.tagsAsArray(tags));
}
@Override
public void increment(Double value) {
this.value = value;
}
}

View File

@@ -77,14 +77,6 @@ public abstract class AbstractFlow implements FlowInterface {
Map<String, Object> variables;
@Schema(
oneOf = {
String.class, // Corresponds to 'type: string' in OpenAPI
Map.class // Corresponds to 'type: object' in OpenAPI
}
)
interface StringOrMapValue {}
@Valid
private WorkerGroup workerGroup;

View File

@@ -49,7 +49,7 @@ import java.util.stream.Stream;
public class Flow extends AbstractFlow implements HasUID {
private static final ObjectMapper NON_DEFAULT_OBJECT_MAPPER = JacksonMapper.ofYaml()
.copy()
.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
private static final ObjectMapper WITHOUT_REVISION_OBJECT_MAPPER = NON_DEFAULT_OBJECT_MAPPER.copy()
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true)

View File

@@ -136,7 +136,7 @@ public interface FlowInterface extends FlowId, DeletedInterface, TenantInterface
class SourceGenerator {
private static final ObjectMapper NON_DEFAULT_OBJECT_MAPPER = JacksonMapper.ofJson()
.copy()
.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
static String generate(final FlowInterface flow) {
try {

View File

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.kestra.core.models.flows.input.*;
import io.kestra.core.models.property.Property;
import io.kestra.core.validations.InputValidation;
import io.micronaut.core.annotation.Introspected;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.ConstraintViolationException;
@@ -44,6 +45,7 @@ import lombok.experimental.SuperBuilder;
@JsonSubTypes.Type(value = YamlInput.class, name = "YAML"),
@JsonSubTypes.Type(value = EmailInput.class, name = "EMAIL"),
})
@InputValidation
public abstract class Input<T> implements Data {
@Schema(
title = "The ID of the input."
@@ -80,7 +82,13 @@ public abstract class Input<T> implements Data {
title = "The default value to use if no value is specified."
)
Property<T> defaults;
@Schema(
title = "The suggested value for the input.",
description = "Optional UI hint for pre-filling the input. Cannot be used together with a default value."
)
Property<T> prefill;
@Schema(
title = "The display name of the input."
)

View File

@@ -24,10 +24,6 @@ public class PluginDefault {
@Schema(
type = "object",
oneOf = {
Map.class,
String.class
},
additionalProperties = Schema.AdditionalPropertiesValue.FALSE
)
private final Map<String, Object> values;

View File

@@ -236,14 +236,15 @@ public class State {
RETRYING,
RETRIED,
SKIPPED,
BREAKPOINT;
BREAKPOINT,
RESUBMITTED;
public boolean isTerminated() {
return this == Type.FAILED || this == Type.WARNING || this == Type.SUCCESS || this == Type.KILLED || this == Type.CANCELLED || this == Type.RETRIED || this == Type.SKIPPED;
return this == Type.FAILED || this == Type.WARNING || this == Type.SUCCESS || this == Type.KILLED || this == Type.CANCELLED || this == Type.RETRIED || this == Type.SKIPPED || this == Type.RESUBMITTED;
}
public boolean isTerminatedNoFail() {
return this == Type.WARNING || this == Type.SUCCESS || this == Type.RETRIED || this == Type.SKIPPED;
return this == Type.WARNING || this == Type.SUCCESS || this == Type.RETRIED || this == Type.SKIPPED || this == Type.RESUBMITTED;
}
public boolean isCreated() {

View File

@@ -1,5 +1,6 @@
package io.kestra.core.models.flows.input;
import java.util.Set;
import io.kestra.core.models.flows.Input;
import io.kestra.core.validations.FileInputValidation;
import jakarta.validation.ConstraintViolationException;
@@ -22,10 +23,35 @@ public class FileInput extends Input<URI> {
@Deprecated(since = "0.24", forRemoval = true)
public String extension;
/**
* List of allowed file extensions (e.g., [".csv", ".txt", ".pdf"]).
* Each extension must start with a dot.
*/
private List<String> allowedFileExtensions;
/**
* Gets the file extension from the URI's path
*/
private String getFileExtension(URI uri) {
String path = uri.getPath();
int lastDotIndex = path.lastIndexOf(".");
return lastDotIndex >= 0 ? path.substring(lastDotIndex).toLowerCase() : "";
}
@Override
public void validate(URI input) throws ConstraintViolationException {
// no validation yet
if (input == null || allowedFileExtensions == null || allowedFileExtensions.isEmpty()) {
return;
}
String extension = getFileExtension(input);
if (!allowedFileExtensions.contains(extension.toLowerCase())) {
throw new ConstraintViolationException(
"File type not allowed. Accepted extensions: " + String.join(", ", allowedFileExtensions),
Set.of()
);
}
}
public static String findFileInputExtension(@NotNull final List<Input<?>> inputs, @NotNull final String fileName) {

View File

@@ -0,0 +1,79 @@
package io.kestra.core.models.kv;
import io.kestra.core.models.DeletedInterface;
import io.kestra.core.models.HasUID;
import io.kestra.core.models.TenantInterface;
import io.kestra.core.storages.kv.KVEntry;
import io.kestra.core.utils.IdUtils;
import io.swagger.v3.oas.annotations.Hidden;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.*;
import lombok.experimental.FieldDefaults;
import lombok.extern.slf4j.Slf4j;
import java.time.Instant;
import java.util.Optional;
@Builder(toBuilder = true)
@Slf4j
@Getter
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@AllArgsConstructor
@ToString
@EqualsAndHashCode
public class PersistedKvMetadata implements DeletedInterface, TenantInterface, HasUID {
@With
@Hidden
@Pattern(regexp = "^[a-z0-9][a-z0-9_-]*")
private String tenantId;
@NotNull
private String namespace;
@NotNull
private String name;
private String description;
@NotNull
private Integer version;
@Builder.Default
private boolean last = true;
@Nullable
private Instant expirationDate;
@Nullable
private Instant created;
@Nullable
private Instant updated;
private boolean deleted;
public static PersistedKvMetadata from(String tenantId, KVEntry kvEntry) {
return PersistedKvMetadata.builder()
.tenantId(tenantId)
.namespace(kvEntry.namespace())
.name(kvEntry.key())
.version(kvEntry.version())
.description(kvEntry.description())
.created(kvEntry.creationDate())
.updated(kvEntry.updateDate())
.expirationDate(kvEntry.expirationDate())
.build();
}
public PersistedKvMetadata asLast() {
Instant saveDate = Instant.now();
return this.toBuilder().created(Optional.ofNullable(this.created).orElse(saveDate)).updated(saveDate).last(true).build();
}
@Override
public String uid() {
return IdUtils.fromParts(getTenantId(), getNamespace(), getName(), getVersion().toString());
}
}

View File

@@ -8,6 +8,8 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public interface TaskInterface extends Plugin, PluginVersioning {
@NotNull
@@ -17,7 +19,7 @@ public interface TaskInterface extends Plugin, PluginVersioning {
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
@Schema(title = "The class name of this task.")
String getType();
}

View File

@@ -11,6 +11,8 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import reactor.core.publisher.Flux;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@Plugin
@SuperBuilder(toBuilder = true)
@Getter
@@ -22,7 +24,7 @@ public abstract class LogExporter<T extends Output> implements io.kestra.core.m
protected String id;
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
protected String type;
public abstract T sendLogs(RunContext runContext, Flux<LogRecord> logRecords) throws Exception;

View File

@@ -8,12 +8,16 @@ public final class LogRecordMapper {
private LogRecordMapper(){}
public static LogRecord mapToLogRecord(LogEntry log) {
return mapToLogRecord(log, null);
}
public static LogRecord mapToLogRecord(LogEntry log, Integer maxMessageSize) {
return LogRecord.builder()
.resource("Kestra")
.timestampEpochNanos(instantInNanos(log.getTimestamp()))
.severity(log.getLevel().name())
.attributes(log.toLogMap())
.bodyValue(LogEntry.toPrettyString(log))
.bodyValue(LogEntry.toPrettyString(log, maxMessageSize))
.build();
}

View File

@@ -22,6 +22,7 @@ import java.util.Map;
@JsonSubTypes({
@JsonSubTypes.Type(value = CounterMetric.class, name = "counter"),
@JsonSubTypes.Type(value = TimerMetric.class, name = "timer"),
@JsonSubTypes.Type(value = GaugeMetric.class, name = "gauge"),
})
@ToString
@EqualsAndHashCode

View File

@@ -0,0 +1,44 @@
package io.kestra.core.models.tasks.metrics;
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
import io.kestra.core.models.executions.AbstractMetricEntry;
import io.kestra.core.models.executions.metrics.Gauge;
import io.kestra.core.models.property.Property;
import io.kestra.core.runners.RunContext;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.util.Map;
import java.util.stream.Stream;
@ToString
@EqualsAndHashCode
@Getter
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class GaugeMetric extends AbstractMetric {
public static final String TYPE = "gauge";
@NotNull
@EqualsAndHashCode.Exclude
private Property<Double> value;
@Override
public AbstractMetricEntry<?> toMetric(RunContext runContext) throws IllegalVariableEvaluationException {
String name = runContext.render(this.name).as(String.class).orElseThrow();
Double value = runContext.render(this.value).as(Double.class).orElseThrow();
String description = runContext.render(this.description).as(String.class).orElse(null);
Map<String, String> tags = runContext.render(this.tags).asMap(String.class, String.class);
String[] tagsAsStrings = tags.entrySet().stream()
.flatMap(e -> Stream.of(e.getKey(), e.getValue()))
.toArray(String[]::new);
return Gauge.of(name, description, value, tagsAsStrings);
}
public String getType() {
return TYPE;
}
}

View File

@@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import static io.kestra.core.utils.WindowsUtils.windowsToUnixPath;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
/**
* Base class for all task runners.
@@ -36,7 +37,7 @@ import static io.kestra.core.utils.WindowsUtils.windowsToUnixPath;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public abstract class TaskRunner<T extends TaskRunnerDetailResult> implements Plugin, PluginVersioning, WorkerJobLifecycle {
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
protected String type;
@PluginProperty(hidden = true, group = PluginProperty.CORE_GROUP)

View File

@@ -44,7 +44,7 @@ public class Template implements DeletedInterface, TenantInterface, HasUID {
return exclusions.contains(m.getName()) || super.hasIgnoreMarker(m);
}
})
.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
@Setter
@Hidden

View File

@@ -47,7 +47,6 @@ abstract public class AbstractTrigger implements TriggerInterface {
@Valid
protected List<@Valid @NotNull Condition> conditions;
@NotNull
@Builder.Default
@PluginProperty(hidden = true, group = PluginProperty.CORE_GROUP)
@Schema(defaultValue = "false")

View File

@@ -1,10 +1,12 @@
package io.kestra.core.models.triggers;
import io.kestra.core.exceptions.InvalidTriggerConfigurationException;
import io.kestra.core.models.annotations.PluginProperty;
import io.kestra.core.models.conditions.ConditionContext;
import io.kestra.core.models.executions.Execution;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.DateTimeException;
import java.time.Duration;
import java.time.ZonedDateTime;
import java.util.Optional;
@@ -29,15 +31,29 @@ public interface PollingTriggerInterface extends WorkerTriggerInterface {
* Compute the next evaluation date of the trigger based on the existing trigger context: by default, it uses the current date and the interval.
* Schedulable triggers must override this method.
*/
default ZonedDateTime nextEvaluationDate(ConditionContext conditionContext, Optional<? extends TriggerContext> last) throws Exception {
return ZonedDateTime.now().plus(this.getInterval());
default ZonedDateTime nextEvaluationDate(ConditionContext conditionContext, Optional<? extends TriggerContext> last) throws InvalidTriggerConfigurationException {
return computeNextEvaluationDate();
}
/**
* Compute the next evaluation date of the trigger: by default, it uses the current date and the interval.
* Schedulable triggers must override this method as it's used to init them when there is no evaluation date.
*/
default ZonedDateTime nextEvaluationDate() {
return ZonedDateTime.now().plus(this.getInterval());
default ZonedDateTime nextEvaluationDate() throws InvalidTriggerConfigurationException {
return computeNextEvaluationDate();
}
/**
* computes the next evaluation date using the configured interval.
* Throw InvalidTriggerConfigurationException, if the interval causes date overflow.
*/
private ZonedDateTime computeNextEvaluationDate() throws InvalidTriggerConfigurationException {
Duration interval = this.getInterval();
try {
return ZonedDateTime.now().plus(interval);
} catch (DateTimeException | ArithmeticException e) {
throw new InvalidTriggerConfigurationException("Trigger interval too large", e);
}
}
}

View File

@@ -0,0 +1,40 @@
package io.kestra.core.models.triggers;
import io.kestra.core.models.property.Property;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.Duration;
public interface StatefulTriggerInterface {
@Schema(
title = "Trigger event type",
description = """
Defines when the trigger fires.
- `CREATE`: only for newly discovered entities.
- `UPDATE`: only when an already-seen entity changes.
- `CREATE_OR_UPDATE`: fires on either event.
"""
)
Property<On> getOn();
@Schema(
title = "State key",
description = """
JSON-type KV key for persisted state.
Default: `<namespace>__<flowId>__<triggerId>`
"""
)
Property<String> getStateKey();
@Schema(
title = "State TTL",
description = "TTL for persisted state entries (e.g., PT24H, P7D)."
)
Property<Duration> getStateTtl();
enum On {
CREATE,
UPDATE,
CREATE_OR_UPDATE
}
}

View File

@@ -0,0 +1,91 @@
package io.kestra.core.models.triggers;
import com.fasterxml.jackson.core.type.TypeReference;
import io.kestra.core.runners.RunContext;
import io.kestra.core.serializers.JacksonMapper;
import io.kestra.core.storages.kv.KVMetadata;
import io.kestra.core.storages.kv.KVValueAndMetadata;
import java.time.Duration;
import java.time.Instant;
import java.util.*;
import java.util.stream.Collectors;
public class StatefulTriggerService {
public record Entry(String uri, String version, Instant modifiedAt, Instant lastSeenAt) {
public static Entry candidate(String uri, String version, Instant modifiedAt) {
return new Entry(uri, version, modifiedAt, null);
}
}
public record StateUpdate(boolean fire, boolean isNew) {}
public static Map<String, Entry> readState(RunContext runContext, String key, Optional<Duration> ttl) {
try {
var kv = runContext.namespaceKv(runContext.flowInfo().namespace()).getValue(key);
if (kv.isEmpty()) {
return new HashMap<>();
}
var entries = JacksonMapper.ofJson().readValue((byte[]) kv.get().value(), new TypeReference<List<Entry>>() {});
var cutoff = ttl.map(d -> Instant.now().minus(d)).orElse(Instant.MIN);
return entries.stream()
.filter(e -> Optional.ofNullable(e.lastSeenAt()).orElse(Instant.now()).isAfter(cutoff))
.collect(Collectors.toMap(Entry::uri, e -> e));
} catch (Exception e) {
runContext.logger().warn("readState failed", e);
return new HashMap<>();
}
}
public static void writeState(RunContext runContext, String key, Map<String, Entry> state, Optional<Duration> ttl) {
try {
var bytes = JacksonMapper.ofJson().writeValueAsBytes(state.values());
var meta = new KVMetadata("trigger state", ttl.orElse(null));
runContext.namespaceKv(runContext.flowInfo().namespace()).put(key, new KVValueAndMetadata(meta, bytes));
} catch (Exception e) {
runContext.logger().warn("writeState failed", e);
}
}
public static StateUpdate computeAndUpdateState(Map<String, Entry> state, Entry candidate, StatefulTriggerInterface.On on) {
var prev = state.get(candidate.uri());
var isNew = prev == null;
var fire = shouldFire(prev, candidate.version(), on);
Instant lastSeenAt;
if (fire || isNew) {
// it is new seen or changed
lastSeenAt = Instant.now();
} else if (prev.lastSeenAt() != null) {
// it is unchanged but already tracked before
lastSeenAt = prev.lastSeenAt();
} else {
lastSeenAt = Instant.now();
}
var newEntry = new Entry(candidate.uri(), candidate.version(), candidate.modifiedAt(), lastSeenAt);
state.put(candidate.uri(), newEntry);
return new StatefulTriggerService.StateUpdate(fire, isNew);
}
public static boolean shouldFire(Entry prev, String version, StatefulTriggerInterface.On on) {
if (prev == null) {
return on == StatefulTriggerInterface.On.CREATE || on == StatefulTriggerInterface.On.CREATE_OR_UPDATE;
}
if (!Objects.equals(prev.version(), version)) {
return on == StatefulTriggerInterface.On.UPDATE || on == StatefulTriggerInterface.On.CREATE_OR_UPDATE;
}
return false;
}
public static String defaultKey(String ns, String flowId, String triggerId) {
return String.join("_", ns, flowId, triggerId);
}
}

View File

@@ -1,5 +1,6 @@
package io.kestra.core.models.triggers;
import io.kestra.core.exceptions.InvalidTriggerConfigurationException;
import io.kestra.core.models.HasUID;
import io.kestra.core.models.conditions.ConditionContext;
import io.kestra.core.models.executions.Execution;
@@ -167,9 +168,14 @@ public class Trigger extends TriggerContext implements HasUID {
// Used to update trigger in flowListeners
public static Trigger of(FlowInterface flow, AbstractTrigger abstractTrigger, ConditionContext conditionContext, Optional<Trigger> lastTrigger) throws Exception {
ZonedDateTime nextDate = null;
boolean disabled = lastTrigger.map(TriggerContext::getDisabled).orElse(Boolean.FALSE);
if (abstractTrigger instanceof PollingTriggerInterface pollingTriggerInterface) {
nextDate = pollingTriggerInterface.nextEvaluationDate(conditionContext, Optional.empty());
try {
nextDate = pollingTriggerInterface.nextEvaluationDate(conditionContext, Optional.empty());
} catch (InvalidTriggerConfigurationException e) {
disabled = true;
}
}
return Trigger.builder()
@@ -180,7 +186,7 @@ public class Trigger extends TriggerContext implements HasUID {
.date(ZonedDateTime.now().truncatedTo(ChronoUnit.SECONDS))
.nextExecutionDate(nextDate)
.stopAfter(abstractTrigger.getStopAfter())
.disabled(lastTrigger.map(TriggerContext::getDisabled).orElse(Boolean.FALSE))
.disabled(disabled)
.backfill(null)
.build();
}

View File

@@ -7,6 +7,7 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
public interface TriggerInterface extends Plugin, PluginVersioning {
@NotNull
@@ -17,7 +18,7 @@ public interface TriggerInterface extends Plugin, PluginVersioning {
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
@Schema(title = "The class name for this current trigger.")
String getType();

View File

@@ -11,7 +11,6 @@ import io.kestra.core.runners.FlowInputOutput;
import io.kestra.core.runners.RunContext;
import io.kestra.core.utils.IdUtils;
import io.kestra.core.utils.ListUtils;
import java.time.ZonedDateTime;
import java.util.*;
@@ -25,7 +24,7 @@ public abstract class TriggerService {
RunContext runContext = conditionContext.getRunContext();
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, variables, runContext.logFileURI());
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger, conditionContext.getFlow().getRevision());
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger, conditionContext);
}
public static Execution generateExecution(
@@ -37,7 +36,7 @@ public abstract class TriggerService {
RunContext runContext = conditionContext.getRunContext();
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, output, runContext.logFileURI());
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger, conditionContext.getFlow().getRevision());
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger, conditionContext);
}
public static Execution generateRealtimeExecution(
@@ -49,7 +48,7 @@ public abstract class TriggerService {
RunContext runContext = conditionContext.getRunContext();
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, output, runContext.logFileURI());
return generateExecution(IdUtils.create(), trigger, context, executionTrigger, conditionContext.getFlow().getRevision());
return generateExecution(IdUtils.create(), trigger, context, executionTrigger, conditionContext);
}
public static Execution generateScheduledExecution(
@@ -75,6 +74,7 @@ public abstract class TriggerService {
.namespace(context.getNamespace())
.flowId(context.getFlowId())
.flowRevision(conditionContext.getFlow().getRevision())
.variables(conditionContext.getFlow().getVariables())
.labels(executionLabels)
.state(new State())
.trigger(executionTrigger)
@@ -108,7 +108,7 @@ public abstract class TriggerService {
AbstractTrigger trigger,
TriggerContext context,
ExecutionTrigger executionTrigger,
Integer flowRevision
ConditionContext conditionContext
) {
List<Label> executionLabels = new ArrayList<>(ListUtils.emptyOnNull(trigger.getLabels()));
if (executionLabels.stream().noneMatch(label -> Label.CORRELATION_ID.equals(label.key()))) {
@@ -120,7 +120,8 @@ public abstract class TriggerService {
.namespace(context.getNamespace())
.flowId(context.getFlowId())
.tenantId(context.getTenantId())
.flowRevision(flowRevision)
.flowRevision(conditionContext.getFlow().getRevision())
.variables(conditionContext.getFlow().getVariables())
.state(new State())
.trigger(executionTrigger)
.labels(executionLabels)

View File

@@ -8,6 +8,8 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import static io.kestra.core.utils.RegexPatterns.JAVA_IDENTIFIER_REGEX;
@io.kestra.core.models.annotations.Plugin
@SuperBuilder(toBuilder = true)
@Getter
@@ -15,6 +17,6 @@ import lombok.experimental.SuperBuilder;
public abstract class AdditionalPlugin implements Plugin {
@NotNull
@NotBlank
@Pattern(regexp = "^[A-Za-z_$][A-Za-z0-9_$]*(\\.[A-Za-z_$][A-Za-z0-9_$]*)*$")
@Pattern(regexp = JAVA_IDENTIFIER_REGEX)
protected String type;
}

View File

@@ -1,5 +1,6 @@
package io.kestra.core.plugins;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Builder;
import java.io.File;
@@ -33,7 +34,7 @@ public record PluginArtifact(
String version,
URI uri
) implements Comparable<PluginArtifact> {
private static final Pattern ARTIFACT_PATTERN = Pattern.compile(
"([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)"
);
@@ -42,7 +43,8 @@ public record PluginArtifact(
);
public static final String JAR_EXTENSION = "jar";
public static final String KESTRA_GROUP_ID = "io.kestra";
/**
* Static helper method for constructing a new {@link PluginArtifact} from a JAR file.
*
@@ -135,6 +137,11 @@ public record PluginArtifact(
public String toString() {
return toCoordinates();
}
@JsonIgnore
public boolean isOfficial() {
return groupId.startsWith(KESTRA_GROUP_ID);
}
public String toCoordinates() {
return Stream.of(groupId, artifactId, extension, classifier, version)

View File

@@ -1,9 +1,13 @@
package io.kestra.core.plugins;
import io.kestra.core.contexts.KestraContext;
import io.kestra.core.utils.ListUtils;
import io.kestra.core.utils.Version;
import io.micronaut.core.type.Argument;
import io.micronaut.http.HttpMethod;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.MutableHttpRequest;
import io.micronaut.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -15,9 +19,12 @@ import java.util.Base64;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Services for retrieving available plugin artifacts for Kestra.
@@ -39,6 +46,8 @@ public class PluginCatalogService {
private final boolean icons;
private final boolean oss;
private final Version currentStableVersion;
/**
* Creates a new {@link PluginCatalogService} instance.
@@ -53,11 +62,55 @@ public class PluginCatalogService {
this.httpClient = httpClient;
this.icons = icons;
this.oss = communityOnly;
Version version = Version.of(KestraContext.getContext().getVersion());
this.currentStableVersion = new Version(version.majorVersion(), version.minorVersion(), version.patchVersion(), null);
// Immediately trigger an async load of plugin artifacts.
this.isLoaded.set(true);
this.plugins = CompletableFuture.supplyAsync(this::load);
}
/**
* Resolves the version for the given artifacts.
*
* @param artifacts The list of artifacts to resolve.
* @return The list of results.
*/
public List<PluginResolutionResult> resolveVersions(List<PluginArtifact> artifacts) {
if (ListUtils.isEmpty(artifacts)) {
return List.of();
}
final Map<String, ApiPluginArtifact> pluginsByGroupAndArtifactId = getAllCompatiblePlugins().stream()
.collect(Collectors.toMap(it -> it.groupId() + ":" + it.artifactId(), Function.identity()));
return artifacts.stream().map(it -> {
// Get all compatible versions for current artifact
List<String> versions = Optional
.ofNullable(pluginsByGroupAndArtifactId.get(it.groupId() + ":" + it.artifactId()))
.map(ApiPluginArtifact::versions)
.orElse(List.of());
// Try to resolve the version
String resolvedVersion = null;
if (!versions.isEmpty()) {
if (it.version().equalsIgnoreCase("LATEST")) {
resolvedVersion = versions.getFirst();
} else {
resolvedVersion = versions.contains(it.version()) ? it.version() : null;
}
}
// Build the PluginResolutionResult
return new PluginResolutionResult(
it,
resolvedVersion,
versions,
resolvedVersion != null
);
}).toList();
}
public synchronized List<PluginManifest> get() {
try {
@@ -140,7 +193,27 @@ public class PluginCatalogService {
isLoaded.set(false);
}
}
private List<ApiPluginArtifact> getAllCompatiblePlugins() {
MutableHttpRequest<Object> request = HttpRequest.create(
HttpMethod.GET,
"/v1/plugins/artifacts/core-compatibility/" + currentStableVersion
);
if (oss) {
request.getParameters().add("license", "OPENSOURCE");
}
try {
return httpClient
.toBlocking()
.exchange(request, Argument.listOf(ApiPluginArtifact.class))
.body();
} catch (Exception e) {
log.debug("Failed to retrieve available plugins from Kestra API. Cause: ", e);
return List.of();
}
}
public record PluginManifest(
String title,
String icon,
@@ -153,4 +226,11 @@ public class PluginCatalogService {
return groupId + ":" + artifactId + ":LATEST";
}
}
public record ApiPluginArtifact(
String groupId,
String artifactId,
String license,
List<String> versions
) {}
}

View File

@@ -14,19 +14,19 @@ import java.time.Instant;
@Requires(property = "kestra.server-type")
@Slf4j
public class ReportableScheduler {
private final ReportableRegistry registry;
private final ServerEventSender sender;
private final Clock clock;
@Inject
public ReportableScheduler(ReportableRegistry registry, ServerEventSender sender) {
this.registry = registry;
this.sender = sender;
this.clock = Clock.systemDefaultZone();
}
@Scheduled(fixedDelay = "5m", initialDelay = "${kestra.anonymous-usage-report.initial-delay}")
@Scheduled(fixedDelay = "5m", initialDelay = "${kestra.anonymous-usage-report.initial-delay:5m}")
public void tick() {
Instant now = clock.instant();
for (Reportable<?> r : registry.getAll()) {

View File

@@ -18,6 +18,7 @@ import io.micronaut.http.hateoas.JsonError;
import io.micronaut.reactor.http.client.ReactorHttpClient;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import java.net.URI;
@@ -28,29 +29,30 @@ import java.util.UUID;
@Singleton
@Slf4j
public class ServerEventSender {
private static final String SESSION_UUID = IdUtils.create();
private static final ObjectMapper OBJECT_MAPPER = JacksonMapper.ofJson();
@Inject
@Client
private ReactorHttpClient client;
@Inject
private VersionProvider versionProvider;
@Inject
private InstanceService instanceService;
private final ServerType serverType;
@Value("${kestra.anonymous-usage-report.uri}")
@Setter
@Value("${kestra.anonymous-usage-report.uri:'https://api.kestra.io/v1/reports/server-events'}")
protected URI url;
public ServerEventSender( ) {
this.serverType = KestraContext.getContext().getServerType();
}
public void send(final Instant now, final Type type, Object event) {
ServerEvent serverEvent = ServerEvent
.builder()
@@ -65,11 +67,11 @@ public class ServerEventSender {
.build();
try {
MutableHttpRequest<ServerEvent> request = this.request(serverEvent, type);
if (log.isTraceEnabled()) {
log.trace("Report anonymous usage: '{}'", OBJECT_MAPPER.writeValueAsString(serverEvent));
}
this.handleResponse(client.toBlocking().retrieve(request, Argument.of(Result.class), Argument.of(JsonError.class)));
} catch (HttpClientResponseException t) {
log.trace("Unable to report anonymous usage with body '{}'", t.getResponse().getBody(String.class), t);
@@ -77,11 +79,11 @@ public class ServerEventSender {
log.trace("Unable to handle anonymous usage", t);
}
}
private void handleResponse (Result result){
}
protected MutableHttpRequest<ServerEvent> request(ServerEvent event, Type type) throws Exception {
URI baseUri = URI.create(this.url.toString().endsWith("/") ? this.url.toString() : this.url + "/");
URI resolvedUri = baseUri.resolve(type.name().toLowerCase());

View File

@@ -0,0 +1,48 @@
package io.kestra.core.repositories;
import io.kestra.core.models.FetchVersion;
import io.kestra.core.models.QueryFilter;
import io.kestra.core.models.kv.PersistedKvMetadata;
import io.micronaut.data.model.Pageable;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
public interface KvMetadataRepositoryInterface extends SaveRepositoryInterface<PersistedKvMetadata> {
Optional<PersistedKvMetadata> findByName(
String tenantId,
String namespace,
String name
) throws IOException;
default ArrayListTotal<PersistedKvMetadata> find(
Pageable pageable,
String tenantId,
List<QueryFilter> filters,
boolean allowDeleted,
boolean allowExpired
) {
return this.find(pageable, tenantId, filters, allowDeleted, allowExpired, FetchVersion.LATEST);
}
ArrayListTotal<PersistedKvMetadata> find(
Pageable pageable,
String tenantId,
List<QueryFilter> filters,
boolean allowDeleted,
boolean allowExpired,
FetchVersion fetchBehavior
);
default PersistedKvMetadata delete(PersistedKvMetadata persistedKvMetadata) throws IOException {
return this.save(persistedKvMetadata.toBuilder().deleted(true).build());
}
/**
* Purge (hard delete) a list of persisted kv metadata. If no version is specified, all versions are purged.
* @param persistedKvsMetadata the list of persisted kv metadata to purge
* @return the number of purged persisted kv metadata
*/
Integer purge(List<PersistedKvMetadata> persistedKvsMetadata);
}

View File

@@ -82,8 +82,7 @@ public abstract class FilesService {
}
private static String resolveUniqueNameForFile(final Path path) {
String filename = path.getFileName().toString();
String encodedFilename = java.net.URLEncoder.encode(filename, java.nio.charset.StandardCharsets.UTF_8);
return IdUtils.from(path.toString()) + "-" + encodedFilename;
String filename = path.getFileName().toString().replace(' ', '+');
return IdUtils.from(path.toString()) + "-" + filename;
}
}

View File

@@ -130,7 +130,7 @@ public class FlowInputOutput {
private Mono<Map<String, Object>> readData(List<Input<?>> inputs, Execution execution, Publisher<CompletedPart> data, boolean uploadFiles) {
return Flux.from(data)
.publishOn(Schedulers.boundedElastic())
.<AbstractMap.SimpleEntry<String, String>>handle((input, sink) -> {
.<Map.Entry<String, String>>handle((input, sink) -> {
if (input instanceof CompletedFileUpload fileUpload) {
boolean oldStyleInput = false;
if ("files".equals(fileUpload.getName())) {
@@ -150,7 +150,7 @@ public class FlowInputOutput {
.getContextStorageURI()
);
fileUpload.discard();
sink.next(new AbstractMap.SimpleEntry<>(inputId, from.toString()));
sink.next(Map.entry(inputId, from.toString()));
} else {
try {
final String fileExtension = FileInput.findFileInputExtension(inputs, fileName);
@@ -165,7 +165,7 @@ public class FlowInputOutput {
return;
}
URI from = storageInterface.from(execution, inputId, fileName, tempFile);
sink.next(new AbstractMap.SimpleEntry<>(inputId, from.toString()));
sink.next(Map.entry(inputId, from.toString()));
} finally {
if (!tempFile.delete()) {
tempFile.deleteOnExit();
@@ -178,13 +178,13 @@ public class FlowInputOutput {
}
} else {
try {
sink.next(new AbstractMap.SimpleEntry<>(input.getName(), new String(input.getBytes())));
sink.next(Map.entry(input.getName(), new String(input.getBytes())));
} catch (IOException e) {
sink.error(e);
}
}
})
.collectMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue);
.collectMap(Map.Entry::getKey, Map.Entry::getValue);
}
/**
@@ -287,9 +287,10 @@ public class FlowInputOutput {
Input<?> input = resolvable.get().input();
try {
// resolve all input dependencies and check whether input is enabled
final Map<String, InputAndValue> dependencies = resolveAllDependentInputs(input, flow, execution, inputs, decryptSecrets);
final RunContext runContext = buildRunContextForExecutionAndInputs(flow, execution, dependencies, decryptSecrets);
// Resolve all input dependencies and check whether input is enabled
// Note: Secrets are always decrypted here because they can be part of expressions used to render inputs such as SELECT & MULTI_SELECT.
final Map<String, InputAndValue> dependencies = resolveAllDependentInputs(input, flow, execution, inputs, true);
final RunContext runContext = buildRunContextForExecutionAndInputs(flow, execution, dependencies, true);
boolean isInputEnabled = dependencies.isEmpty() || dependencies.values().stream().allMatch(InputAndValue::enabled);
@@ -329,7 +330,8 @@ public class FlowInputOutput {
// resolve default if needed
if (value == null && input.getDefaults() != null) {
value = resolveDefaultValue(input, runContext);
RunContext runContextForDefault = decryptSecrets ? runContext : buildRunContextForExecutionAndInputs(flow, execution, dependencies, false);
value = resolveDefaultValue(input, runContextForDefault);
resolvable.isDefault(true);
}

View File

@@ -176,6 +176,10 @@ public abstract class RunContext implements PropertyContext {
*/
public abstract KVStore namespaceKv(String namespace);
/**
* @deprecated use #namespaceKv(String) instead
*/
@Deprecated(since = "1.1.0", forRemoval = true)
public StateStore stateStore() {
return new StateStore(this, true);
}

View File

@@ -10,7 +10,6 @@ import io.kestra.core.models.flows.FlowInterface;
import io.kestra.core.models.flows.Input;
import io.kestra.core.models.flows.State;
import io.kestra.core.models.flows.input.SecretInput;
import io.kestra.core.models.property.Property;
import io.kestra.core.models.property.PropertyContext;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.models.triggers.AbstractTrigger;
@@ -100,7 +99,7 @@ public final class RunVariables {
* @return a new immutable {@link Map}.
*/
static Map<String, Object> of(final AbstractTrigger trigger) {
return ImmutableMap.of(
return Map.of(
"id", trigger.getId(),
"type", trigger.getType()
);
@@ -282,12 +281,15 @@ public final class RunVariables {
}
if (flow != null && flow.getInputs() != null) {
// Create a new PropertyContext with 'flow' variables which are required by some pebble expressions.
PropertyContextWithVariables context = new PropertyContextWithVariables(propertyContext, Map.of("flow", RunVariables.of(flow)));
// we add default inputs value from the flow if not already set, this will be useful for triggers
flow.getInputs().stream()
.filter(input -> input.getDefaults() != null && !inputs.containsKey(input.getId()))
.forEach(input -> {
try {
inputs.put(input.getId(), FlowInputOutput.resolveDefaultValue(input, propertyContext));
inputs.put(input.getId(), FlowInputOutput.resolveDefaultValue(input, context));
} catch (IllegalVariableEvaluationException e) {
// Silent catch, if an input depends on another input, or a variable that is populated at runtime / input filling time, we can't resolve it here.
}
@@ -391,4 +393,20 @@ public final class RunVariables {
}
private RunVariables(){}
private record PropertyContextWithVariables(
PropertyContext delegate,
Map<String, Object> variables
) implements PropertyContext {
@Override
public String render(String inline, Map<String, Object> variables) throws IllegalVariableEvaluationException {
return delegate.render(inline, variables.isEmpty() ? this.variables : variables);
}
@Override
public Map<String, Object> render(Map<String, Object> inline, Map<String, Object> variables) throws IllegalVariableEvaluationException {
return delegate.render(inline, variables.isEmpty() ? this.variables : variables);
}
}
}

View File

@@ -1,14 +1,15 @@
package io.kestra.core.runners.pebble.filters;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
import io.pebbletemplates.pebble.error.PebbleException;
import io.pebbletemplates.pebble.extension.Filter;
import io.pebbletemplates.pebble.template.EvaluationContext;
import io.pebbletemplates.pebble.template.PebbleTemplate;
import java.util.List;
import java.util.Map;
public class ChunkFilter implements Filter {
@Override
public List<String> getArgumentNames() {
@@ -30,6 +31,10 @@ public class ChunkFilter implements Filter {
throw new PebbleException(null, "'chunk' filter can only be applied to List. Actual type was: " + input.getClass().getName(), lineNumber, self.getName());
}
return Lists.partition((List) input, ((Long) args.get("size")).intValue());
Object sizeObj = args.get("size");
if (!(sizeObj instanceof Number)) {
throw new PebbleException(null, "'chunk' filter argument 'size' must be a number. Actual type was: " + sizeObj.getClass().getName(), lineNumber, self.getName());
}
return Lists.partition((List) input, ((Number) sizeObj).intValue());
}
}

View File

@@ -17,12 +17,17 @@ import java.util.List;
import java.util.Map;
public class JqFilter implements Filter {
private final Scope scope;
// Load Scope once as static to avoid repeated initialization
// This improves performance by loading builtin functions only once when the class loads
private static final Scope SCOPE;
private final List<String> argumentNames = new ArrayList<>();
static {
SCOPE = Scope.newEmptyScope();
BuiltinFunctionLoader.getInstance().loadFunctions(Versions.JQ_1_6, SCOPE);
}
public JqFilter() {
scope = Scope.newEmptyScope();
BuiltinFunctionLoader.getInstance().loadFunctions(Versions.JQ_1_6, scope);
this.argumentNames.add("expression");
}
@@ -43,10 +48,7 @@ public class JqFilter implements Filter {
String pattern = (String) args.get("expression");
Scope rootScope = Scope.newEmptyScope();
BuiltinFunctionLoader.getInstance().loadFunctions(Versions.JQ_1_6, rootScope);
try {
JsonQuery q = JsonQuery.compile(pattern, Versions.JQ_1_6);
JsonNode in;
@@ -59,7 +61,7 @@ public class JqFilter implements Filter {
final List<Object> out = new ArrayList<>();
try {
q.apply(scope, in, v -> {
q.apply(Scope.newChildScope(SCOPE), in, v -> {
if (v instanceof TextNode) {
out.add(v.textValue());
} else if (v instanceof NullNode) {

View File

@@ -151,10 +151,7 @@ abstract class AbstractFileFunction implements Function {
// if there is a trigger of type execution, we also allow accessing a file from the parent execution
Map<String, String> trigger = (Map<String, String>) context.getVariable(TRIGGER);
if (!isFileUriValid(trigger.get(NAMESPACE), trigger.get("flowId"), trigger.get("executionId"), path)) {
throw new IllegalArgumentException("Unable to read the file '" + path + "' as it didn't belong to the parent execution");
}
return true;
return isFileUriValid(trigger.get(NAMESPACE), trigger.get("flowId"), trigger.get("executionId"), path);
}
return false;
}

View File

@@ -38,7 +38,7 @@ public class KvFunction implements Function {
String key = getKey(args, self, lineNumber);
String namespace = (String) args.get(NAMESPACE_ARG);
Boolean errorOnMissing = Optional.ofNullable((Boolean) args.get(ERROR_ON_MISSING_ARG)).orElse(true);
boolean errorOnMissing = Optional.ofNullable((Boolean) args.get(ERROR_ON_MISSING_ARG)).orElse(true);
Map<String, String> flow = (Map<String, String>) context.getVariable("flow");
String flowNamespace = flow.get(NAMESPACE_ARG);
@@ -53,11 +53,16 @@ public class KvFunction implements Function {
// we didn't check allowedNamespace here as it's checked in the kvStoreService itself
value = kvStoreService.get(flowTenantId, namespace, flowNamespace).getValue(key);
}
} catch (ResourceExpiredException e) {
if (errorOnMissing) {
throw new PebbleException(e, e.getMessage(), lineNumber, self.getName());
}
value = Optional.empty();
} catch (Exception e) {
throw new PebbleException(e, e.getMessage(), lineNumber, self.getName());
}
if (value.isEmpty() && errorOnMissing == Boolean.TRUE) {
if (value.isEmpty() && errorOnMissing) {
throw new PebbleException(null, "The key '" + key + "' does not exist in the namespace '" + namespace + "'.", lineNumber, self.getName());
}
@@ -85,4 +90,4 @@ public class KvFunction implements Function {
return (String) args.get(KEY_ARGS);
}
}
}

View File

@@ -1,21 +1,29 @@
package io.kestra.core.secret;
import io.kestra.core.models.QueryFilter;
import io.kestra.core.repositories.ArrayListTotal;
import io.micronaut.data.model.Pageable;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.Strings;
import java.io.IOException;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@Singleton
@Slf4j
public class SecretService {
public class SecretService<META> {
private static final String SECRET_PREFIX = "SECRET_";
private Map<String, String> decodedSecrets;
@PostConstruct
private void postConstruct() {
this.decode();
@@ -46,6 +54,28 @@ public class SecretService {
return secret;
}
public ArrayListTotal<META> list(Pageable pageable, String tenantId, List<QueryFilter> filters) throws IOException {
final Predicate<String> queryPredicate = filters.stream()
.filter(filter -> filter.field().equals(QueryFilter.Field.QUERY) && filter.value() != null)
.findFirst()
.map(filter -> {
if (filter.operation().equals(QueryFilter.Op.EQUALS)) {
return (Predicate<String>) s -> Strings.CI.contains(s, (String) filter.value());
} else if (filter.operation().equals(QueryFilter.Op.NOT_EQUALS)) {
return (Predicate<String>) s -> !Strings.CI.contains(s, (String) filter.value());
} else {
throw new IllegalArgumentException("Unsupported operation for QUERY filter: " + filter.operation());
}
})
.orElse(s -> true);
//noinspection unchecked
return ArrayListTotal.of(
pageable,
decodedSecrets.keySet().stream().filter(queryPredicate).map(s -> (META) s).toList()
);
}
public Map<String, Set<String>> inheritedSecrets(String tenantId, String namespace) throws IOException {
return Map.of(namespace, decodedSecrets.keySet());
}

View File

@@ -140,7 +140,7 @@ public final class JacksonMapper {
return mapper
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL)
.registerModule(new JavaTimeModule())
.registerModule(new Jdk8Module())
.registerModule(new ParameterNamesModule())
@@ -153,7 +153,7 @@ public final class JacksonMapper {
private static ObjectMapper createIonObjectMapper() {
return configure(new IonObjectMapper(new IonFactory(createIonSystem())))
.setSerializationInclusion(JsonInclude.Include.ALWAYS)
.setDefaultPropertyInclusion(JsonInclude.Include.ALWAYS)
.registerModule(new IonModule());
}
@@ -172,7 +172,7 @@ public final class JacksonMapper {
return Pair.of(patch, revert);
}
public static JsonNode applyPatchesOnJsonNode(JsonNode jsonObject, List<JsonNode> patches) {
for (JsonNode patch : patches) {
try {

View File

@@ -3,15 +3,21 @@ package io.kestra.core.services;
import io.kestra.core.models.executions.Execution;
import io.kestra.core.models.flows.State;
import io.kestra.core.queues.QueueException;
import io.kestra.core.runners.ConcurrencyLimit;
import jakarta.inject.Singleton;
import java.util.EnumSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@Singleton
public class ConcurrencyLimitService {
/**
* Contains methods to manage concurrency limit.
* This is designed to be used by the API, the executor use lower level primitives.
*/
public interface ConcurrencyLimitService {
protected static final Set<State.Type> VALID_TARGET_STATES =
Set<State.Type> VALID_TARGET_STATES =
EnumSet.of(State.Type.RUNNING, State.Type.CANCELLED, State.Type.FAILED);
/**
@@ -19,18 +25,20 @@ public class ConcurrencyLimitService {
*
* @throws IllegalArgumentException in case the execution is not queued.
*/
public Execution unqueue(Execution execution, State.Type state) throws QueueException {
if (execution.getState().getCurrent() != State.Type.QUEUED) {
throw new IllegalArgumentException("Only QUEUED execution can be unqueued");
}
Execution unqueue(Execution execution, State.Type state) throws QueueException;
state = (state == null) ? State.Type.RUNNING : state;
/**
* Find concurrency limits.
*/
List<ConcurrencyLimit> find(String tenantId);
// Validate the target state, throwing an exception if the state is invalid
if (!VALID_TARGET_STATES.contains(state)) {
throw new IllegalArgumentException("Invalid target state: " + state + ". Valid states are: " + VALID_TARGET_STATES);
}
/**
* Update a concurrency limit.
*/
ConcurrencyLimit update(ConcurrencyLimit concurrencyLimit);
return execution.withState(state);
}
/**
* Find a concurrency limit by its identifier.
*/
Optional<ConcurrencyLimit> findById(String tenantId, String namespace, String flowId);
}

View File

@@ -14,6 +14,7 @@ import io.kestra.core.models.flows.State;
import io.kestra.core.models.flows.input.InputAndValue;
import io.kestra.core.models.hierarchies.AbstractGraphTask;
import io.kestra.core.models.hierarchies.GraphCluster;
import io.kestra.core.models.tasks.FlowableTask;
import io.kestra.core.models.tasks.ResolvedTask;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.models.tasks.retrys.AbstractRetry;
@@ -121,21 +122,38 @@ public class ExecutionService {
* Retry set the given taskRun in created state
* and return the execution in running state
**/
public Execution retryTask(Execution execution, String taskRunId) {
List<TaskRun> newTaskRuns = execution
.getTaskRunList()
.stream()
.map(taskRun -> {
if (taskRun.getId().equals(taskRunId)) {
return taskRun
.withState(State.Type.CREATED);
public Execution retryTask(Execution execution, Flow flow, String taskRunId) throws InternalException {
TaskRun taskRun = execution.findTaskRunByTaskRunId(taskRunId).withState(State.Type.CREATED);
List<TaskRun> taskRunList = execution.getTaskRunList();
if (taskRun.getParentTaskRunId() != null) {
// we need to find the parent to remove any errors or finally tasks already executed
TaskRun parentTaskRun = execution.findTaskRunByTaskRunId(taskRun.getParentTaskRunId());
Task parentTask = flow.findTaskByTaskId(parentTaskRun.getTaskId());
if (parentTask instanceof FlowableTask<?> flowableTask) {
if (flowableTask.getErrors() != null) {
List<Task> allErrors = Stream.concat(flowableTask.getErrors().stream()
.filter(task -> task.isFlowable() && ((FlowableTask<?>) task).getErrors() != null)
.flatMap(task -> ((FlowableTask<?>) task).getErrors().stream()),
flowableTask.getErrors().stream())
.toList();
allErrors.forEach(error -> taskRunList.removeIf(t -> t.getTaskId().equals(error.getId())));
}
return taskRun;
})
.toList();
if (flowableTask.getFinally() != null) {
List<Task> allFinally = Stream.concat(flowableTask.getFinally().stream()
.filter(task -> task.isFlowable() && ((FlowableTask<?>) task).getFinally() != null)
.flatMap(task -> ((FlowableTask<?>) task).getFinally().stream()),
flowableTask.getFinally().stream())
.toList();
allFinally.forEach(error -> taskRunList.removeIf(t -> t.getTaskId().equals(error.getId())));
}
}
return execution.withTaskRunList(newTaskRuns).withState(State.Type.RUNNING);
return execution.withTaskRunList(taskRunList).withTaskRun(taskRun).withState(State.Type.RUNNING);
}
return execution.withTaskRun(taskRun).withState(State.Type.RUNNING);
}
public Execution retryWaitFor(Execution execution, String flowableTaskRunId) {
@@ -365,6 +383,7 @@ public class ExecutionService {
if (!isFlowable || s.equals(taskRunId)) {
TaskRun newTaskRun;
State.Type targetState = newState;
if (task instanceof Pause pauseTask) {
State.Type terminalState = newState == State.Type.RUNNING ? State.Type.SUCCESS : newState;
Pause.Resumed _resumed = resumed != null ? resumed : Pause.Resumed.now(terminalState);
@@ -374,23 +393,23 @@ public class ExecutionService {
// if it's a Pause task with no subtask, we terminate the task
if (ListUtils.isEmpty(pauseTask.getTasks()) && ListUtils.isEmpty(pauseTask.getErrors()) && ListUtils.isEmpty(pauseTask.getFinally())) {
if (newState == State.Type.RUNNING) {
newTaskRun = newTaskRun.withState(State.Type.SUCCESS);
targetState = State.Type.SUCCESS;
} else if (newState == State.Type.KILLING) {
newTaskRun = newTaskRun.withState(State.Type.KILLED);
} else {
newTaskRun = newTaskRun.withState(newState);
targetState = State.Type.KILLED;
}
} else {
// we should set the state to RUNNING so that subtasks are executed
newTaskRun = newTaskRun.withState(State.Type.RUNNING);
targetState = State.Type.RUNNING;
}
newTaskRun = newTaskRun.withState(targetState);
} else {
newTaskRun = originalTaskRun.withState(newState);
newTaskRun = originalTaskRun.withState(targetState);
}
if (originalTaskRun.getAttempts() != null && !originalTaskRun.getAttempts().isEmpty()) {
ArrayList<TaskRunAttempt> attempts = new ArrayList<>(originalTaskRun.getAttempts());
attempts.set(attempts.size() - 1, attempts.getLast().withState(newState));
attempts.set(attempts.size() - 1, attempts.getLast().withState(targetState));
newTaskRun = newTaskRun.withAttempts(attempts);
}
@@ -709,7 +728,7 @@ public class ExecutionService {
// An edge case can exist where the execution is resumed automatically before we resume it with a killing.
try {
newExecution = this.resume(execution, flow, State.Type.KILLING, null);
newExecution = newExecution.withState(afterKillState.orElse(newExecution.getState().getCurrent()));
newExecution = newExecution.withState(killingOrAfterKillState);
} catch (Exception e) {
// if we cannot resume, we set it anyway to killing, so we don't throw
log.warn("Unable to resume a paused execution before killing it", e);
@@ -723,6 +742,7 @@ public class ExecutionService {
// immediately without publishing a CrudEvent like it's done on pause/resume method.
return newExecution;
}
public Execution kill(Execution execution, FlowInterface flow) {
return this.kill(execution, flow, Optional.empty());
}

View File

@@ -285,6 +285,10 @@ public class FlowService {
if ((subflowId != null && subflowId.matches(regex)) || (namespace != null && namespace.matches(regex))) {
return;
}
if (subflowId == null || namespace == null) {
// those fields are mandatory so the mandatory validation will apply
return;
}
Optional<Flow> optional = findById(tenantId, subflow.getNamespace(), subflow.getFlowId());
if (optional.isEmpty()) {

View File

@@ -1,9 +1,11 @@
package io.kestra.core.services;
import io.kestra.core.repositories.KvMetadataRepositoryInterface;
import io.kestra.core.storages.StorageInterface;
import io.kestra.core.storages.kv.InternalKVStore;
import io.kestra.core.storages.kv.KVStore;
import io.kestra.core.storages.kv.KVStoreException;
import io.micronaut.data.model.Pageable;
import jakarta.annotation.Nullable;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
@@ -12,6 +14,8 @@ import java.io.IOException;
@Singleton
public class KVStoreService {
@Inject
private KvMetadataRepositoryInterface kvMetadataRepository;
@Inject
private StorageInterface storageInterface;
@@ -46,9 +50,9 @@ public class KVStoreService {
boolean checkIfNamespaceExists = fromNamespace == null || isNotParentNamespace(namespace, fromNamespace);
if (checkIfNamespaceExists && !namespaceService.isNamespaceExists(tenant, namespace)) {
// if it didn't exist, we still check if there are KV as you can add KV without creating a namespace in DB or having flows in it
KVStore kvStore = new InternalKVStore(tenant, namespace, storageInterface);
KVStore kvStore = new InternalKVStore(tenant, namespace, storageInterface, kvMetadataRepository);
try {
if (kvStore.list().isEmpty()) {
if (kvStore.list(Pageable.from(1, 1)).isEmpty()) {
throw new KVStoreException(String.format(
"Cannot access the KV store. The namespace '%s' does not exist.",
namespace
@@ -60,7 +64,7 @@ public class KVStoreService {
return kvStore;
}
return new InternalKVStore(tenant, namespace, storageInterface);
return new InternalKVStore(tenant, namespace, storageInterface, kvMetadataRepository);
}
private static boolean isNotParentNamespace(final String parentNamespace, final String childNamespace) {

View File

@@ -58,10 +58,10 @@ import java.util.stream.Stream;
public class PluginDefaultService {
private static final ObjectMapper NON_DEFAULT_OBJECT_MAPPER = JacksonMapper.ofYaml()
.copy()
.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
private static final ObjectMapper OBJECT_MAPPER = JacksonMapper.ofYaml().copy()
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL);
private static final String PLUGIN_DEFAULTS_FIELD = "pluginDefaults";
private static final TypeReference<List<PluginDefault>> PLUGIN_DEFAULTS_TYPE_REF = new TypeReference<>() {

Some files were not shown because too many files have changed in this diff Show More