Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion .github/actions/start-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,46 @@ runs:
done < list_deployments.txt
}

scale_namespace_statefulsets() {
local namespace=$1
local default_replicas=$2
local exclude_statefulsets=$3
local specific_scales=$4
echo "Processing statefulsets in namespace: $namespace"
kubectl get statefulset -n $namespace | awk 'NR > 1 {print $1}' > list_statefulsets.txt
while read STATEFULSET_NAME; do
if [[ " $exclude_statefulsets " == *" $STATEFULSET_NAME "* ]]; then
echo "Skipping excluded statefulset: $STATEFULSET_NAME"
continue
fi
replicas=$default_replicas
for scale in $specific_scales; do
if [[ $scale == "$STATEFULSET_NAME:"* ]]; then
replicas=${scale#*:}
break
fi
done
kubectl scale statefulset "$STATEFULSET_NAME" --replicas=$replicas --namespace="$namespace"
echo "Scaled statefulset $STATEFULSET_NAME to $replicas replicas in namespace $namespace"
done < list_statefulsets.txt
}

scale_ingress_controllers() {
kubectl scale deployment aws-load-balancer-controller --replicas=1 -n kube-system
kubectl scale deployment ext-ngnix-controller-controller --replicas=1 -n kube-system
kubectl scale deployment int-ngnix-controller-controller --replicas=1 -n kube-system
kubectl scale deployment nginx-ingress-preview-controller --replicas=1 -n kube-system
}

scale_namespace_deployments "appsmith" "1" "" ""

scale_namespace_deployments "default" "1" "twingate-eks-connector-2" "unified-api:3 unified-worker:2 wf-service:3"

scale_namespace_deployments "monitoring" "1" "loki-v3-gateway" "loki-v3-query-frontend:2"
scale_namespace_deployments "monitoring" "1" "" "loki-v3-query-frontend:2"

scale_namespace_statefulsets "monitoring" "1" "" "mimir-ingester:3 mimir-store-gateway-zone-a:1 mimir-store-gateway-zone-b:1 mimir-store-gateway-zone-c:1"

scale_ingress_controllers

for ns in "pg-admin" "rosette" "rosettev2" "temporal"; do
scale_namespace_deployments "$ns" "1" "" ""
Expand Down
28 changes: 27 additions & 1 deletion .github/actions/stop-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,37 @@ runs:
done < list_deployments.txt
}

scale_namespace_statefulsets() {
local namespace=$1
local exclude_statefulsets=$2
echo "Processing statefulsets in namespace: $namespace"
kubectl get statefulset -n $namespace | awk 'NR > 1 {print $1}' > list_statefulsets.txt
while read STATEFULSET_NAME; do
if [[ " $exclude_statefulsets " == *" $STATEFULSET_NAME "* ]]; then
echo "Skipping excluded statefulset: $STATEFULSET_NAME"
continue
fi
kubectl scale statefulset "$STATEFULSET_NAME" --replicas=0 --namespace="$namespace"
echo "Scaled down statefulset $STATEFULSET_NAME to 0 replicas in namespace $namespace"
done < list_statefulsets.txt
}

scale_down_ingress_controllers() {
kubectl scale deployment aws-load-balancer-controller --replicas=0 -n kube-system
kubectl scale deployment ext-ngnix-controller-controller --replicas=0 -n kube-system
kubectl scale deployment int-ngnix-controller-controller --replicas=0 -n kube-system
kubectl scale deployment nginx-ingress-preview-controller --replicas=0 -n kube-system
}

scale_namespace_deployments "appsmith" ""

scale_namespace_deployments "default" "twingate-eks-connector-2"

scale_namespace_deployments "monitoring" "loki-v3-gateway"
scale_namespace_deployments "monitoring" ""

scale_namespace_statefulsets "monitoring" ""

scale_down_ingress_controllers

