Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/instructions/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Cloud Harness

Cloud Harness provides software infrastructure and tools for neuroscience data computing and analysis in a monorepo.

## General concepts

### Files content

- `applications`: Cloud Harness custom server applications go here
- `client`: Cloud Harness generated client api
- `deployment`: deployment related scripts and files
- `deployment-configuration`: deployment customization files
- `infrastructure`: infrastructure utilities
- `libraries`: Cloud Harness shared libraries
- `docs`: developers documentation files
- `tools`: Cloud Harness CLI and other tools
- `test`: Cloud Harness test utilities and test code

Verify which application/components is in scope and read specific prompt instruction before proceeding.

Check best practices in every instruction file in scope and docs and apply them when writing code or performing code reviews.
Use reference for any questions regarding project structure, development workflow, and best practices.
If you have any doubts about where to find information, ask for clarification before proceeding.
23 changes: 23 additions & 0 deletions .github/instructions/test-e2e.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
applyTo: "test/e2e/*"
---
# Neuroglass Research E2E Tests

## End-to-end (E2E) Tests
- **Location**: `test/e2e/*.spec.ts`
- **Framework**: Jest + Puppeteer (see existing tests for patterns)

### Login Flow
- Tests must handle the 2-step login redirect when `APP_URL` points to the accounts domain.
- Use `USERNAME` and `PASSWORD` environment variables for credentials.
- Follow the existing flow:
- Navigate to `APP_URL` and detect redirect to accounts.
- Enter username, submit, wait for password field, enter password, submit.
- Wait for redirect back to the app and confirm route.

### Stability Requirements (Mandatory)
- **Waiting**: Always use Puppeteer explicit waits (`waitForSelector`, `waitForFunction`, `waitForNavigation`) with timeouts.
- **Selectors**: Rely on stable, custom selectors (see `test/e2e/selectors.ts`).
- **Do not** depend on UI copy, text content, or fragile DOM structure.
- **Avoid fixed sleeps** unless there is no deterministic signal; prefer state-based waits.
- **Resilience**: When possible, guard against flaky overlays (cookie/announcement modals).
74 changes: 74 additions & 0 deletions .github/instructions/tools.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
applyTo: "tools/deployment-cli-tools/*
---
# Neuroglass Project Developer Reference

## Environment Setup

### Required Environment
- **Conda Environment Name**: `ch`
- **Python Version**: 3.12+
- **Activation Command**: `conda activate ch`

### Package Managers
- **Frontend**: Yarn (NEVER use npm)
- **Backend**: pip (within conda environment only)

### Pre-requisites Checklist
- [ ] Conda environment `ch` is activated
- [ ] Correct directory navigation completed
- [ ] Appropriate package manager selected (yarn/pip)

## Development Workflow

### Mandatory Pre-Command Steps
1. **ALWAYS** activate conda environment first: `conda activate ch`
2. Navigate to the appropriate project directory
3. Use yarn for frontend operations, pip for backend operations

## Project Structure

### Key Scripts
- `harness-generate` - Generate code
- `harness-deployment` - Generate deployment files: helm charts, ci/cd files, etc.
- `harness-application` - Generate application code (e.g., Django apps)
- `harness-migrate` - Migration helper tool
- `ch_cli_tools` - Python package for deployment and other tools
- `tests` - Unit test utilities and test code


## Code Style and best practices

Take the following best practices into account when writing code for the project adn while performing code reviews:
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

There is a typo on line 42: 'adn' should be 'and'.

Suggested change
Take the following best practices into account when writing code for the project adn while performing code reviews:
Take the following best practices into account when writing code for the project and while performing code reviews:

Copilot uses AI. Check for mistakes.

