Skip to content

Commit

Permalink
Merge branch 'main' into feature/historical-rules-poc
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirFilonov authored Dec 17, 2024
2 parents db60ab7 + 815bbeb commit 1bb05c0
Show file tree
Hide file tree
Showing 19 changed files with 499 additions and 160 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/test-pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,25 @@ jobs:
- name: Install dependencies using poetry
run: poetry install --no-interaction --no-root --with dev

- name: Install Playwright dependencies
run: npx playwright install --with-deps
- name: Get Playwright version from poetry.lock
id: playwright-version
run: |
PLAYWRIGHT_VERSION=$(grep "playwright" poetry.lock -A 5 | grep "version" | head -n 1 | cut -d'"' -f2)
echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ steps.playwright-version.outputs.version }}

- name: Install playwright
run: poetry run playwright install
- name: Install Playwright and dependencies
run: |
if [ "${{ steps.playwright-cache.outputs.cache-hit }}" != "true" ]; then
poetry run playwright install --with-deps
else
poetry run playwright install-deps
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
4 changes: 1 addition & 3 deletions docker/Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


FROM node:18-alpine AS base
FROM node:20-alpine AS base

# Install dependencies only when needed
FROM base AS deps
Expand Down
8 changes: 8 additions & 0 deletions keep-ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
.next
.vercel
.env.*
.venv/
.vscode/
.github/
.pytest_cache
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ const PushAlertToServerModal = ({

const onSubmit: SubmitHandler<FieldValues> = async (data) => {
try {
// if type is string, parse it to JSON
if (typeof data.alertJson === "string") {
data.alertJson = JSON.parse(data.alertJson);
}

const response = await api.post(
`/alerts/event/${data.source.type}`,
data.alertJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import { Button, Card, Subtitle, Title } from "@tremor/react";
import ReactLoading from "react-loading";
import { ExecutionResults } from "./workflow-execution-results";
import { WorkflowExecution, WorkflowExecutionFailure } from "./types";
import { ApiClient } from "@/shared/api";

interface Props {
closeModal: () => void;
workflowExecution: WorkflowExecution | WorkflowExecutionFailure | null;
apiClient: ApiClient;
}

export default function BuilderWorkflowTestRunModalContent({
closeModal,
workflowExecution,
apiClient,
}: Props) {
return (
<>
Expand All @@ -34,7 +37,10 @@ export default function BuilderWorkflowTestRunModalContent({
<Card className={`p-4 md:p-10 mx-auto max-w-7xl mt-6 h-full`}>
<div className="flex flex-col">
{workflowExecution ? (
<ExecutionResults executionData={workflowExecution} />
<ExecutionResults
executionData={workflowExecution}
api={apiClient}
/>
) : (
<div className="flex justify-center">
<ReactLoading
Expand Down
2 changes: 1 addition & 1 deletion keep-ui/app/(keep)/workflows/builder/builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { globalValidatorV2, stepValidatorV2 } from "./builder-validators";
import Modal from "react-modal";
import { Alert } from "./alert";
import BuilderModalContent from "./builder-modal";
import { useApiUrl } from "utils/hooks/useConfig";
import Loader from "./loader";
import { stringify } from "yaml";
import { useSearchParams } from "next/navigation";
Expand Down Expand Up @@ -344,6 +343,7 @@ function Builder({
<BuilderWorkflowTestRunModalContent
closeModal={closeWorkflowExecutionResultsModal}
workflowExecution={runningWorkflowExecution}
apiClient={api}
/>
</Modal>
{generateModalIsOpen || testRunModalOpen ? null : (
Expand Down
2 changes: 2 additions & 0 deletions keep-ui/app/(keep)/workflows/builder/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface WorkflowExecution {
logs?: LogEntry[] | null;
error?: string | null;
execution_time?: number;
event_id?: string;
event_type?: string;
}

export interface PaginatedWorkflowExecutionDto {
Expand Down
Loading

0 comments on commit 1bb05c0

Please sign in to comment.