for ns in "pg-admin" "rosette" "rosettev2" "temporal"; do
scale_namespace_deployments "$ns" ""
Expand Down
42 changes: 39 additions & 3 deletions .github/workflows/start-dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ permissions:

on:
workflow_dispatch:
# schedule:
# - cron: '0 5 * * 1-4,0' # 7:00 AM Israel time
schedule:
- cron: '30 4 * * 1-4,0' # 7:30 AM Israel time

jobs:
Start-Environment:
Expand All @@ -30,4 +30,40 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
aws-role: ${{ secrets.AWS_ASSUME_ROLE }}
eks-cluster: ${{ secrets.EKS_CLUSTER_NAME }}
environment-name: 'dev'
environment-name: 'dev'

send-to-slack:
runs-on: ubuntu-latest
needs: [Start-Environment]
if: ${{ needs.Start-Environment.result == 'success' }}
environment: dev
permissions:
contents: read
packages: write
steps:
- name: Send alert to Slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}'
slack-message: "Dev environment has been started successfully. All services have been scaled up."
env:
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }}

on-failure:
runs-on: ubuntu-latest
needs: [Start-Environment]
if: failure()
environment: dev
permissions:
contents: read
packages: write
steps:
- name: Send alert to Slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}'
slack-message: "Failed to start dev environment. Please check the workflow logs for details."
env:
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }}
42 changes: 39 additions & 3 deletions .github/workflows/stop-dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ permissions:

on:
workflow_dispatch:
# schedule:
# - cron: '0 20 * * *' # 01::00 AM Israel time
schedule:
- cron: '0 21 * * *' # 12:00 AM Israel time

jobs:
Stop-Environment:
Expand All @@ -30,4 +30,40 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
aws-role: ${{ secrets.AWS_ASSUME_ROLE }}
eks-cluster: ${{ secrets.EKS_CLUSTER_NAME }}
environment-name: 'dev'
environment-name: 'dev'

send-to-slack:
runs-on: ubuntu-latest
needs: [Stop-Environment]
if: ${{ needs.Stop-Environment.result == 'success' }}
environment: dev
permissions:
contents: read
packages: write
steps:
- name: Send alert to Slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}'
slack-message: "Dev environment has been stopped successfully. All services have been scaled down."
env:
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }}

on-failure:
runs-on: ubuntu-latest
needs: [Stop-Environment]
if: failure()
environment: dev
permissions:
contents: read
packages: write
steps:
- name: Send alert to Slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: '${{ secrets.ARGO_SLACK_CHANNEL_ID }}'
slack-message: "Failed to stop dev environment. Please check the workflow logs for details."
env:
SLACK_BOT_TOKEN: ${{ secrets.ARGO_SLACK_BOT_TOKEN }}
69 changes: 69 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
# @ballerine/backoffice-v2

## 0.7.147

### Patch Changes

- Bump
- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.145

## 0.7.146

### Patch Changes

- Bump
- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.145

### Patch Changes

- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.144

### Patch Changes

- Bump
- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.143

### Patch Changes

- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.142

### Patch Changes

- fed1494bf4a7dde81915d4593765e7d89104c164: Bump
- Updated dependencies [fed1494bf4a7dde81915d4593765e7d89104c164]
- @ballerine/[email protected]
- version bump
- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.141

