feedback-to-code/mozzarella huggingface dataset:
Repository: kestra-io/kestra
Issue: Contributing.md frontend config out of date
Labels: bug

### Issue description

Hey, while setting the project locally I've noticed some of the configuration steps for the frontend were out of date.
- VUE_APP_API_URL -> VITE_APP_API_URL
- npm run serve -> npm run dev

I can submit a PR if you're ok with it.

Issue comments:
Yes for sure PR will be appreciate! 
We move to vite few days ago and forgot this part 😬

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 34370d12fd..1a77ce1d41 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -73,20 +73,24 @@ python3 -m pip install virtualenv
 The frontend is made with [Vue.js](https://vuejs.org/) and located on the `/ui` folder.
 
 - `npm install`
-- create a files `ui/.env.development.local` with content `VUE_APP_API_URL=http://localhost:8080` (or your actual server url)
-- `npm run serve` will start the development server with hot reload.
+- create a files `ui/.env.development.local` with content `VITE_APP_API_URL=http://localhost:8080` (or your actual server url)
+- `npm run dev` will start the development server with hot reload.
 - The server start by default on port 8090 and is reachable on `http://localhost:5173`
 - You can run `npm run build` in order to build the front-end that will be delivered from the
-backend (without running the `npm serve`) above.
-
-> If you have CORS restrictions when using the local development npm server, you need to configure
-> the backend to allow the http://localhost:5173 origin
-> ```cors:
->      enabled: true
->      configurations:
->        all:
->          allowedOrigins:
->            - http://localhost:5173```
+backend (without running the `npm run dev`) above.
+
+If you have CORS restrictions when using the local development npm server, you need to configure the backend to allow the http://localhost:5173 origin in `cli/src/main/resources/application-override.yml`
+
+```yaml
+micronaut:
+  server:
+    cors:
+      enabled: true
+      configurations:
+        all:
+          allowedOrigins:
+            - http://localhost:5173
+```
 
 #### Develop plugins
 A complete documentation for developing plugin can be found [here](https://kestra.io/docs/plugin-developer-guide/).


Test patch:
Repository: kestra-io/kestra
Issue: When attempting a new execution on the UI, pressing enter closes the window
Labels: bug

### Expected Behavior

Pressing enter should validate the form and trigger the execution

### Actual Behaviour

The window gets closed and nothing is executed

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.6.1-SNAPSHOT

### Example flow

_No response_

Issue comments:

Pull request review comments:
`ctrl + enter` is better I think and more standard 
We can't find a proper lib for that to be able to add shortcut on the whole application quickly (and don't care about the remove listeners leak ?
Ugly hack due to VueJS bug where submit is triggered  while pressing enter when focus is on input. 

Patch that resolved the issue:
diff --git a/ui/src/components/flows/FlowRun.vue b/ui/src/components/flows/FlowRun.vue
index 2bcdd34832..d710a98f77 100644
--- a/ui/src/components/flows/FlowRun.vue
+++ b/ui/src/components/flows/FlowRun.vue
@@ -13,6 +13,7 @@
                 :prop="input.name"
             >
                 <el-input
+                    @keydown.enter.prevent
                     v-if="input.type === 'STRING' || input.type === 'URI'"
                     v-model="inputs[input.name]"
                 />
@@ -112,24 +113,38 @@
                     input.focus()
                 }
             }, 500)
