Skip to content

Commit

Permalink
Merge branch 'main' into bug-2025-workflow-execution
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh-jonnalagadda authored Oct 21, 2024
2 parents 94c07cd + e1e7eff commit 16f9988
Show file tree
Hide file tree
Showing 35 changed files with 1,190 additions and 315 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
try {
const prCount = parseInt(process.env.PR_COUNT);
const author = process.env.AUTHOR;
const mention = 'talboren';
const prNumber = context.payload.pull_request.number;
const repo = process.env.REPO;
Expand All @@ -68,49 +67,41 @@ jobs:
return `${emoji} **Fantastic work @${author}!** Your very first PR to ${repo} has been merged! 🎉🥳\n\n` +
`You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌\n` +
`If you're feeling adventurous, why not dive into another issue and keep contributing? The community would love to see more from you! 🚀\n\n` +
`For any support, feel free to reach out to the developer onboarding lead: @${mention}. Happy coding! 👩‍💻👨‍💻`;
`For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩‍💻👨‍💻`;
case 2:
return `${emoji} **Well done @${author}!** Two PRs merged already! 🎉🥳\n\n` +
`With your second PR, you're on a roll, and your contributions are already making a difference. 🌟\n` +
`Looking forward to seeing even more contributions from you. The developer onboarding lead: @${mention} is here if you need any help! Keep up the great work! 🚀`;
`Looking forward to seeing even more contributions from you. See you in Slack https://slack.keephq.dev 🚀`;
case 3:
return `${emoji} **You're on fire, @${author}!** Three PRs merged and counting! 🔥🎉\n\n` +
`Your consistent contributions are truly impressive. You're becoming a valued member of our community! 💖\n` +
`Have you considered taking on some more challenging issues? We'd love to see what you can do! 💪\n\n` +
`Remember, @${mention} is always here to support you. Keep blazing that trail! 🚀`;
`Remember, the team is always here to support you. Keep blazing that trail! 🚀`;
case 5:
return `${emoji} **High five, @${author}!** You've hit the incredible milestone of 5 merged PRs! 🖐️✨\n\n` +
`Your dedication to ${repo} is outstanding. You're not just contributing code; you're shaping the future of this project! 🌠\n` +
`We'd love to hear your thoughts on the project. Any ideas for new features or improvements? 🤔\n\n` +
`@${mention} and the whole team applaud your efforts. You're a superstar! 🌟`;
`The whole team applaud your efforts. You're a superstar! 🌟`;
case 10:
return `${emoji} **Double digits, @${author}!** 10 merged PRs is a massive achievement! 🏆🎊\n\n` +
`Your impact on ${repo} is undeniable. You've become a pillar of our community! 🏛️\n` +
`We'd be thrilled to have you take on a mentorship role for newer contributors. Interested? 🧑‍🏫\n\n` +
`@${mention} and everyone here are in awe of your contributions. You're an open source hero! 🦸‍♀️🦸‍♂️`;
`Everyone here are in awe of your contributions. You're an open source hero! 🦸‍♀️🦸‍♂️`;
default:
if (count > 10) {
return `${emoji} **Incredible, @${author}!** You've merged your ${count}th PR! 🎯🎊\n\n` +
`Your ongoing commitment to ${repo} is truly remarkable. You're a driving force in our community! 🚀\n` +
`Your contributions are helping to shape the future of this project. What exciting features or improvements do you envision next? 🔮\n\n` +
`@${mention} and the entire team are grateful for your dedication. You're an inspiration to us all! 💫`;
} else {
return `${emoji} **Great job, @${author}!** You've merged your ${count}th PR! 🎊\n\n` +
`Your contributions to ${repo} are making a real difference. Keep up the fantastic work! 💪\n` +
`Remember, every PR counts and helps improve the project. What will you tackle next? 🤔\n\n` +
`@${mention} is here if you need any guidance. Onward and upward! 🚀`;
}
return "";
}
}
const message = getMessage(prCount);
await github.rest.issues.createComment({
owner: process.env.OWNER,
repo: process.env.REPO,
issue_number: prNumber,
body: message
});
if (message) {
await github.rest.issues.createComment({
owner: process.env.OWNER,
repo: process.env.REPO,
issue_number: prNumber,
body: message
});
}
} catch (error) {
core.setFailed(`Error creating comment: ${error.message}`);
}
}
22 changes: 20 additions & 2 deletions docs/deployment/secret-manager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ The `SECRET_MANAGER_TYPE` environment variable plays a crucial role in the Secre
**Functionality**:

