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

chore: move contents of explorer to top level (#4230) #4242

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/node_modules/*
**/out/*
**/.next/*

build

/analytics
/.gitlab
/reports
/meta-scripts
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ updates:
interval: "daily"
assignees:
- "noopdog"
open-pull-requests-limit: 50
open-pull-requests-limit: 50
8 changes: 4 additions & 4 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: DataBiosphere/azul-github-labeler-action@releases/v5
with:
repo-token: "${{secrets.GITHUB_TOKEN}}"
label: canary
- uses: DataBiosphere/azul-github-labeler-action@releases/v5
with:
repo-token: "${{secrets.GITHUB_TOKEN}}"
label: canary
3 changes: 1 addition & 2 deletions .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Run checks
on: [ pull_request ]
on: [pull_request]

jobs:
build:
Expand All @@ -10,7 +10,6 @@ jobs:
with:
node-version: "20.10.0"
- run: |
cd explorer
npm ci
npm run check-format
npm run lint
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/run-playwright-tests-anvil-catalog.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Playwright Tests anvil-catalog
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
jobs:
test:
timeout-minutes: 60
Expand All @@ -15,25 +15,22 @@ jobs:
node-version: "20.10.0"
- name: Install dependencies
run: |
cd explorer
npm ci
npm ci
- name: Install Playwright Browsers
run: |
cd explorer
npx playwright install --with-deps
npx playwright install --with-deps
- name: Build AnVIL-catalog database
run: |
cd ./explorer/files
npm ci
mkdir ./anvil-catalog/out
npm run build-anvil-db
cd ./files
npm ci
mkdir ./anvil-catalog/out
npm run build-anvil-db
- name: Run Playwright tests
run: |
cd explorer
npm run test:anvil-catalog
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: explorer/playwright-report/
retention-days: 30
path: playwright-report/
retention-days: 30
19 changes: 7 additions & 12 deletions .github/workflows/run-playwright-tests-anvil-cmg.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Playwright Tests anvil-cmg
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
jobs:
test:
timeout-minutes: 60
Expand All @@ -15,27 +15,22 @@ jobs:
node-version: "20.10.0"
- name: Install dependencies
run: |
cd explorer
npm ci
npm ci
- name: Check Backend System Status - TEST RESULTS ARE NOT VALID IF THIS FAILS
run: |
cd explorer
npm run check-system-status:anvil-cmg
npm run check-system-status:anvil-cmg
- name: Install Playwright Browsers
run: |
cd explorer
npx playwright install --with-deps
npx playwright install --with-deps
- name: Run Playwright tests
run: |
cd explorer
npm run test:anvil-cmg
- name: Check backend status again - TEST RESULTS ARE NOT VALID IF THIS FAILS
run: |
cd explorer
npm run check-system-status:anvil-cmg
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: explorer/playwright-report/
retention-days: 30
path: playwright-report/
retention-days: 30
59 changes: 51 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,64 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
node_modules_bak
.tmp
/.pnp
.pnp.js

# IDEs and editors
.idea
# testing
/coverage
/test-results/*

# next.js
/.next/
/out/

#Typescript
typings
# production
/build

# misc
npm-debug.log
downloads/*
.DS_Store
*.pem
.tmp
/downloads/*

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

#System Files
.DS_Store
Thumbs.db

# env files
/.env*.local
/.env.development
/.env.production

# vercel
.vercel

# typescript
*.tsbuildinfo

# IDEs and editors
.idea
/.vscode

# hygen
_templates

# nvm
.nvmrc

# favicons
/public/favicons/*

/files/anvil-catalog/out/
/files/ncpi-catalog/out/

#Python
__pycache__/
/analytics/**/_build
Expand Down
3 changes: 1 addition & 2 deletions .gitlab/fragments/explorer/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
script:
- cd explorer
- (cd files && npm ci)
- npm ci
- rm -rf out
- npm run "$data_browser_build_script"
- tar -cvj -f ../.gitlab/distribution.tar.bz2 out
- tar -cvj -f ./.gitlab/distribution.tar.bz2 out
2 changes: 0 additions & 2 deletions explorer/.husky/commit-msg → .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ if ! grep -iqE "$commit_regex" "$1"; then
exit 1
fi

cd explorer

# Check for Conventional Commits format

npx commitlint --config ./commitlint.config.js --edit $1
2 changes: 0 additions & 2 deletions explorer/.husky/pre-commit → .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

cd explorer

echo '🏗️👷 Checking your project before committing'

# Check Prettier
Expand Down
3 changes: 3 additions & 0 deletions explorer/.prettierignore → .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# general
README.md
/CHANGELOG.md
/analytics
/.gitlab
/reports

# testing
coverage
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 30 additions & 20 deletions docs/configuration-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Configuration Guide

## Configuring an Entity List

Entity lists display result sets from either an API endpoint or a TSV and can be statically built or dynamically requested. To configure an entity list:

### 1. Add Response Model
Expand All @@ -9,50 +10,59 @@ Entity lists display result sets from either an API endpoint or a TSV and can be

The Azul entity list API endpoint returns entities (`hits`) in a format that can be modeled as a response object containing a core entity and multiple aggregated entities. For example:

* A `hits` value returned from the `/index/files` endpoint contains:
- A `hits` value returned from the `/index/files` endpoint contains:

1. File entity
2. Aggregated projects
3. Aggregated samples
4. Aggregated values for all other entities...

* A `hits` value returned from the `/index/projects` endpoint contains:
- A `hits` value returned from the `/index/projects` endpoint contains:

1. Project entity
2. Aggregated files
3. Aggregated samples
4. Aggregated values for all other entities...

* A `hits` value returned from the `/index/samples` endpoint contains:
- A `hits` value returned from the `/index/samples` endpoint contains:
1. Sample entity
2. Aggregated files
3. Aggregated projects
4. Aggregated values for all other entities...

An Azul entities endpoint requires the following models:
* `XEntity` - the core entity returned from the endpoint (e.g. the single element contained in the `files` array value returned in `/index/files`). Core entity models are added to `/apis/azul/${site}/common/entities`.
* `XEntityResponse` - a model of the singleton array containing the core entity, returned from the endpoint (e.g. the `files` array value returned in `/index/files`). Entity response models are added to `/apis/azul/${site}/common/entities`.
* `AggregatedY` - an aggregated entity returned from the endpoint (e.g. the `projects` or `files` values returned in `/index/files`). Aggregated entities are added to `/apis/azul/${site}/common/aggregatedEntities`.
* `XsResponse` - a model of the full response returned from the endpoint. Response models are added to `/apis/azul/${site}/common/responses`.

- `XEntity` - the core entity returned from the endpoint (e.g. the single element contained in the `files` array value returned in `/index/files`). Core entity models are added to `/apis/azul/${site}/common/entities`.
- `XEntityResponse` - a model of the singleton array containing the core entity, returned from the endpoint (e.g. the `files` array value returned in `/index/files`). Entity response models are added to `/apis/azul/${site}/common/entities`.
- `AggregatedY` - an aggregated entity returned from the endpoint (e.g. the `projects` or `files` values returned in `/index/files`). Aggregated entities are added to `/apis/azul/${site}/common/aggregatedEntities`.
- `XsResponse` - a model of the full response returned from the endpoint. Response models are added to `/apis/azul/${site}/common/responses`.

#### 1.2 TSV Response Model

Add an interface matching the response model expected from the API endpoint or TSV row.
* Naming convention: `entities.ts`.
* Location: `/apis/${apiName}/common`.

- Naming convention: `entities.ts`.
- Location: `/apis/${apiName}/common`.

### 2. Create Entity List-Specific Configuration
* Naming convention: `entityNameEntityConfig.ts`.
* Location: `/site-config/${site}/${env}/index`.
* Entity list configuration implements `EntityConfig<T>` where `T` is the response model defined above in step 1.
* Once configured, the entity list configuration must be specified in the `entities` array in the site config.

- Naming convention: `entityNameEntityConfig.ts`.
- Location: `/site-config/${site}/${env}/index`.
- Entity list configuration implements `EntityConfig<T>` where `T` is the response model defined above in step 1.
- Once configured, the entity list configuration must be specified in the `entities` array in the site config.

### 3. Create a View Builder
A view builder contains functions that build the component props required for displaying a value in an entity list. Each function takes at least a response model (either from an API endpoint or a row in a TSV), is parameterized by the type of component it builds props for and uses transformers to convert the response value into prop-specific values.
* Naming convention: `viewModelBuilders.ts`. A view builder is API-specific.
* Location: `/viewModelBuilders/${apiName}/common/`.
* Function naming convention: `buildX` where `X` is the response value to display.

A view builder contains functions that build the component props required for displaying a value in an entity list. Each function takes at least a response model (either from an API endpoint or a row in a TSV), is parameterized by the type of component it builds props for and uses transformers to convert the response value into prop-specific values.

- Naming convention: `viewModelBuilders.ts`. A view builder is API-specific.
- Location: `/viewModelBuilders/${apiName}/common/`.
- Function naming convention: `buildX` where `X` is the response value to display.

### 4. Create a Response Transformer

A transformer contains functions that map a response model (either from an API endpoint or a row in a TSV) to a view model that is optimized for display.
* Naming convention: `transformers.ts`. A transformer is API-specific.
* Location: `/apis/${apiName}/common/`.
* Function naming convention: `getX` where `X` is the response value to transform.

- Naming convention: `transformers.ts`. A transformer is API-specific.
- Location: `/apis/${apiName}/common/`.
- Function naming convention: `getX` where `X` is the response value to transform.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions explorer/.eslintignore

This file was deleted.

53 changes: 0 additions & 53 deletions explorer/.gitignore

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading