Skip to content

Commit

Permalink
Merge branch 'develop' into feat/query-filter-operation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeSouid committed Jan 31, 2025
2 parents 50124a4 + dee76c0 commit 13562f1
Show file tree
Hide file tree
Showing 31 changed files with 257 additions and 106 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
# to save corepack from itself
COREPACK_INTEGRITY_KEYS: 0
name: Check & Publish
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'The release version (e.g., 0.21.0)'
description: 'The release version (e.g., 0.21.0-RC1)'
required: true
type: string
nextVersion:
Expand All @@ -25,6 +25,15 @@ jobs:
with:
fetch-depth: 0

# Setup build
- uses: ./actions/.github/actions/setup-build
id: build
with:
java-enabled: true
node-enabled: true
python-enabled: true
caches-enabled: true

# Get Plugins List
- name: Get Plugins List
uses: ./.github/actions/plugins-list
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/tag-plugins.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update and Tag Kestra Plugins
name: Set Version and Tag Plugins

on:
workflow_dispatch:
Expand All @@ -21,6 +21,15 @@ jobs:
with:
fetch-depth: 0

# Setup build
- uses: ./actions/.github/actions/setup-build
id: build
with:
java-enabled: true
node-enabled: true
python-enabled: true
caches-enabled: true

# Get Plugins List
- name: Get Plugins List
uses: ./.github/actions/plugins-list
Expand All @@ -29,7 +38,7 @@ jobs:
plugin-version: 'LATEST'

# Execute
- name: Tag Plugins
- name: Set Version and Tag Plugins
if: ${{ github.event.inputs.dryRun == 'false' }}
env:
GITHUB_PAT: ${{ secrets.GH_PERSONAL_TOKEN }}
Expand All @@ -40,7 +49,7 @@ jobs:
--yes \
${{ steps.plugins-list.outputs.repositories }}
- name: Run Gradle Release (DRY_RUN)
- name: Set Version and Tag Plugins (DRY_RUN)
if: ${{ github.event.inputs.dryRun == 'true' }}
env:
GITHUB_PAT: ${{ secrets.GH_PERSONAL_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.kestra.core.utils.TestsUtils;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.RetryingTest;
import reactor.core.publisher.Flux;

import java.time.Duration;
Expand All @@ -43,7 +43,7 @@ class TimeoutTest {
@Inject
private RunnerUtils runnerUtils;

@Test
@RetryingTest(5) // Flaky on CI but never locally even with 100 repetitions
void timeout() throws TimeoutException, QueueException {
List<LogEntry> logs = new CopyOnWriteArrayList<>();
Flux<LogEntry> receive = TestsUtils.receive(workerTaskLogQueue, either -> logs.add(either.getLeft()));
Expand Down
12 changes: 11 additions & 1 deletion release-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# ./release-plugins.sh --release-version=0.20.0 --next-version=0.21.0-SNAPSHOT
# To release a specific plugin:
# ./release-plugins.sh --release-version=0.20.0 --next-version=0.21.0-SNAPSHOT plugin-kubernetes

# To release specific plugins from file:
# ./release-plugins.sh --release-version=0.20.0 --plugin-file .plugins
#===============================================================================

set -e;
Expand All @@ -43,6 +44,7 @@ usage() {
echo "Options:"
echo " --release-version <version> Specify the release version (required)."
echo " --next-version <version> Specify the next version (required)."
echo " --plugin-file File containing the plugin list (default: .plugins)"
echo " --dry-run Specify to run in DRY_RUN."
echo " -y, --yes Automatically confirm prompts (non-interactive)."
echo " -h, --help Show this help message and exit."
Expand Down Expand Up @@ -81,6 +83,14 @@ while [[ "$#" -gt 0 ]]; do
NEXT_VERSION="${1#*=}"
shift
;;
--plugin-file)
PLUGIN_FILE="$2"
shift 2
;;
--plugin-file=*)
PLUGIN_FILE="${1#*=}"
shift
;;
--dry-run)
DRY_RUN=true
shift
Expand Down
14 changes: 12 additions & 2 deletions tag-release-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# ./tag-release-plugins.sh --release-version=0.20.0
# To release a specific plugin:
# ./tag-release-plugins.sh --release-version=0.20.0 plugin-kubernetes

# To release specific plugins from file:
# ./tag-release-plugins.sh --release-version=0.20.0 --plugin-file .plugins
#===============================================================================

set -e;
Expand All @@ -40,6 +41,7 @@ usage() {
echo
echo "Options:"
echo " --release-version <version> Specify the release version (required)."
echo " --plugin-file File containing the plugin list (default: .plugins)"
echo " --dry-run Specify to run in DRY_RUN."
echo " -y, --yes Automatically confirm prompts (non-interactive)."
echo " -h, --help Show this help message and exit."
Expand Down Expand Up @@ -70,6 +72,14 @@ while [[ "$#" -gt 0 ]]; do
RELEASE_VERSION="${1#*=}"
shift
;;
--plugin-file)
PLUGIN_FILE="$2"
shift 2
;;
--plugin-file=*)
PLUGIN_FILE="${1#*=}"
shift
;;
--dry-run)
DRY_RUN=true
shift
Expand Down Expand Up @@ -163,7 +173,7 @@ do
git checkout "$RELEASE_BRANCH";