- Keep architecture lean: avoid unnecessary layers and abstractions.
- Use utils for stateless pure functions that don't hit external data sources nor the ORM. Utils are horizontal and can be used across the project.
- Use helpers to organize pieces of business logic; keep them stateless when possible.
- Use services for business workflows and cross-model coordination. Services are vertical on a single model or a group of related models
- Keep model logic close to the model when it represents domain rules or invariants.
- Handle exceptions only at the higher level; let lower layers raise. NEVER catch exceptions in helpers or services unless you are adding context and re-raising.
- Cover critical logic with unit tests, especially in helpers and services. Use mocks to isolate units under test.
- Prefer models classes for helpers and services to ensure data validation and clear interfaces. Use typed dicts for structured data that isn't covered by Schema classes. Use plain dicts only to represent real unstructured data. Avoid returning tuples.


## Important Constraints

### File Creation Rules
- **NEVER** create new README or documentation files unless explicitly requested
- Follow existing documentation patterns when updates are needed

### Development Server Rules
- **NEVER** run development servers
- **ALWAYS** assume servers are running
- **MUST** ask confirmation before opening browsers

### Package Management Rules
- **Frontend**: ONLY use yarn, NEVER npm
- **Backend**: ONLY use pip within conda environment
- **ALWAYS** activate `ch` conda environment before any backend work

### CloudHarness Considerations
- Dependencies may need special handling in development environment
- Follow established patterns for CloudHarness integration

---
2 changes: 2 additions & 0 deletions applications/samples/deploy/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
harness:
subdomain: samples
image_name: sampleapp
secured: true
sentry: true
port: 80
Expand Down Expand Up @@ -50,6 +51,7 @@ harness:
- workflows
- events
- accounts
- cloudharness-base
- common
build:
- cloudharness-flask
Expand Down
14 changes: 0 additions & 14 deletions ch-166.patch

This file was deleted.

3 changes: 2 additions & 1 deletion deployment-configuration/codefresh-template-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ steps:
working_directory: .
commands:
- bash cloud-harness/install.sh
- harness-deployment $PATHS -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} --write-env -e $ENV --cache-url '${{IMAGE_CACHE_URL}}' $PARAMS
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

- harness-deployment $PATHS -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} --write-env -e $ENV --cache-url '${{IMAGE_CACHE_URL}}' $HELM_META_ARGS $PARAMS
- cat deployment/.env >> ${{CF_VOLUME_PATH}}/env_vars_to_export
- cat ${{CF_VOLUME_PATH}}/env_vars_to_export
prepare_deployment_view:
Expand Down
3 changes: 2 additions & 1 deletion deployment-configuration/codefresh-template-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ steps:
working_directory: .
commands:
- bash cloud-harness/install.sh
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} -e $ENV --no-cd $PARAMS
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} -e $ENV --no-cd $HELM_META_ARGS $PARAMS
prepare_deployment_view:
commands:
- "helm template ./deployment/helm --debug -n ${{NAMESPACE}}"
Expand Down
162 changes: 0 additions & 162 deletions deployment-configuration/codefresh-template-stage-onpremise.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion deployment-configuration/codefresh-template-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ steps:
working_directory: .
commands:
- bash cloud-harness/install.sh
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV --no-cd $PARAMS
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV --no-cd $HELM_META_ARGS $PARAMS
prepare_deployment_view:
commands:
- "helm template ./deployment/helm --debug -n ${{NAMESPACE}}"
Expand Down
3 changes: 2 additions & 1 deletion deployment-configuration/codefresh-template-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ steps:
working_directory: .
commands:
- bash cloud-harness/install.sh
- harness-deployment $PATHS -n test-${{NAMESPACE_BASENAME}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -e $ENV --write-env --cache-url '${{IMAGE_CACHE_URL}}' -N $PARAMS
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
- harness-deployment $PATHS -n test-${{NAMESPACE_BASENAME}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -e $ENV --write-env --cache-url '${{IMAGE_CACHE_URL}}' -N $HELM_META_ARGS $PARAMS
- cat deployment/.env >> ${{CF_VOLUME_PATH}}/env_vars_to_export
- cat ${{CF_VOLUME_PATH}}/env_vars_to_export
prepare_deployment_view:
Expand Down
Loading
Loading