**Default Secret Manager**: If the `SECRET_MANAGER_TYPE` environment variable is set, its value dictates the default type of secret manager that the factory will create.
The value of this variable should correspond to one of the types defined in SecretManagerTypes enum (`FILE`, `GCP`, `K8S`, `VAULT`).
The value of this variable should correspond to one of the types defined in SecretManagerTypes enum (`FILE`, `AWS`, `GCP`, `K8S`, `VAULT`).

**Example Configuration**:

Setting `SECRET_MANAGER_TYPE=GCP` in the environment will make the factory create instances of GcpSecretManager by default.
If `SECRET_MANAGER_TYPE` is not set or is set to `FILE`, the factory defaults to creating instances of FileSecretManager.
This environment variable provides flexibility and ease of configuration, allowing different secret managers to be used in different environments or scenarios without code changes.

## File Secert Manager
## File Secret Manager

The `FileSecretManager` is a concrete implementation of the BaseSecretManager for managing secrets stored in the file system. It uses a specified directory (defaulting to ./) to read, write, and delete secret files.

Expand All @@ -39,6 +39,24 @@ Usage:
- Writing a secret creates or updates a file with the given content.
- Deleting a secret removes the corresponding file.

## AWS Secret Manager

The `AwsSecretManager` integrates with Amazon Web Services' Secrets Manager service for secure secret management. It provides a robust solution for storing and managing secrets in AWS environments.

Configuration:

Required environment variables:
- `AWS_REGION`: The AWS region where your secrets are stored
- For local development:
- `AWS_ACCESS_KEY_ID`: Your AWS access key
- `AWS_SECRET_ACCESS_KEY`: Your AWS secret access key


Usage:

- Manages secrets using AWS Secrets Manager service
- Supports creating, updating, reading, and deleting secrets

## Kubernetes Secret Manager

The `KubernetesSecretManager` interfaces with Kubernetes' native secrets system. It manages secrets within a specified Kubernetes namespace and is designed to operate within a Kubernetes cluster.
Expand Down
3 changes: 3 additions & 0 deletions examples/workflows/new_github_stars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ steps:
previous_stars_count:
default: 0
key: "{{ last_workflow_results.get-github-stars.0.stars }}"
last_stargazer:
default: ""
key: "{{ last_workflow_results.get-github-stars.0.last_stargazer }}"
repository: keephq/keep
actions:
- condition:
Expand Down
68 changes: 40 additions & 28 deletions keep-ui/app/alerts/ColumnSelection.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { FormEvent, Fragment, useRef } from "react";
import { FormEvent, Fragment, useRef, useState } from "react";
import { Table } from "@tanstack/table-core";
import { Button } from "@tremor/react";
import { Button, TextInput } from "@tremor/react";
import { useLocalStorage } from "utils/hooks/useLocalStorage";
import { VisibilityState, ColumnOrderState } from "@tanstack/react-table";
import { FloatingArrow, arrow, offset, useFloating } from "@floating-ui/react";
import { Popover } from "@headlessui/react";
import { FiSettings } from "react-icons/fi";
import { FiSettings, FiSearch } from "react-icons/fi";
import { DEFAULT_COLS, DEFAULT_COLS_VISIBILITY } from "./alert-table-utils";
import { AlertDto } from "./models";

Expand All @@ -31,16 +31,19 @@ export default function ColumnSelection({
});
const tableColumns = table.getAllColumns();

