Skip to content

Conversation

frano-m
Copy link
Contributor

@frano-m frano-m commented Jul 24, 2025

Ticket

Closes #4527.

Reviewers

@NoopDog, @hunterckx

This pull request removes legacy code related to the AnVIL platform and simplifies the codebase by eliminating unused interfaces, constants, and utility functions. The changes primarily focus on removing outdated models, response types, and utility functions for processing API responses, as well as cleaning up related imports and configurations.

Removal of legacy AnVIL models and utilities:

  • Removed all interfaces defining aggregated and core entities (e.g., AggregatedActivity, DatasetEntity) from app/apis/azul/anvil/common/aggregatedEntities.ts and app/apis/azul/anvil/common/entities.ts. These were used to model API responses from AnVIL endpoints. [1] [2]
  • Deleted response types (e.g., ActivitiesResponse, BioSamplesResponse) from app/apis/azul/anvil/common/responses.ts, which combined multiple entity models into composite API response types.
  • Removed utility functions from app/apis/azul/anvil/common/transformers.ts that processed values from AnVIL API responses (e.g., getActivityType, getDatasetName).

Cleanup of related imports and configurations:

  • Removed the default AnVIL catalog constant CATALOG_DEFAULT from app/apis/azul/anvil/common/constants.ts.
  • Eliminated AnVIL-specific configurations (e.g., anvil-dev, anvil-prod) from app/config/config.ts. [1] [2]
  • Updated hardcoded dataset paths in app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.ts to remove dependency on URL_DATASETS. [1] [2]

Removal of unused components and exports:

  • Deleted the RenderComponents component from app/components/common/RenderComponents/renderComponents.tsx and its export from app/components/index.tsx. [1] [2]

These changes streamline the codebase by removing obsolete AnVIL-related code, reducing maintenance overhead and improving clarity.

Copy link
Contributor

@Copilot 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 completely removes legacy AnVIL platform code from the codebase, eliminating the original AnVIL site configuration and all associated models, utilities, and components. The changes streamline the codebase by removing obsolete code while preserving the AnVIL-CMG catalog functionality.

  • Deleted entire site-config/anvil/ directory containing dev and prod configurations
  • Removed all AnVIL-specific API models, response types, and transformer utilities
  • Updated import paths in AnVIL-CMG catalog to reference correct components after AnVIL removal

Reviewed Changes

Copilot reviewed 29 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
site-config/anvil/ Complete removal of AnVIL site configuration directory
app/apis/azul/anvil/common/ Deletion of all AnVIL API models and utilities
app/components/common/RenderComponents/ Removal of unused RenderComponents component
app/config/config.ts Cleanup of AnVIL configuration references
site-config/anvil-catalog/dev/ Updated import paths after AnVIL removal
app/viewModelBuilders/azul/anvil-cmg/ Hardcoded dataset paths to remove AnVIL dependency

@@ -1,5 +1,5 @@
import { SocialMedia } from "@databiosphere/findable-ui/lib/components/Layout/components/Header/common/entities";
import * as C from "../../../app/components/index";
import * as C from "../../../../app/components/index";
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

[nitpick] The import path has been updated from '../../../' to '../../../../' which suggests the file structure has changed. Consider using absolute imports or path aliases to make imports more maintainable and less fragile to directory structure changes.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, we are not using aliases.

import { ANCHOR_TARGET } from "@databiosphere/findable-ui/lib/components/Links/common/entities";
import * as C from "../../../../../../../app/components";
import { SOCIALS } from "../../../../../../anvil/dev/socialMedia";
import { SOCIALS } from "../../../../socials/socialMedia";
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Similar to the previous file, the import path has changed significantly. Consider implementing a consistent import strategy using path aliases (e.g., '@/components', '@/config') to avoid deep relative paths that are prone to breaking when files are moved.

Suggested change
import { SOCIALS } from "../../../../socials/socialMedia";
import { SOCIALS } from "@/socials/socialMedia";

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently not using aliases.

@frano-m frano-m force-pushed the fran/4527-anvil-config branch from 0818601 to f71af34 Compare July 25, 2025 00:55
@NoopDog
Copy link
Collaborator

NoopDog commented Jul 25, 2025

This is deployed to all dev sites @frano-m PTAL!

Copy link
Collaborator

@NoopDog NoopDog left a comment

Choose a reason for hiding this comment

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

Looks ok! Thx @frano-m

@NoopDog NoopDog merged commit e6873ec into main Jul 25, 2025
4 checks passed
@frano-m frano-m deleted the fran/4527-anvil-config branch August 19, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AnVIL DX] Remove anvil from site config

3 participants