Skip to content

Commit 6d4e9d3

Browse files
Merge remote-tracking branch 'upstream/main'
2 parents 3594ad0 + 3a019d7 commit 6d4e9d3

38 files changed

+404
-288
lines changed

.github/workflows/build-clientadvisor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Build ClientAdvisor Docker Images
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, dev, demo]
66
paths:
77
- ClientAdvisor/**
88
pull_request:
9-
branches: [main]
9+
branches: [main, dev, demo]
1010
types:
1111
- opened
1212
- ready_for_review
@@ -35,5 +35,5 @@ jobs:
3535
password_secret: ${{ matrix.password_secret }}
3636
app_name: ${{ matrix.app_name }}
3737
dockerfile: ${{ matrix.dockerfile }}
38-
push: true # Adjust this logic as necessary
39-
secrets: inherit
38+
push: ${{ github.event_name == 'push' && github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
39+
secrets: inherit

.github/workflows/build-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
context: .
5555
file: ${{ inputs.dockerfile }}
5656
push: ${{ inputs.push }}
57-
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:latest
57+
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
5858
tags: |
59-
${{ inputs.registry }}/${{ inputs.app_name}}:dev
59+
${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
6060
${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.date.outputs.date }}_${{ github.run_number }}

.github/workflows/build-researchassistant.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Build ResearchAssistant Docker Images
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, dev, demo]
66
paths:
77
- ResearchAssistant/**
88
pull_request:
9-
branches: [main]
9+
branches: [main, dev, demo]
1010
types:
1111
- opened
1212
- ready_for_review
@@ -32,5 +32,5 @@ jobs:
3232
password_secret: ${{ matrix.password_secret }}
3333
app_name: ${{ matrix.app_name }}
3434
dockerfile: ${{ matrix.dockerfile }}
35-
push: true # Adjust this logic as necessary
36-
secrets: inherit
35+
push: ${{ github.event_name == 'push' && github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
36+
secrets: inherit

.github/workflows/test_client_advisor.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Unit Tests - Client Advisor
22

33
on:
44
push:
5-
branches: main
5+
branches: [main, dev]
66
# Trigger on changes in these specific paths
77
paths:
88
- 'ClientAdvisor/**'
99
pull_request:
10-
branches: main
10+
branches: [main, dev]
1111
types:
1212
- opened
1313
- ready_for_review
@@ -29,22 +29,6 @@ jobs:
2929
uses: actions/setup-python@v5
3030
with:
3131
python-version: "3.11"
32-
- name: Install Backend Dependencies
33-
run: |
34-
cd ClientAdvisor/App
35-
python -m pip install -r requirements.txt
36-
python -m pip install coverage pytest-cov
37-
- name: Run Backend Tests with Coverage
38-
run: |
39-
cd ClientAdvisor/App
40-
python -m pytest -vv --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing --cov-fail-under=80 --junitxml=coverage-junit.xml
41-
- uses: actions/upload-artifact@v4
42-
with:
43-
name: client-advisor-coverage
44-
path: |
45-
ClientAdvisor/App/coverage.xml
46-
ClientAdvisor/App/coverage-junit.xml
47-
ClientAdvisor/App/htmlcov/
4832
- name: Set up Node.js
4933
uses: actions/setup-node@v3
5034
with:
@@ -63,3 +47,20 @@ jobs:
6347
path: |
6448
ClientAdvisor/App/frontend/coverage/
6549
ClientAdvisor/App/frontend/coverage/lcov-report/
50+
ClientAdvisor/App/htmlcov/
51+
- name: Install Backend Dependencies
52+
run: |
53+
cd ClientAdvisor/App
54+
python -m pip install -r requirements.txt
55+
python -m pip install coverage pytest-cov
56+
- name: Run Backend Tests with Coverage
57+
run: |
58+
cd ClientAdvisor/App
59+
python -m pytest -vv --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing --cov-fail-under=80 --junitxml=coverage-junit.xml
60+
- uses: actions/upload-artifact@v4
61+
with:
62+
name: client-advisor-coverage
63+
path: |
64+
ClientAdvisor/App/coverage.xml
65+
ClientAdvisor/App/coverage-junit.xml
66+
ClientAdvisor/App/htmlcov/

ClientAdvisor/App/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 88
33
extend-ignore = E501, E203
4-
exclude = .venv, frontend,
4+
exclude = .venv, frontend,

ClientAdvisor/App/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def create_app():
5555
app.config["TEMPLATES_AUTO_RELOAD"] = True
5656
# app.secret_key = secrets.token_hex(16)
5757
# app.session_interface = SecureCookieSessionInterface()
58-
# print(app.secret_key)
5958
return app
6059

6160

@@ -901,7 +900,6 @@ async def complete_chat_request(request_body, request_headers):
901900
# answer = "Sample response from Azure Function"
902901
# Construct the URL of your Azure Function endpoint
903902
# function_url = STREAMING_AZUREFUNCTION_ENDPOINT
904-
905903
# request_headers = {
906904
# "Content-Type": "application/json",
907905
# # 'Authorization': 'Bearer YOUR_TOKEN_HERE' # if applicable

ClientAdvisor/App/frontend/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ClientAdvisor/App/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@
7878
"typescript": "^4.9.5",
7979
"vite": "^4.1.5"
8080
}
81-
}
81+
}

ClientAdvisor/App/frontend/src/api/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,7 @@ export interface GroupedChatHistory {
147147
}
148148

149149

150+
export interface GroupedChatHistory {
151+
month: string
152+
entries: Conversation[]
153+
}

ClientAdvisor/App/frontend/src/components/Answer/Answer.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,13 @@ export const Answer = ({ answer, onCitationClicked }: Props) => {
7878
} else {
7979
citationFilename = `${citation.filepath} - Part ${part_i}`
8080
}
81-
// } else if (citation.filepath && citation.reindex_id) {
82-
// citationFilename = `${citation.filepath} - Part ${citation.reindex_id}`
8381
} else {
8482
citationFilename = `Citation ${index}`
8583
}
8684
return citationFilename
8785
}
8886

8987
const onLikeResponseClicked = async () => {
90-
// if (answer.message_id == undefined) return
9188
if (answer.message_id) {
9289
let newFeedbackState = feedbackState
9390
// Set or unset the thumbs up state
@@ -108,7 +105,6 @@ export const Answer = ({ answer, onCitationClicked }: Props) => {
108105
}
109106

110107
const onDislikeResponseClicked = async () => {
111-
//if (answer.message_id == undefined) return
112108
if (answer.message_id) {
113109
let newFeedbackState = feedbackState
114110
if (feedbackState === undefined || feedbackState === Feedback.Neutral || feedbackState === Feedback.Positive) {
@@ -129,7 +125,6 @@ export const Answer = ({ answer, onCitationClicked }: Props) => {
129125
}
130126

131127
const updateFeedbackList = (ev?: FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) => {
132-
//if (answer.message_id == undefined) return
133128
if (answer.message_id){
134129
const selectedFeedback = (ev?.target as HTMLInputElement)?.id as Feedback
135130

@@ -146,7 +141,6 @@ export const Answer = ({ answer, onCitationClicked }: Props) => {
146141
}
147142

148143
const onSubmitNegativeFeedback = async () => {
149-
//if (answer.message_id == undefined) return
150144
if (answer.message_id) {
151145
await historyMessageFeedback(answer.message_id, negativeFeedbackList.join(','))
152146
resetFeedbackDialog()

0 commit comments

Comments
 (0)