# Update version
sed -i.bak "s/^version=.*/version=$RELEASE_VERSION/" ./gradle.properties
sed -i "s/^version=.*/version=$RELEASE_VERSION/" ./gradle.properties
git add ./gradle.properties
git commit -m"chore(version): update to version 'v$RELEASE_VERSION'."
git push
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/EnterpriseBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
defineProps({
enable: {
type: Boolean,
required: true,
default: false,
},
})
</script>
Expand Down
2 changes: 2 additions & 0 deletions ui/src/components/code/NoCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:metadata
@update-metadata="(k, v) => emits('updateMetadata', {[k]: v})"
@update-task="(yaml) => emits('updateTask', yaml)"
@reorder="(yaml) => emits('reorder', yaml)"
@update-documentation="(task) => emits('updateDocumentation', task)"
/>
</div>
Expand All @@ -30,6 +31,7 @@
"updateTask",
"updateMetadata",
"updateDocumentation",
"reorder",
]);
const props = defineProps({
flow: {type: String, required: true},
Expand Down
48 changes: 38 additions & 10 deletions ui/src/components/code/components/collapse/Collapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
<Creation :section="item.title" />
</template>

<template v-if="creation">
<Element
v-for="(element, elementIndex) in item.elements"
:key="elementIndex"
:section="item.title"
:element
@remove-element="removeElement(item.title, elementIndex)"
/>
</template>
<Element
v-for="(element, elementIndex) in item.elements"
:key="elementIndex"
:section="item.title"
:element
@remove-element="removeElement(item.title, elementIndex)"
@move-element="
(direction: 'up' | 'down') =>
moveElement(
item.elements,
element.id,
elementIndex,
direction,
)
"
/>
</el-collapse-item>
</el-collapse>
</template>
Expand All @@ -32,7 +39,7 @@
import Creation from "./buttons/Creation.vue";
import Element from "./Element.vue";
const emits = defineEmits(["remove"]);
const emits = defineEmits(["remove", "reorder"]);
const props = defineProps({
items: {
Expand Down Expand Up @@ -67,6 +74,27 @@
}
});
};
import {YamlUtils as YAML_FROM_UI_LIBS} from "@kestra-io/ui-libs";
const moveElement = (
items: Record<string, any>[] | undefined,
elementID: string,
index: number,
direction: "up" | "down",
) => {
if (!items || !props.flow) return;
if (
(direction === "up" && index === 0) ||
(direction === "down" && index === items.length - 1)
)
return;
const newIndex = direction === "up" ? index - 1 : index + 1;
emits(
"reorder",
YAML_FROM_UI_LIBS.swapTasks(props.flow, elementID, items[newIndex].id),
);
};
</script>

<style scoped lang="scss">
Expand Down
8 changes: 6 additions & 2 deletions ui/src/components/code/components/collapse/Element.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@
size="small"
class="border-0"
/>
<div class="d-flex flex-column">
<ChevronUp @click.prevent.stop="emits('moveElement', 'up')" />
<ChevronDown @click.prevent.stop="emits('moveElement', 'down')" />
</div>
</div>
</template>

<script setup lang="ts">
import {computed} from "vue";
import {DeleteOutline} from "../../utils/icons";
import {DeleteOutline, ChevronUp, ChevronDown} from "../../utils/icons";
import TaskIcon from "@kestra-io/ui-libs/src/components/misc/TaskIcon.vue";
const emits = defineEmits(["removeElement"]);
const emits = defineEmits(["removeElement", "moveElement"]);
const props = defineProps({
section: {type: String, required: true},
Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/code/segments/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
creation
:flow
@remove="(yaml) => emits('updateTask', yaml)"
@reorder="(yaml) => emits('reorder', yaml)"
/>

<hr class="my-4">
Expand Down Expand Up @@ -96,6 +97,7 @@
"updateTask",
"updateMetadata",
"updateDocumentation",
"reorder",
]);
const saveEvent = (e: KeyboardEvent) => {
Expand Down Expand Up @@ -235,6 +237,7 @@
"error_handlers",
YamlUtils.parse(props.flow).errors ?? [],
),
getSectionTitle("finally", YamlUtils.parse(props.flow).finally ?? []),
];
});
</script>
72 changes: 41 additions & 31 deletions ui/src/components/code/segments/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,41 +125,51 @@
YamlUtils.parse(yaml.value).id,
);
if (route.query.section === SECTIONS.TRIGGERS.toLowerCase()) {
const existingTask = YamlUtils.checkTaskAlreadyExist(
source,
CURRENT.value,
);
if (existingTask) {
store.dispatch("core/showMessage", {
variant: "error",
title: "Trigger Id already exist",
message: `Trigger Id ${existingTask} already exist in the flow.`,
});
return;
const currentSection = route.query.section;
const isCreation =
props.creation &&
(!route.query.identifier || route.query.identifier === "new");
let result;
if (isCreation) {
if (currentSection === "tasks") {
const existing = YamlUtils.checkTaskAlreadyExist(
source,
CURRENT.value,
);
if (existing) {
store.dispatch("core/showMessage", {
variant: "error",
title: "Task with same ID already exist",
message: `Task in ${route.query.section} block with ID: ${existing} already exist in the flow.`,
});
return;
}
result = YamlUtils.insertTask(
source,
route.query.target ?? YamlUtils.getLastTask(source),
task,
route.query.position ?? "after",
);
} else if (currentSection === "triggers") {
result = YamlUtils.insertTrigger(source, CURRENT.value);
} else if (currentSection === "error handlers") {
result = YamlUtils.insertError(source, CURRENT.value);
} else if (currentSection === "finally") {
result = YamlUtils.insertFinally(source, CURRENT.value);
}
emits("updateTask", YamlUtils.insertTrigger(source, CURRENT.value));
CURRENT.value = null;
} else {
const action =
props.creation &&
(!route.query.identifier || route.query.identifier === "new")
? YamlUtils.insertTask(
source,
route.query.target ?? YamlUtils.getLastTask(source),
task,
route.query.position ?? "after",
)
: YamlUtils.replaceTaskInDocument(
source,
route.query.identifier,
task,
);
emits("updateTask", action);
result = YamlUtils.replaceTaskInDocument(
source,
route.query.identifier,
task,
);
}
emits("updateTask", result);
store.commit("code/removeBreadcrumb", {last: true});
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Loading

0 comments on commit 13562f1

Please sign in to comment.