const [, setColumnVisibility] = useLocalStorage<VisibilityState>(
`column-visibility-${presetName}`,
DEFAULT_COLS_VISIBILITY
);
const [columnVisibility, setColumnVisibility] =
useLocalStorage<VisibilityState>(
`column-visibility-${presetName}`,
DEFAULT_COLS_VISIBILITY
);

const [columnOrder, setColumnOrder] = useLocalStorage<ColumnOrderState>(
`column-order-${presetName}`,
DEFAULT_COLS
);

const [searchTerm, setSearchTerm] = useState("");

const columnsOptions = tableColumns
.filter((col) => col.getIsPinned() === false)
.map((col) => col.id);
Expand All @@ -49,41 +52,43 @@ export default function ColumnSelection({
.filter((col) => col.getIsVisible() && col.getIsPinned() === false)
.map((col) => col.id);

const filteredColumns = columnsOptions.filter((column) =>
column.toLowerCase().includes(searchTerm.toLowerCase())
);

const onMultiSelectChange = (
event: FormEvent<HTMLFormElement>,
closePopover: VoidFunction
) => {
event.preventDefault();

const formData = new FormData(event.currentTarget);
const valueKeys = Object.keys(Object.fromEntries(formData.entries()));
const selectedColumnIds = Object.keys(
Object.fromEntries(formData.entries())
);

const newColumnVisibility = columnsOptions.reduce<VisibilityState>(
(acc, key) => {
if (valueKeys.includes(key)) {
return { ...acc, [key]: true };
}
// Update visibility only for the currently visible (filtered) columns.
const newColumnVisibility = { ...columnVisibility };
filteredColumns.forEach((column) => {
newColumnVisibility[column] = selectedColumnIds.includes(column);
});

return { ...acc, [key]: false };
},
{}
);
// Create a new order array with all existing columns and newly selected columns
const updatedOrder = [
...columnOrder,
...selectedColumnIds.filter((id) => !columnOrder.includes(id)),
];

const originalColsOrder = columnOrder.filter((columnId) =>
valueKeys.includes(columnId)
);
const newlyAddedCols = valueKeys.filter(
(columnId) => !columnOrder.includes(columnId)
// Remove any columns that are no longer selected
const finalOrder = updatedOrder.filter(
(id) => selectedColumnIds.includes(id) || !filteredColumns.includes(id)
);

const newColumnOrder = [...originalColsOrder, ...newlyAddedCols];

setColumnVisibility(newColumnVisibility);
setColumnOrder(newColumnOrder);
setColumnOrder(finalOrder);
closePopover();
};


return (
<Popover as={Fragment}>
{({ close }) => (
Expand All @@ -109,15 +114,22 @@ export default function ColumnSelection({
context={context}
/>
<span className="text-gray-400 text-sm">Set table fields</span>
<TextInput
icon={FiSearch}
placeholder="Search fields..."
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
className="mt-2"
/>
<ul className="space-y-1 mt-3 max-h-96 overflow-auto">
{columnsOptions.map((column) => (
{filteredColumns.map((column) => (
<li key={column}>
<label className="cursor-pointer p-2">
<input
className="mr-2"
name={column}
type="checkbox"
defaultChecked={selectedColumns.includes(column)}
defaultChecked={columnVisibility[column]}
/>
{column}
</label>
Expand Down
6 changes: 4 additions & 2 deletions keep-ui/app/alerts/alert-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Fragment } from "react";
import Image from "next/image";
import { Dialog, Transition } from "@headlessui/react";
import { AlertDto } from "./models";
import { Button, Title, Card, Badge } from "@tremor/react";
Expand Down Expand Up @@ -83,10 +84,11 @@ const AlertSidebar = ({ isOpen, toggle, alert }: AlertSidebarProps) => {
<strong>Severity:</strong> {alert.severity}
</p>
<p>
<strong>Source:</strong>{" "}
<img
<Image
src={`/icons/${alert.source![0]}-icon.png`}
alt={alert.source![0]}
width={24}
height={24}
className="inline-block w-6 h-6"
/>
</p>
Expand Down
Loading

0 comments on commit 16f9988

Please sign in to comment.