Skip to content

Conversation

@frano-m
Copy link
Contributor

@frano-m frano-m commented Nov 25, 2025

Closes #1021.

This pull request refactors the way genome/assembly entities are handled throughout the workflow input configuration codebase. It standardizes the genome type to a single Assembly type, replacing previous usages of BRCDataCatalogGenome and GA2AssemblyEntity. Additionally, it introduces a new workflows entity loading and querying system, centralizing API calls and entity storage for assemblies and workflows.

Type Standardization and Refactoring:

  • Replaces all usages of BRCDataCatalogGenome and GA2AssemblyEntity with the new unified Assembly type in hooks, components, and type definitions such as useUCSCFiles, useRequirementsMatches, and related props and utility functions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Workflows Entity Loading System:

  • Adds a new entity loading and querying system under app/services/workflows, including utilities to load, store, and retrieve assemblies and workflows from API endpoints, with centralized state management. [1] [2] [3] [4] [5] [6] [7] [8]

Component and Utility Updates:

  • Updates imports and props in workflow input configuration components to use the new Assembly type and the refactored entity types, ensuring consistency across the codebase. [1] [2] [3]

These changes improve type safety, code maintainability, and centralize entity management for assemblies and workflows, making future enhancements and debugging easier.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors entity loading to improve build performance by moving genome/assembly resolution from build-time to runtime. It introduces a centralized in-memory entity management system and standardizes the genome type to a single Assembly type union.

  • Implements a new runtime entity loading system with store, query, loader, and hooks to fetch and cache assemblies and workflows from JSON API endpoints
  • Simplifies getStaticProps to only return route parameters, eliminating expensive build-time entity fetching and validation
  • Unifies BRCDataCatalogGenome and GA2AssemblyEntity types under a single Assembly type alias throughout the codebase

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/services/workflows/store.ts Introduces in-memory maps to store entities by type and by ID
app/services/workflows/query.ts Provides getter functions to retrieve entities from the store with error handling
app/services/workflows/loader.ts Implements fetch logic to load entities and workflows from API endpoints into the store
app/services/workflows/entities.ts Exports typed getter functions for assemblies and workflows
app/services/workflows/hooks/UseEntities/hook.ts Custom hook to load entities on app initialization
app/services/workflows/hooks/UseEntities/utils.ts Singleton pattern to ensure entities load only once
app/services/workflows/routes.ts Defines API endpoint constants for assemblies and workflows
app/services/workflows/types.ts Type definitions for entity routes
pages/_app.tsx Integrates entity loading hook to populate store before rendering
pages/data/[entityListType]/[entityId]/[trsId]/index.tsx Simplifies getStaticProps by removing build-time entity resolution
app/views/WorkflowInputsView/workflowInputsView.tsx Refactored to fetch entities at runtime using new getter functions
app/views/WorkflowInputsView/types.ts Defines unified Assembly type alias
app/components/Entity/components/ConfigureWorkflowInputs/**/*.ts Updated type references from specific genome types to Assembly
scripts/sync-api-brc-analytics.sh Script to copy catalog JSONs to public API directory for brc-analytics
scripts/sync-api-ga2.sh Script to copy catalog JSONs to public API directory for ga2
package.json Updated build and dev scripts to run sync-api scripts before Next.js commands
.gitignore Excludes generated /public/api directory from version control
tests/services/workflows.store.test.ts Test coverage for entity store operations
tests/services/workflows.query.test.ts Test coverage for entity query functions
tests/services/workflows.loader.test.ts Test coverage for entity loading logic with fetch mocking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@frano-m frano-m requested a review from Copilot November 25, 2025 07:41
Copilot finished reviewing on behalf of frano-m November 25, 2025 07:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NoopDog NoopDog assigned hunterckx and unassigned NoopDog Nov 26, 2025
@NoopDog NoopDog requested a review from hunterckx November 26, 2025 07:05
@frano-m frano-m force-pushed the fran/1021-build-speed branch from e4909c9 to 5b6d4b4 Compare December 2, 2025 00:09
@hunterckx
Copy link
Collaborator

I've approved this but I think @NoopDog wanted to review the API path before merging?

@NoopDog NoopDog merged commit f2a206f into main Dec 2, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in BRC development tasks Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix build speed

4 participants