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

Initial Debug viewer #15

Merged
merged 13 commits into from
Oct 27, 2023
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
14 changes: 13 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
name: documentation

on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- "log-viewer/**"
- ".github/workflows/frontend.yml"
pull_request:
paths-ignore:
- "log-viewer/**"
- ".github/workflows/frontend.yml"
workflow_dispatch:
paths-ignore:
- "log-viewer/**"
- ".github/workflows/frontend.yml"

permissions:
contents: write
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Frontend

on:
push:
branches:
- main
paths:
- "log-viewer/**"
- ".github/workflows/frontend.yml"
pull_request:
paths:
- "log-viewer/**"
- ".github/workflows/frontend.yml"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: log-viewer

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: "./log-viewer/pnpm-lock.yaml"
- run: pnpm install
- run: pnpm check
- run: pnpm lint
- run: pnpm test:unit
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: "./log-viewer/pnpm-lock.yaml"
- run: pnpm install
- run: pnpm exec playwright install --with-deps
- run: pnpm test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
130 changes: 67 additions & 63 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI Pipeline

on: push
on:
push:
paths-ignore:
- "log-viewer/**"
- ".github/workflows/frontend.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -11,70 +15,70 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Run precommit, mypy, and pytest
env:
AA_TOKEN: ${{ secrets.AA_TOKEN }}
run: |
poetry run ./scripts/precommit-and-mypy-and-pytest.sh
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Run precommit, mypy, and pytest
env:
AA_TOKEN: ${{ secrets.AA_TOKEN }}
run: |
poetry run ./scripts/precommit-and-mypy-and-pytest.sh

run-notebooks:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Configure Poetry for notebooks and run
env:
AA_TOKEN: ${{ secrets.AA_TOKEN }}
run: |
poetry config installer.max-workers 10
source $(poetry env info --path)/bin/activate
./scripts/notebook_runner.sh
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Configure Poetry for notebooks and run
env:
AA_TOKEN: ${{ secrets.AA_TOKEN }}
run: |
poetry config installer.max-workers 10
source $(poetry env info --path)/bin/activate
./scripts/notebook_runner.sh
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: ['-L newyorker']
exclude: '^(poetry\.lock|tests/retrievers/test_document_index\.py)$'
- id: codespell
args: ["-L newyorker"]
exclude: '^(poetry\.lock|log-viewer|tests/retrievers/test_document_index\.py)$'
17 changes: 17 additions & 0 deletions log-viewer/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
svelte.config.js
tailwind.config.js
postcss.config.js
playwright.config.ts
34 changes: 34 additions & 0 deletions log-viewer/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:svelte/recommended',
'prettier',
'plugin:storybook/recommended'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
project: true,
tsconfigRootDir: __dirname
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};
11 changes: 11 additions & 0 deletions log-viewer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
!lib/
1 change: 1 addition & 0 deletions log-viewer/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
13 changes: 13 additions & 0 deletions log-viewer/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
10 changes: 10 additions & 0 deletions log-viewer/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"tailwindAttributes": ["class", ":class"],
"tailwindFunctions": ["clsx", "cva", "cx"]
}
21 changes: 21 additions & 0 deletions log-viewer/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { StorybookConfig } from '@storybook/sveltekit';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx|svelte)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-styling',
'@storybook/addon-svelte-csf'
],
framework: {
name: '@storybook/sveltekit',
options: {}
},
staticDirs: ['../static'],
docs: {
autodocs: 'tag'
}
};
export default config;
31 changes: 31 additions & 0 deletions log-viewer/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { Preview } from '@storybook/svelte';

import { withThemeByClassName } from '@storybook/addon-styling';

/* TODO: update import to your tailwind styles file. If you're using Angular, inject this through your angular.json config instead */
import '../src/app.css';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
}
}
},
decorators: [
// Adds theme switching support.
// NOTE: requires setting "darkMode" to "class" in your tailwind config
withThemeByClassName({
themes: {
light: 'light',
dark: 'dark'
},
defaultTheme: 'light'
})
]
};

export default preview;
Loading
Loading