Skip to content
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
6 changes: 5 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
pip install flake8
flake8 . || exit 1
working-directory: genai

- name: Run Tests
run: |
pytest --maxfail=1 --disable-warnings -q
Expand Down Expand Up @@ -98,6 +98,10 @@ jobs:
run: chmod +x gradlew
working-directory: server

- name: Lint Java code
run: ./gradlew check
working-directory: server

- name: Build API Gateway microservice
run: ./gradlew :api-gw:build
working-directory: server
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "npx vite build",
"build": "npm run lint && npx vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "vitest",
Expand Down
1 change: 1 addition & 0 deletions client/src/contexts/userContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const UserContextProvider: React.FC<{ children: ReactNode }> = ({
);
};

// eslint-disable-next-line react-refresh/only-export-components
export const useUser = (): UserContextType => {
const context = useContext(UserContext);
if (!context) {
Expand Down
1 change: 1 addition & 0 deletions client/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "@testing-library/jest-dom";
import { vi } from "vitest";

// Configure React to run in development mode for tests
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(globalThis as any).IS_REACT_ACT_ENVIRONMENT = true;

// Mock window.matchMedia
Expand Down
7 changes: 7 additions & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ plugins {
id("io.spring.dependency-management") version "1.1.4" apply false
id("com.google.cloud.tools.jib") version "3.4.1" apply false
id("java")
id("checkstyle")
}

subprojects {
apply(plugin = "java")
apply(plugin = "org.springframework.boot")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "com.google.cloud.tools.jib")
apply(plugin = "checkstyle")

group = "com.continuousdisappointment"
version = "0.0.1-SNAPSHOT"
Expand All @@ -22,6 +24,11 @@ subprojects {
mavenCentral()
}

checkstyle {
toolVersion = "10.26.1"
configFile = rootProject.file("config/checkstyle.xml")
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public String generateAssistantReply(String query, List<GenAiMessage> messages,
GenAiRequest genAiRequest = new GenAiRequest(query, messages, userId);
HttpEntity<GenAiRequest> entity = new HttpEntity<>(genAiRequest, headers);

log.info("Calling GenAI service");
ResponseEntity<GenAiResponse> response = restTemplate.postForEntity(
getGenAiServiceUrl() + "/genai/generate",
entity,
GenAiResponse.class);
log.info("GenAI service is called with response {} ", response.getBody().response());
log.info("GenAI service call successful");
return response.getBody().response();

} catch (Exception e) {
Expand Down
14 changes: 14 additions & 0 deletions server/config/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<property name="charset" value="UTF-8"/>
<module name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck">
</module>

<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
</module>
</module>