### Patch Changes
Expand Down
18 changes: 9 additions & 9 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ballerine/backoffice-v2",
"version": "0.7.141",
"version": "0.7.147",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -52,12 +52,12 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/blocks": "0.2.42",
"@ballerine/common": "0.9.95",
"@ballerine/react-pdf-toolkit": "^1.2.109",
"@ballerine/ui": "0.7.141",
"@ballerine/workflow-browser-sdk": "0.6.118",
"@ballerine/workflow-node-sdk": "0.6.118",
"@ballerine/blocks": "0.2.43",
"@ballerine/common": "0.9.99",
"@ballerine/workflow-browser-sdk": "0.6.122",
"@ballerine/workflow-node-sdk": "0.6.122",
"@ballerine/react-pdf-toolkit": "^1.2.114",
"@ballerine/ui": "0.7.147",
"@fontsource/inter": "^4.5.15",
"@formkit/auto-animate": "0.8.2",
"@hookform/resolvers": "^3.1.0",
Expand Down Expand Up @@ -147,8 +147,8 @@
"zod": "^3.23.4"
},
"devDependencies": {
"@ballerine/config": "^1.1.39",
"@ballerine/eslint-config-react": "^2.0.39",
"@ballerine/config": "^1.1.40",
"@ballerine/eslint-config-react": "^2.0.40",
"@cspell/cspell-types": "^6.31.1",
"@faker-js/faker": "^7.6.0",
"@playwright/test": "^1.32.1",
Expand Down
6 changes: 4 additions & 2 deletions apps/backoffice-v2/public/locales/en/toast.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@
},
"step_request": {
"success": "Step request sent successfully.",
"error": "Error occurred while sending step request.\n\n{{errorMessage}}"
"error": "Error occurred while sending step request.\n\n{{errorMessage}}",
"error_unknown": "Something went wrong. Please try again later."
},
"step_cancel": {
"success": "Step request cancelled successfully.",
"error": "Error occurred while cancelling step request.\n\n{{errorMessage}}"
"error": "Error occurred while cancelling step request.\n\n{{errorMessage}}",
"error_unknown": "Something went wrong. Please try again later."
},
"edit_collection_flow": {
"success": "Collection flow's edit mode enabled successfully.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { useCollectionFlowSteps } from './hooks/useCollectionFlowSteps';
import { useCollectionFlowTrackerItems } from './hooks/useCollectionFlowTrackerItems';

export const CollectionFlowTracker = ({ workflow, plugins, processes }: TTrackerComponentProps) => {
const steps = useCollectionFlowSteps({ workflowContext: workflow.context });
const items = useCollectionFlowTrackerItems({ steps, workflow });
const { steps, isLoading: isLoadingSteps } = useCollectionFlowSteps({ workflowId: workflow.id });
const items = useCollectionFlowTrackerItems({ steps, workflow, isLoadingSteps });

return (
<Tracker workflow={workflow} plugins={plugins} processes={processes}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
import { useCollectionFlowStateQuery } from '@/domains/collection-flow/hooks/queries/useCollectionFlowStateQuery/useCollectionFlowStateQuery';
import { TWorkflowById } from '@/domains/workflows/fetchers';
import { useRevisionCaseMutation } from '@/domains/workflows/hooks/mutations/useRevisionCaseMutation/useRevisionCaseMutation';
import { CollectionFlowStepStatesEnum, getCollectionFlowState } from '@ballerine/common';
import { CollectionFlowStepStatesEnum, StateTag } from '@ballerine/common';
import { useCallback, useMemo } from 'react';

export const useStepsRequesting = (workflow: TWorkflowById) => {
const { mutate: mutateRevisionCase, isLoading } = useRevisionCaseMutation({});
const { data: collectionFlowState } = useCollectionFlowStateQuery(workflow?.id);

const stepsCountToRequest = useMemo(() => {
const collectionFlowSteps = getCollectionFlowState(workflow?.context || {})?.steps;
const collectionFlowSteps = collectionFlowState?.state?.steps;

// Preventing rendering steps under revision during Revisions state
if (!workflow.tags?.includes(StateTag.MANUAL_REVIEW)) {
return 0;
}

return (
collectionFlowSteps?.filter(step => step.state === CollectionFlowStepStatesEnum.revision)
.length ?? 0
);
}, [workflow]);
}, [collectionFlowState, workflow]);

const sendRequestedStepsToRevision = useCallback(() => {
mutateRevisionCase({
Expand Down

This file was deleted.

Loading
Loading