Skip to content

Commit

Permalink
Prod Release 1/15/2025
Browse files Browse the repository at this point in the history
This release includes:

- Updates to README
- Ability to upload .docx files
- Increased max file size for uploads (20 MB for images, 50 MB for all other file types)
  • Loading branch information
sannidhishukla authored Jan 15, 2025
2 parents a32c382 + 56cfe7a commit b8479f0
Show file tree
Hide file tree
Showing 16 changed files with 7,072 additions and 3,510 deletions.
31 changes: 31 additions & 0 deletions NJ_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

This document has information specific to the NJ-specific fork of the Microsfot open source OpenAI chat app.

## Overall architecture

- This full-stack application uses a Python web server, React frontend, and is deployed on Azure App Service
- This code is deployed to a production stage (`nj-stable` branch) and dev stage (`nj-stable-dev` branch)
- Note that certain features from the open-source parent are not enabled, such as chat history (anything related to `CosmosDB`)

## Local setup

1. Clone repo and go to `nj-stable` branch
2. Copy `.env` file from Bitwarden (reach out to Platform team for access)
3. Run `./start.sh`

## Deployment

1. Log into Azure and go to the `nj-aichat-internal` App Service (reach out to Platform team for access)
2. [If dev stage] In the left menu, click Deployments > Deployment slots. Click on `nj-aichat-internal-dev`.
3. In the left menu, click Deployments > Deployment Center.
4. In the top bar, click the "Sync" button to sync the deployed application with the latest commit on the corresponding branch.
5. Under the top bar, click the "Logs" tab to see the deployment status (it will change to "Success" when completed)

## How to keep NJ version up to date with latest upstream changes

The `nj-stable` branch is deployed to our actual chat application, and we should pull in changes from the microsoft upstream when they come in. Here is how to do so:
Expand All @@ -12,3 +32,14 @@ The `nj-stable` branch is deployed to our actual chat application, and we should
4. Run `git pull --rebase origin main` to rebase our NJ-specific changes on top of the latest upstream work. Fix merge conflicts as needed.
5. Run `git push -f` to force push this rebase onto the remote repo. There should not be any commits as part of this push.
6. You should see that the `nj-stable` branch is no longer behind the `main` branch, and only ahead by the commits the NJ team has made.

## How to run locally
1. Clone the repo and check out the `nj-stable` branch or any branch created from it.
2. In the root directory of the repo, create a new `.env` file. Update this file with the values found in Bitwarden.
3. From the root directory of the repo, run the ./start.sh command

## How to run unit tests locally
Navigate into the `frontend` directory. `cd frontend`

**To run tests for the backend** run the command `npm run test:api`
**To run tests for the frontend** run the command `npm run test:react`
2 changes: 2 additions & 0 deletions frontend/__mocks__/fileMock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const mock = 'test-file-stub'
export default mock
7 changes: 6 additions & 1 deletion frontend/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ const config: Config.InitialOptions = {
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
setupFilesAfterEnv: ['<rootDir>/polyfills.js']
setupFilesAfterEnv: ['<rootDir>/polyfills.js'],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'^.+\\.svg$': '<rootDir>/__mocks__/fileMock.ts'
},
testEnvironment: 'jsdom'
}

export default config
Loading

0 comments on commit b8479f0

Please sign in to comment.