Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: release hotfixes part2 #718

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
gitlab-dev-deploy:
if: ${{ github.event.registry_package.package_version.container_metadata.tag.name == 'development' }}
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.3.1
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.4.0
with:
gitlab-project-id: '1827'
secrets:
Expand All @@ -16,7 +16,7 @@ jobs:

gitlab-dev-deploy-overlay:
if: ${{ github.event.registry_package.package_version.container_metadata.tag.name == 'development' }}
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.3.1
uses: epam/ai-dial-ci/.github/workflows/deploy-development.yml@1.4.0
with:
gitlab-project-id: '1856'
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
e2e-tests:
if: ${{ github.event.registry_package.package_version.container_metadata.tag.name == 'development' }}
uses: epam/ai-dial-ci/.github/workflows/e2e-test.yml@1.3.1
uses: epam/ai-dial-ci/.github/workflows/e2e-test.yml@1.4.0
with:
gitlab-project-id: "1843"
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ on:

jobs:
pr-title-check:
uses: epam/ai-dial-ci/.github/workflows/pr-title-check.yml@1.3.1
uses: epam/ai-dial-ci/.github/workflows/pr-title-check.yml@1.4.0
secrets:
ACTIONS_BOT_TOKEN: ${{ secrets.ACTIONS_BOT_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: PR Workflow

on:
pull_request:
branches: [development, release-*]

jobs:
run_tests:
uses: epam/ai-dial-ci/.github/workflows/[email protected]
secrets: inherit
12 changes: 0 additions & 12 deletions .github/workflows/pr_check_tests.yml

This file was deleted.

7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Release version
name: Release Workflow

on:
push:
branches: [ development, release-* ]

env:
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
uses: epam/ai-dial-ci/.github/workflows/publish_yarn_docker.yml@1.3.1
uses: epam/ai-dial-ci/.github/workflows/node_release.yml@1.4.0
secrets: inherit
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY . .
RUN npm run build

# ---- Only required dependencies ----
FROM build AS run_ependencies
FROM build AS run_dependencies
WORKDIR /app/dist/apps/chat
COPY /tools /app/dist/apps/chat/tools
RUN npm i
Expand All @@ -25,8 +25,8 @@ RUN node tools/patch-nextjs.js
FROM node:20-alpine AS production
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
WORKDIR /app
COPY --from=run_ependencies /app/dist/apps/chat ./
COPY --from=run_ependencies /app/startup.sh ./startup.sh
COPY --from=run_dependencies /app/dist/apps/chat ./
COPY --from=run_dependencies /app/startup.sh ./startup.sh

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
Expand Down
16 changes: 8 additions & 8 deletions apps/chat-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ CI report includes screenshots for failed tests.

The following variables should be placed inside `chat-e2e/.env.local` file in order to run tests locally

| Variable | Required | Description | Available Values | Default values |
|-----------------| -------- |----------------------------------------------------------------------------------------------------------------------------------------------------|------------------| -------------- |
| `E2E_HOST` | No | The host URL for end-to-end testing. | Any string | |
| `E2E_USERNAME` | No | Comma separated list of usernames for e2e authentification. The number of users should be more or equal number of workers set in playwright config | Any string | |
| `E2E_WORKERS` | No | Number of threads to run e2e tests | Any number | |
| `E2E_PASSWORD` | No | A password for e2e authentification | Any string | |
| `TMS_URL` | No | TMS URL | Any string | |
| `ISSUE_URL` | No | Issue URL | Any string | |
| Variable | Required | Description | Available Values | Default values |
| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -------------- |
| `E2E_HOST` | No | The host URL for end-to-end testing. | Any string | |
| `E2E_USERNAME` | No | Comma separated list of usernames for e2e authentification. The number of users should be more or equal number of workers set in playwright config | Any string | |
| `E2E_WORKERS` | No | Number of threads to run e2e tests | Any number | |
| `E2E_PASSWORD` | No | A password for e2e authentification | Any string | |
| `TMS_URL` | No | TMS URL | Any string | |
| `ISSUE_URL` | No | Issue URL | Any string | |
27 changes: 23 additions & 4 deletions apps/chat/src/store/conversations/conversations.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ import { ApiKeys } from '@/src/utils/server/api';
import {
ChatBody,
Conversation,
ConversationInfo,
Message,
MessageSettings,
Playback,
RateBody,
Role,
} from '@/src/types/chat';
import { EntityType, FeatureType, UploadStatus } from '@/src/types/common';
import { FolderType } from '@/src/types/folder';
import { FolderInterface, FolderType } from '@/src/types/folder';
import { MigrationStorageKeys, StorageType } from '@/src/types/storage';
import { AppEpic } from '@/src/types/store';

Expand Down Expand Up @@ -2096,8 +2097,18 @@ const uploadConversationsWithFoldersEpic: AppEpic = (action$) =>
),
).pipe(
switchMap((foldersAndEntities) => {
const folders = foldersAndEntities.flatMap((f) => f.folders);
const conversations = foldersAndEntities.flatMap((f) => f.entities);
const folders = foldersAndEntities
.flatMap((f) => f.folders)
.map((item) => ({
...item,
...(payload.inheritedMetadata as Partial<FolderInterface>),
}));
const conversations = foldersAndEntities
.flatMap((f) => f.entities)
.map((item) => ({
...item,
...(payload.inheritedMetadata as Partial<ConversationInfo>),
}));
return concat(
of(
ConversationsActions.uploadFoldersSuccess({
Expand Down Expand Up @@ -2150,10 +2161,15 @@ const uploadConversationsWithFoldersRecursiveEpic: AppEpic = (action$) =>
of(
ConversationsActions.uploadFoldersSuccess({
paths: new Set(),
folders: getFoldersFromIds(paths, FolderType.Chat),
folders: getFoldersFromIds(
paths,
FolderType.Chat,
UploadStatus.LOADED,
),
allLoaded: true,
}),
),
of(ConversationsActions.initFoldersAndConversationsSuccess()),
);
}),
catchError(() => of(ConversationsActions.uploadConversationsFail())), // TODO: handle error it in https://github.com/epam/ai-dial-chat/issues/663
Expand Down Expand Up @@ -2198,6 +2214,9 @@ const openFolderEpic: AppEpic = (action$, state$) =>
of(
ConversationsActions.uploadConversationsWithFolders({
paths: [payload.id],
inheritedMetadata: {
sharedWithMe: true,
},
}),
),
);
Expand Down
3 changes: 3 additions & 0 deletions apps/chat/src/store/conversations/conversations.reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const conversationsSlice = createSlice({
) => state,
initSelectedConversations: (state) => state,
initFoldersAndConversations: (state) => state,
initFoldersAndConversationsSuccess: (state) => state,
saveConversation: (state, _action: PayloadAction<Conversation>) => state,
recreateConversation: (
state,
Expand Down Expand Up @@ -595,6 +596,8 @@ export const conversationsSlice = createSlice({
payload,
}: PayloadAction<{
paths: (string | undefined)[];
// Needed for open shared with me folder and keep shared with me flag
inheritedMetadata?: unknown;
}>,
) => {
state.foldersStatus = UploadStatus.LOADING;
Expand Down
12 changes: 12 additions & 0 deletions apps/chat/src/store/conversations/conversations.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ export const selectChildAndCurrentFoldersIdsById = createSelector(
return new Set(getChildAndCurrentFoldersIdsById(folderId, folders));
},
);
export const selectFullTreeChildConversationsByFolderId = createSelector(
[selectConversations, selectChildAndCurrentFoldersIdsById],
(conversations, foldersIds) => {
return conversations.filter((conv) => foldersIds.has(conv.folderId));
},
);
export const selectFullTreeChildFoldersByFolderId = createSelector(
[selectFolders, selectChildAndCurrentFoldersIdsById],
(folders, foldersIds) => {
return folders.filter((folder) => foldersIds.has(folder.id));
},
);
export const selectFirstSelectedConversation = createSelector(
[selectSelectedConversations],
(conversations): Conversation | undefined => {
Expand Down
3 changes: 2 additions & 1 deletion apps/chat/src/store/files/files.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { combineEpics } from 'redux-observable';
import { FileService } from '@/src/utils/app/data/file-service';
import { triggerDownload } from '@/src/utils/app/file';
import { translate } from '@/src/utils/app/translation';
import { encodeApiUrl } from '@/src/utils/server/api';

import { UploadStatus } from '@/src/types/common';
import { AppEpic } from '@/src/types/store';
Expand Down Expand Up @@ -229,7 +230,7 @@ const downloadFilesListEpic: AppEpic = (action$, state$) =>
tap(({ files }) => {
files.forEach((file) =>
triggerDownload(
`api/${encodeURI(`${file.absolutePath}/${file.name}`)}`,
`api/${encodeApiUrl(`${file.absolutePath}/${file.name}`)}`,
file.name,
),
);
Expand Down
14 changes: 13 additions & 1 deletion apps/chat/src/store/prompts/prompts.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const selectFilteredPrompts = createSelector(
(!searchTerm ||
doesPromptOrConversationContainSearchTerm(prompt, searchTerm)) &&
filters.searchFilter(prompt) &&
(prompt.folderId || filters.sectionFilter(prompt)),
filters.sectionFilter(prompt),
);
},
);
Expand Down Expand Up @@ -124,6 +124,18 @@ export const selectChildAndCurrentFoldersIdsById = createSelector(
return new Set(getChildAndCurrentFoldersIdsById(folderId, folders));
},
);
export const selectFullTreeChildPromptsByFolderId = createSelector(
[selectPrompts, selectChildAndCurrentFoldersIdsById],
(prompts, foldersIds) => {
return prompts.filter((conv) => foldersIds.has(conv.folderId));
},
);
export const selectFullTreeChildFoldersByFolderId = createSelector(
[selectFolders, selectChildAndCurrentFoldersIdsById],
(folders, foldersIds) => {
return folders.filter((folder) => foldersIds.has(folder.id));
},
);

export const selectSearchTerm = createSelector([rootSelector], (state) => {
return state.searchTerm;
Expand Down
Loading
Loading