+
+            this._keyListener = function(e) {
+                if (e.keyCode === 13 && (e.ctrlKey || e.metaKey))  {
+                    e.preventDefault();
+                    this.onSubmit(this.$refs.form);
+                }
+            };
+
+            document.addEventListener("keydown", this._keyListener.bind(this));
+        },
+        beforeUnmount() {
+            document.removeEventListener("keydown", this._keyListener);
         },
         computed: {
             ...mapState("flow", ["flow"]),
         },
         methods: {
             onSubmit(formRef) {
-                formRef.validate((valid) => {
-                    if (!valid) {
-                        return false;
-                    }
+                if (formRef) {
+                    formRef.validate((valid) => {
+                        if (!valid) {
+                            return false;
+                        }
 
-                    executeTask(this, this.flow, this.inputs, {
-                        redirect: this.redirect,
-                        id: this.flow.id,
-                        namespace: this.flow.namespace
-                    })
-                    this.$emit("executionTrigger");
-                });
+                        executeTask(this, this.flow, this.inputs, {
+                            redirect: this.redirect,
+                            id: this.flow.id,
+                            namespace: this.flow.namespace
+                        })
+                        this.$emit("executionTrigger");
+                    });
+                }
             },
             onFileChange(input, e) {
                 if (!e.target) {


Test patch:
Repository: kestra-io/kestra
Issue: 4-digits String as inputs are considered as a date when displayed
Labels: bug

### Expected Behavior

My usecase was to get a warehouse id as input which can be digits-only or alphanumerics-composed.
It should display String as raw IMO ? Especially since there is a type: DATE

### Actual Behaviour

<img width="801" alt="image" src="https://user-images.githubusercontent.com/37618489/225765270-a861c61b-2ea0-4e29-be2a-83211f1aa125.png">
<img width="296" alt="image" src="https://user-images.githubusercontent.com/37618489/225766081-c0385822-041d-4248-a6d8-d10bda4db1db.png">

As you can see, my input is parsed and displayed as date in the input information of the execution while it is treated as my raw String inside my flow.

### Steps To Reproduce

In the quickstart configuration (v0.8.0-SNAPSHOT), run the given example flow and check the executions tab

### Environment Information

- Kestra Version: 0.8.0-SNAPSHOT
- Operating System (OS / Docker / Kubernetes): MacOS
- Java Version (If not docker): Under docker


### Example flow

```
id: numberAsDate
namespace: simple.test
inputs:
  - name: numberAsString
    type: STRING
    defaults: "2685"
tasks:
  - id: print
    type: io.kestra.core.tasks.debugs.Echo
    format: "{{inputs.numberAsString}}"
```

Issue comments:
Will try to correct this :) However, I don't know if there is anywhere else where the date parsing is used in a useful way ?

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/utils/utils.js b/ui/src/utils/utils.js
index 983797f238..2195d08e52 100644
--- a/ui/src/utils/utils.js
+++ b/ui/src/utils/utils.js
@@ -52,22 +52,23 @@ export default class Utils {
         const flat = Utils.flatten(data);
 
         return Object.keys(flat).map(key => {
+            let rawValue = flat[key];
             if (key === "variables.executionId") {
-                return {key, value: flat[key], subflow: true};
+                return {key, value: rawValue, subflow: true};
             }
 
-            if (typeof (flat[key]) === "string") {
-                let date = moment(flat[key], moment.ISO_8601);
+            if (typeof rawValue === "string" && rawValue.match(/\d{4}-\d{2}-\d{2}/)) {
+                let date = moment(rawValue, moment.ISO_8601);
                 if (date.isValid()) {
-                    return {key, value: flat[key], date: true};
+                    return {key, value: rawValue, date: true};
                 }
             }
 
-            if (typeof (flat[key]) === "number") {
-                return {key, value: Utils.number(flat[key])};
+            if (typeof rawValue === "number") {
+                return {key, value: Utils.number(rawValue)};
             }
 
-            return {key, value: flat[key]};
+            return {key, value: rawValue};
 
         })
     }


Test patch:
Repository: kestra-io/kestra
Issue: Can't trigger autocompletion modal on MacOS
Labels: bug

### Expected Behavior

Hit ⌘ + Space when the suggestion modal is off should trigger the modal back and get autocompletion back again

### Actual Behaviour

Hitting the given shortcut is not working on my side and it does nothing

### Steps To Reproduce

- Start typing a task
- When it comes to writing the type, just write "type: " then hit escape to put the autocomplete modal OFF
- Try to hit ⌘ + Space => Nothing is happening

### Environment Information

- Kestra Version: 0.8.0-SNAPSHOT
- Operating System (OS / Docker / Kubernetes): MacOS


### Example flow

Any flow

Issue comments:
I don't know if it's related to my own MAC shortcut (although I couldn't find any shortcut conflicting).
I managed to get something working using this

```
monaco.editor.addKeybindingRule(
    {
        keybinding:  monaco.KeyMod.CtrlCmd | monaco.KeyCode.Space,
        command: "editor.action.triggerSuggest"
    }
)
```

Going to make a PR, feel free to challenge it if you think it is related to my environment but I can't get why it isn't working.
Also, I checked Monaco Editor for any clue but didn't manage to find anything related
you can create a PR, you are not the only one I think, I already have some report about that in the past :rocket: 
Done !

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/inputs/MonacoEditor.vue b/ui/src/components/inputs/MonacoEditor.vue
index a7d47debf2..46ea2a3712 100644
--- a/ui/src/components/inputs/MonacoEditor.vue
+++ b/ui/src/components/inputs/MonacoEditor.vue
@@ -166,6 +166,11 @@
                         options["model"] = monaco.editor.createModel(this.value, this.language);
                     }
 
+                    monaco.editor.addKeybindingRule({
+                        keybinding:  monaco.KeyMod.CtrlCmd | monaco.KeyCode.Space,
+                        command: "editor.action.triggerSuggest"
+                    })
+
                     this.editor = monaco.editor.create(this.$el, options);
                 }
 


Test patch:
Repository: kestra-io/kestra
Issue: Attempt to kill the whole process tree on timeout
Labels: bug

### Expected Behavior

In case of timeout, the Bash task tries to kill the whole spawned process tree.

### Actual Behaviour

In case of timeout, the Bash task kills only the started initial process.

This results in any child processes spawned by the parent process remain running - effectively avoiding the timeout restriction.

### Steps To Reproduce

1. Define a task using `io.kestra.core.tasks.scripts.Bash` running a script
2. Set a reasonable `timeout` for the task
3. Make the script run a long running action (`sleep`, etc.)
4. Run the flow
5. List running processes
6. Wait for the Bash task to hit the timeout
7. List running processes again

### Environment Information

- Kestra Version: 0.8.0-SNAPSHOT
- Operating System (OS / Docker / Kubernetes): CentOS
- Java Version (If not docker): openjdk version "11.0.18" 2023-01-17 LTS


### Example flow

``` yaml
id: BashTest
namespace: io.kestra.tests
description: Test if the Bash processes tree gets killed properly.
disabled: false

tasks:
  - id: long-running-task
    type: io.kestra.core.tasks.scripts.Bash
    description: "Long Bash task gets killed on timeout"
    commands:
      - "/tmp/sleep.sh"
 
taskDefaults:
  - type: io.kestra.core.tasks.scripts.Bash
    values:
      interpreter: /bin/bash
      timeout: PT5S
```

```bash
#!/bin/bash

sleep 100
```

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/core/src/main/java/io/kestra/core/tasks/scripts/runners/ProcessBuilderScriptRunner.java b/core/src/main/java/io/kestra/core/tasks/scripts/runners/ProcessBuilderScriptRunner.java
index b3281a01ff..5669b063fa 100644
--- a/core/src/main/java/io/kestra/core/tasks/scripts/runners/ProcessBuilderScriptRunner.java
+++ b/core/src/main/java/io/kestra/core/tasks/scripts/runners/ProcessBuilderScriptRunner.java
@@ -72,8 +72,17 @@ public RunResult run(
             return new RunResult(exitCode, stdOut, stdErr);
         } catch (InterruptedException e) {
             logger.warn("Killing process {} for InterruptedException", pid);
+            killDescendantsOf(process.toHandle(), logger);
             process.destroy();
             throw e;
         }
     }
+
+    private void killDescendantsOf(ProcessHandle process, Logger logger) {
+        process.descendants().forEach(processHandle -> {
+            if (!processHandle.destroy()) {
+                logger.warn("Descendant process {} of {} couldn't be killed", processHandle.pid(), process.pid());
+            }
+        });
+    }
 }


Test patch:
Repository: kestra-io/kestra
Issue: UI task documentation dispays generic task proprties
Labels: bug

### Expected Behavior

Inside the plugin documentation site, the task generic properties (like description, disabled, ...) are not displayed to avoid having too many properties that will clutter the documentation.

For example for the XmlReadre task:
![image](https://user-images.githubusercontent.com/1819009/233577581-55c1f2d8-1814-4cfc-a136-e2e27ad5772f.png)

Inside the UI flow editor, the documentation contains all the properties which make it hard to read and find useful information.

![image](https://user-images.githubusercontent.com/1819009/233577828-a371d832-b132-46d1-8e63-7cdefaaa4998.png)

Both should display the same properties


### Actual Behaviour

Inside the UI flow editor, task default properties are displayd.

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.8.1-SNAPSHOT
- Operating System (OS / Docker / Kubernetes):
- Java Version (If not docker):


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/stores/plugins.js b/ui/src/stores/plugins.js
index dd60a855e5..3632434a79 100644
--- a/ui/src/stores/plugins.js
+++ b/ui/src/stores/plugins.js
@@ -21,7 +21,7 @@ export default {
                 throw new Error("missing required cls");
             }
 
-            return this.$http.get(`/api/v1/plugins/${options.cls}?all=true`, {}).then(response => {
+            return this.$http.get(`/api/v1/plugins/${options.cls}`, {}).then(response => {
                 commit("setPlugin", response.data)
 
                 return response.data;
diff --git a/webserver/src/main/java/io/kestra/webserver/controllers/PluginController.java b/webserver/src/main/java/io/kestra/webserver/controllers/PluginController.java
index 00bcb0aec2..7d4b416eab 100644
--- a/webserver/src/main/java/io/kestra/webserver/controllers/PluginController.java
+++ b/webserver/src/main/java/io/kestra/webserver/controllers/PluginController.java
@@ -122,7 +122,7 @@ public Map<String, PluginIcon> icons() {
     @Operation(tags = {"Plugins"}, summary = "Get plugin documentation")
     public HttpResponse<Doc> pluginDocumentation(
         @Parameter(description = "The plugin full class name") @PathVariable String cls,
-        @Parameter(description = "Include all the properties") @QueryValue(value = "all", defaultValue = "false") boolean allProperties
+        @Parameter(description = "Include all the properties") @QueryValue(value = "all", defaultValue = "false") Boolean allProperties
     ) throws IOException {
         ClassPluginDocumentation classPluginDocumentation = pluginDocumentation(
             pluginService.allPlugins(),


Test patch:
Repository: kestra-io/kestra
Issue: Flow Validation not triggered
Labels: bug
enhancement

### Expected Behavior

In the flow editor, within the source/doc view, the validation is not being triggered; if you swap to the source/topology view, it is, and your error appears.

### Actual Behaviour

_No response_

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version:
- Operating System (OS / Docker / Kubernetes):
- Java Version (If not docker):


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/graph/Topology.vue b/ui/src/components/graph/Topology.vue
index 128216ee8d..19e06722e5 100644
--- a/ui/src/components/graph/Topology.vue
+++ b/ui/src/components/graph/Topology.vue
@@ -732,10 +732,8 @@
         flowYaml.value = event;
         haveChange.value = true;
 
-        if (showTopology.value === "combined") {
-            clearTimeout(timer.value);
-            timer.value = setTimeout(() => onEdit(event), 500);
-        }
+        clearTimeout(timer.value);
+        timer.value = setTimeout(() => onEdit(event), 500);
     }
 
     const switchView = (event) => {
@@ -1170,4 +1168,4 @@
         flex-direction: column;
         width: 20rem;
     }
-</style>
\ No newline at end of file
+</style>


Test patch:
Repository: kestra-io/kestra
Issue: Refreshing editor page make title disappear
Labels: bug

### Expected Behavior

When refreshing on the editor page, should not remove title.

### Actual Behaviour

![image](https://github.com/kestra-io/kestra/assets/37600690/5a21f2a8-6b09-41cf-9e50-19b7a8b9c840)


### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.8.1 SNAPSHOT


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/flows/FlowCreate.vue b/ui/src/components/flows/FlowCreate.vue
index 9482878481..ca26a77258 100644
--- a/ui/src/components/flows/FlowCreate.vue
+++ b/ui/src/components/flows/FlowCreate.vue
@@ -17,8 +17,10 @@
 <script>
     import Topology from "../graph/Topology.vue";
     import {mapGetters, mapState} from "vuex";
+    import RouteContext from "../../mixins/routeContext";
 
     export default {
+        mixins: [RouteContext],
         components: {
             Topology
         },
@@ -37,6 +39,11 @@
             ...mapState("plugin", ["pluginSingleList", "pluginsDocumentation"]),
             ...mapGetters("core", ["guidedProperties"]),
             ...mapGetters("flow", ["flowError"]),
+            routeInfo() {
+                return {
+                    title: this.$t("flows")
+                };
+            },
         },
         beforeRouteLeave(to, from, next) {
             this.$store.commit("flow/setFlow", null);


Test patch:
Repository: kestra-io/kestra
Issue: Deleted flow led to a 404 on execution page
Labels: bug

And it's seems that revision is not passed on call from this page

Issue comments:
Can't reproduce on my side (either from Flow page or Revision tab 🤔). Do you have any steps to reproduce ?
on the execution page, execute a flow, delete the flow and go back on the execution page of this deleted flow. 
indeed

![image](https://github.com/kestra-io/kestra/assets/46634684/8c567b39-e21c-424e-a362-0442b75f57ce)
![image](https://github.com/kestra-io/kestra/assets/46634684/edf8af5c-33be-426a-9bcf-6f1a9e6b9b15)



Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/stores/flow.js b/ui/src/stores/flow.js
index 334fd0f9a0..065bdc644d 100644
--- a/ui/src/stores/flow.js
+++ b/ui/src/stores/flow.js
@@ -52,6 +52,7 @@ export default {
         loadFlow({commit}, options) {
             return this.$http.get(`/api/v1/flows/${options.namespace}/${options.id}?source=true`,
                 {
+                    params: options,
                     validateStatus: (status) => {
                         return options.deleted ? status === 200 || status === 404 : status === 200;
                     }
diff --git a/webserver/src/main/java/io/kestra/webserver/controllers/FlowController.java b/webserver/src/main/java/io/kestra/webserver/controllers/FlowController.java
index eb4514ead5..301996e8fa 100644
--- a/webserver/src/main/java/io/kestra/webserver/controllers/FlowController.java
+++ b/webserver/src/main/java/io/kestra/webserver/controllers/FlowController.java
@@ -111,14 +111,15 @@ public FlowGraph flowGraphSource(
     public Flow index(
         @Parameter(description = "The flow namespace") @PathVariable String namespace,
         @Parameter(description = "The flow id") @PathVariable String id,
-        @Parameter(description = "Include the source code") @QueryValue(defaultValue = "false") boolean source
+        @Parameter(description = "Include the source code") @QueryValue(defaultValue = "false") boolean source,
+        @Parameter(description = "Get latest revision by default") @Nullable @QueryValue Integer revision
     ) {
         return source ?
             flowRepository
-                .findByIdWithSource(namespace, id)
+                .findByIdWithSource(namespace, id, Optional.ofNullable(revision))
                 .orElse(null) :
             flowRepository
-                .findById(namespace, id)
+                .findById(namespace, id, Optional.ofNullable(revision))
                 .orElse(null);
     }
 


Test patch:
Repository: kestra-io/kestra
Issue: Low code failed to open subobject
Labels: bug

![image](https://user-images.githubusercontent.com/2064609/236322787-d5c002ee-30e3-4d7e-a130-53d38685c3e1.png)


Issue comments:
@tchiotludo precise the flow pls
https://demo.kestra.io/ui/flows/edit/io.kestra.demo.scripts/bash-docker-with-files/editor

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/flows/tasks/TaskComplex.vue b/ui/src/components/flows/tasks/TaskComplex.vue
index 29405dcca0..6a6a73030a 100644
--- a/ui/src/components/flows/tasks/TaskComplex.vue
+++ b/ui/src/components/flows/tasks/TaskComplex.vue
@@ -4,7 +4,7 @@
         :disabled="true"
     >
         <template #append>
-            <el-button :icon="Eye" @click="this.isOpen = true" />
+            <el-button :icon="Eye" @click="isOpen = true" />
         </template>
     </el-input>
 


Test patch:
Repository: kestra-io/kestra
Issue: Discrepancies while changing color "Theme" and "Editor Theme"
Labels: bug
enhancement

### Expected Behavior

Color themes should be applied

### Actual Behaviour

![image](https://user-images.githubusercontent.com/46634684/235871398-06399375-6fe4-41bc-a287-87e81d4c6fb4.png)

Themes are not applied when Theme = Dark and Editor Theme = Light.

![image](https://user-images.githubusercontent.com/46634684/235871322-db593e7e-2c98-45b6-961f-b8ee4529551f.png)


### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.8.1
- Operating System (OS / Docker / Kubernetes): Docker
- Java Version (If not docker):


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/inputs/Editor.vue b/ui/src/components/inputs/Editor.vue
index e88e9ef218..74687420c9 100644
--- a/ui/src/components/inputs/Editor.vue
+++ b/ui/src/components/inputs/Editor.vue
@@ -113,7 +113,8 @@
                     !this.input ? "" : "single-line",
                     !this.fullHeight ? "" : "full-height",
                     !this.original ? "" : "diff",
-                    "theme-" + this.themeComputed
+                    "theme-" + this.themeComputed,
+                    this.themeComputed === "dark" ? "custom-dark-vs-theme" : ""
                 ]
             },
             showPlaceholder() {
@@ -436,7 +437,7 @@
         }
     }
 
-    html.dark {
+    .custom-dark-vs-theme {
         .monaco-editor, .monaco-editor-background {
             background-color: var(--input-bg);
             --vscode-editor-background: var(--input-bg);


Test patch: