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

task(NOC-1903): updated intercom test examples #10

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e7e318c
Initial commit
ciaranjmp Mar 14, 2024
a134be6
Merge branch 'main' of https://github.com/team-telnyx/ai-chatbot
ciaranjmp Mar 14, 2024
4b28c48
docker compose
ijaric Mar 14, 2024
7c20752
task(NOC-1901): upgrading context splitter to split from matched docu…
ciaranjmp Mar 14, 2024
177a59a
fix(NOC-1901): minor fixes and improvements
ciaranjmp Mar 14, 2024
67ef47c
task(NOC-1901): improved splitting functionality
ciaranjmp Mar 14, 2024
0dc2403
build(deps): bump follow-redirects from 1.15.5 to 1.15.6
dependabot[bot] Mar 14, 2024
0389b62
fix(NOC-1904): postgres container could not be found
ciaranjmp Mar 15, 2024
ca75081
fix(NOC-1904): making the entrypoint script executable in the container
ciaranjmp Mar 15, 2024
0437a7e
fix(NOC-1904): changing dev postgres host to avoid conflicts with loc…
ciaranjmp Mar 15, 2024
3f3d12e
Semgrep-integration-with-github
Mar 19, 2024
9b26555
fix: update envs and npm -> yarn
ijaric Mar 19, 2024
1b2df71
chore: Jest setup with Typescript
dynamite-bud Mar 19, 2024
c399250
wip(NOC-1913): moving from "paragraph" terminology to "chunk"
ciaranjmp Mar 19, 2024
97f70f6
task(NOC-1913): updated remaining references from "paragraphs" to "ch…
ciaranjmp Mar 19, 2024
ff21018
Merge pull request #3 from team-telnyx/NOC-1913-paragraph-to-chunk
ciaranjmp Mar 19, 2024
a2ec084
task(NOC-1914): added describe functionality for all supported file t…
ciaranjmp Mar 19, 2024
d9c49ee
fix(NOC-1914): improving the describe functionality for CSV/JSON file…
ciaranjmp Mar 19, 2024
2cb809b
Merge pull request #2 from team-telnyx/dependabot/npm_and_yarn/follow…
dmmc12 Mar 20, 2024
e3c52fa
Merge pull request #1 from team-telnyx/tasks/NOC-1904_docker_compose
ijaric Mar 20, 2024
96287e2
feat: Unit tests for splitters
dynamite-bud Mar 20, 2024
e9f9c60
enhancement(NOC-1917) Add a check for the .env file that it's present…
dmmc12 Mar 20, 2024
2a33528
enhancement(NOC-1917) fix formatting
dmmc12 Mar 20, 2024
a76d2d1
refactor: remove unnecessary console.log
dynamite-bud Mar 20, 2024
245ecc4
chore: update environment file to include `PORT` variable
dynamite-bud Mar 20, 2024
60bcc9a
chore: update scripts for API testing and Unit testing
dynamite-bud Mar 20, 2024
918f92f
refactor: remove unnecessary log
dynamite-bud Mar 20, 2024
cf921ab
feat: add `PORT` variable from `env`
dynamite-bud Mar 20, 2024
d01c1de
feat: Add API tests
dynamite-bud Mar 20, 2024
b73c8db
Merge `testing-with-jest` branch with main.
dynamite-bud Mar 20, 2024
038b872
refactor: remove unnecearry types + make data as constrefactor: remov…
dynamite-bud Mar 20, 2024
f965f82
chore: pin Node's version to 18 and resolve yarn.lock
dynamite-bud Mar 20, 2024
108ce36
fix(NOC-1903): closing server when API tests are done
ciaranjmp Mar 21, 2024
dc60f20
fix(NOC-1903): removing redundant API port env variable
ciaranjmp Mar 21, 2024
bdf2d59
fix(NOC-1903): upgrading node version to support ts-jest requirement
ciaranjmp Mar 21, 2024
cf317d3
task(NOC-1903): updating makefile with new docker commands
ciaranjmp Mar 21, 2024
2bbb6b9
task(NOC-1915): removing old packages and updated project metadata
ciaranjmp Mar 21, 2024
3529f03
Merge pull request #7 from team-telnyx/testing-with-jest
dynamite-bud Mar 21, 2024
37cfa44
enhancement(NOC-1917) implement suggested changes from pull request r…
dmmc12 Mar 21, 2024
4cfd5db
Merge branch 'main' into environment-check
ciaranjmp Mar 21, 2024
f6edf20
Merge pull request #6 from team-telnyx/environment-check
dmmc12 Mar 21, 2024
cf54ed2
enhancement(NOC-1905) - README updates
dmmc12 Mar 22, 2024
246d19b
enhancement(NOC-1905) - README updates
dmmc12 Mar 22, 2024
f500844
Merge pull request #9 from team-telnyx/readme-updates
dmmc12 Mar 22, 2024
e7ff7ec
task(NOC-1903): updating intercom test articles
ciaranjmp Mar 22, 2024
70a3226
fix(NOC-1903): updating test script to work on both windows & unix op…
ciaranjmp Mar 22, 2024
b06fcb8
fix(NOC-1903): adding larger timeout to PDF test as it sometimes take…
ciaranjmp Mar 22, 2024
13a5a1c
fix(NOC-1903): small fix for test:debug command
ciaranjmp Mar 22, 2024
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
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
app
node_modules
infra
.dockerignore
yarn-error.log
/server/files
.env
9 changes: 7 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
PORT=3000
NGINX_PORT=80

INTERCOM_API_KEY=YOUR_INTERCOM_API_KEY
OPEN_WEATHER_MAP_API_KEY=YOUR_OPEN_WEATHER_MAP_API_KEY
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
TELNYX_API_KEY=YOUR_TELNYX_API_KEY

POSTGRES_HOST=localhost
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=ai_chatbot
POSTGRES_DATABASE=ai_chatbot
POSTGRES_PASSWORD=postgres
POSTGRES_DEV_PORT=25432

LOCAL=true
LOCAL=true
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
'plugin:jsx-a11y/recommended',
'prettier',
'plugin:prettier/recommended',
'plugin:jest/recommended',
],
rules: {
indent: 0,
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Semgrep
on:
pull_request: {}
push:
branches:
- master
- main
paths:
- .github/workflows/semgrep.yml
schedule:
- cron: '22 22 * * 1'
jobs:
semgrep:
name: Static Analysis Scan
runs-on: telnyx-2xsmall
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v3
- run: semgrep ci
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM node:19.8.1
FROM node:20.9.0

# set working directory
WORKDIR /src/app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install app dependencies
COPY package.json ./
COPY yarn.lock ./
Expand All @@ -14,17 +11,10 @@ RUN yarn

COPY . ./

# compile frontend into bundle
RUN yarn run build:frontend

# compile backend ts into js
RUN yarn run build:backend

EXPOSE 3000
RUN yarn run build

# Copy start script and make it executable
COPY ./server/start.sh start.sh
RUN chmod +x start.sh
# make the entrypoint script executable
RUN chmod +x entrypoint.sh

# start app using the shell script
ENTRYPOINT ["./start.sh"]
ENTRYPOINT ["./entrypoint.sh"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 telnyx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tag := red
service := noc-chatbot
service := ai-chatbot
port := 3000

main_image := registry.internal.telnyx.com/jenkins/$(service):$(tag)
main_image := $(service):$(tag)
node_version := 19.8.1

docker_build_args = \
Expand All @@ -17,10 +17,18 @@ docker_build_args = \
build:
docker build $(docker_build_args) --tag $(main_image) .

.PHONY:
.PHONY: start
start:
docker run -d -p $(port):$(port) $(main_image)
docker compose up -d

.PHONY: stop
stop:
docker compose down

.PHONY: startdev
startdev:
docker compose -f docker-compose.yml up -d

.PHONY: test
test:
$(info ************ NO TESTING YET ************)
yarn run test
Loading
Loading