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

Check-in Chatbot UI Code #1349

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TamiTakamiya
Copy link
Contributor

@TamiTakamiya TamiTakamiya commented Oct 17, 2024

Jira Issue: https://issues.redhat.com/browse/AAP-33560

Description

Check-in Chatbot UI code, which has been stored in the TamiTakamiya/hackathon-latest
branch.

While more than 20 files are added, two .tsx files among them,

  1. AnsibleChatbot.tsx
  2. useChatbot.tsx

implement the core features of our AAP chatbot.

Note: This PR contains changes on code coverage & sonar cloud properties, but does not include Image creation, Makefile, etc., which means the newly deployed image after merging this PR won't include these UI codes yet.

Testing

Steps to test

  1. Pull down the PR
  2. cd ansible_ai_connect_chatbot
  3. npm install
  4. npm run coverage

Scenarios tested

Unit tests are included in the PR.

Production deployment

  • This code change is ready for production on its own
  • This code change requires the following considerations before going to production:

Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TamiTakamiya I know this is a draft but I've added an initial comment.

I assume much of this is a copy/paste from elsewhere; hence is there much to review?

We'd presumably want to keep our fork aligned with where ever it came from.

It'd be nice to add it to SonarCloud and add some CI jobs (like we have for the "Admin Portal").

@@ -163,3 +163,14 @@ grafana/*

# Local LaunchDarkly data
./flagdata.json

# node dependencies
node_modules/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have preferred it if you'd npm install'ed this in ansible_ai_connect_chatbot.

Having the node_modules folder in the root could conflict with other TypeScript modules (now or in the future).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was my intention. I'll double-check the descriptions in README.

For installing dependencies, run

```commandline
npm install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README is in the ansible_ai_connect_chatbot folder.

This implies npm install would be ran from this folder.. meaning (AFAIK) node_modules should not be in the root of ansible_ai_connect_service.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. I'll state that explicitly there.

@TamiTakamiya
Copy link
Contributor Author

I assume much of this is a copy/paste from elsewhere; hence is there much to review?

Yes. I have updated the description. Most of features are implemented in two .tsx files:

While more than 20 files are added, two .tsx files among them,

  1. AnsibleChatbot.tsx
  2. useChatbot.tsx

implement the core features of our AAP chatbot.

@TamiTakamiya TamiTakamiya marked this pull request as ready for review October 17, 2024 17:14
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

I haven't approved as you state you want to remove App.test.tsx from Sonar Cloud coverage?

ansible_ai_connect_chatbot/README.md Outdated Show resolved Hide resolved
ansible_ai_connect_chatbot/README.md Outdated Show resolved Hide resolved
ansible_ai_connect_chatbot/README.md Outdated Show resolved Hide resolved
ansible_ai_connect_chatbot/README.md Outdated Show resolved Hide resolved
ansible_ai_connect_chatbot/index.html Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 17, 2024

Copy link
Contributor

@justjais justjais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes LGTM, cosmetic comment and a query

await act(async () => fireEvent.click(colorThemeSwitch));
expect(colorThemeSwitch.checked).toBeTruthy();

// expect(getComputedStyle(showLight!).display).toEqual("none")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TamiTakamiya are u planning to use/support these expect, and if not can we remove the commented expect

import { ColorThemeSwitch } from "./ColorThemeSwitch/ColorThemeSwitch";
import reportWebVitals from "./reportWebVitals";
import "@patternfly/react-core/dist/styles/base.css";
// import '@patternfly/patternfly/patternfly-addons.css';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, if not used or intended to use, plz remove commented import

const resp = await axios.post(
import.meta.env.PROD
? "/api/v0/ai/chat/"
: "http://localhost:8080/v1/query/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TamiTakamiya can you plz confirm why are we using localhost directed query API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants