Skip to content

fix: remove references to sampleId field removed from Azul backend - #4928

Open
hannes-ucsc wants to merge 1 commit into
mainfrom
hannes/remove-sample-id
Open

fix: remove references to sampleId field removed from Azul backend#4928
hannes-ucsc wants to merge 1 commit into
mainfrom
hannes/remove-sample-id

Conversation

@hannes-ucsc

@hannes-ucsc hannes-ucsc commented Aug 17, 2026

Copy link
Copy Markdown
Member

Filed by Claude Code on behalf of @hannes-ucsc.

Problem

The Azul backend no longer supports the sampleId field. This broke the samples tables, which sorted by it by default:

GET /index/samples?size=25&catalog=dcp60&order=asc&sort=sampleId&filters={}
400 {"Code":"BadRequestError","Message":"Unknown field `sampleId`"}

Reproduced live against service.azul.data.humancellatlas.org (catalog dcp60). Affected https://explore.data.humancellatlas.org/samples and the equivalent LungMAP samples page.

The inner samples[].id property is also gone from responses. /index/samples and /index/files now return only accessible, sampleEntityType, effectiveOrgan, organ, organPart, disease, preservationMethod, source, modelOrgan, modelOrganPart. So the field was unusable both as a sort key and as a displayed value — the Sample Id columns would have rendered empty even where they didn't 400. They are removed rather than re-keyed.

Changes

  • Category definitions — dropped SAMPLE_ID: "sampleId" and its "Sample Id" label from site-config/hca-dcp/category.ts.
  • Column configs — removed the Sample Id column from four lists: HCA DCP samples and files, LungMAP samples and files. Also removed the now-dangling columnVisibility entries in both files tables.
  • Default sort — both samples tables sorted ascending by sampleId, which is what produced the 400. Changed to projectTitle, now the leading column — consistent with the files tables, which sort by their own leading column (fileName). Confirmed sort=projectTitle returns 200 against the samples index.
  • View model builders — deleted buildSampleId and buildAggregatedSampleId; they were the only readers of samples[].id.
  • Types and labels — dropped id from SampleResponse and AggregatedSampleResponse, and removed METADATA_KEY.SAMPLE_ID plus its "sample ids" pluralized label (used only by the deleted aggregated builder).

AnVIL's biosamples.biosample_id ("BioSample Id") is a different backend field and is untouched.

Verification

  • tsc --noEmit — clean
  • npm run lint — 0 errors
  • prettier --check — clean
  • jest --ci — 129/129 passing
  • git grep sampleId — zero hits across .ts/.tsx (excluding AnVIL's biosample_id)

Note for reviewers

This fix has already been merged into the deployment branches (ucsc/hca/dev, ucsc/hca/prod, ucsc/lungmap/dev, ucsc/lungmap/prod) and pushed to their GitLab remotes, ahead of this PR, to unbreak the live samples pages. This PR brings the change to main so a future release merge doesn't revert it. The three ucsc/anvil/* branches deliberately do not carry it.

projectTitle as the replacement default sort is a judgement call, not something the field removal dictated. This choice is temporary. Azul will soon introduce support for the the more meaningful biomaterial_name field (primarily requested by LungMAP, but useful on HCA as well) which we'll recommend to become the default sort for the samples tab.

The Azul backend no longer supports the `sampleId` field, and the inner
`samples[].id` property is likewise absent from `/index/samples` and
`/index/files` responses. This broke the HCA and LungMAP samples tables,
which sorted by `sampleId` by default and so failed with
`400 BadRequestError: Unknown field 'sampleId'`, and left the Sample Id
columns in the samples and files tables rendering empty values.

Remove the Sample Id columns from the HCA and LungMAP samples and files
tables, along with the category key and label, the `buildSampleId` and
`buildAggregatedSampleId` view model builders, the `SAMPLE_ID` metadata
key, and the `id` property on `SampleResponse` and
`AggregatedSampleResponse`. Default sorting on both samples tables
changes to `projectTitle`, now the leading column, matching the files
tables which sort by their own leading column.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@NoopDog
NoopDog requested review from frano-m and a balanced review from Copilot August 17, 2026 18:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes obsolete Azul sampleId usage to restore HCA DCP and LungMAP sample listings.

Changes:

  • Removes Sample ID columns, labels, builders, and response fields.
  • Changes sample-table default sorting to projectTitle.
  • Cleans up obsolete file-table visibility settings.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
site-config/lungmap/dev/index/samplesEntityConfig.ts Removes Sample ID column and updates sorting.
site-config/lungmap/dev/index/filesEntityConfig.ts Removes Sample ID column and visibility entry.
site-config/hca-dcp/ma-dev/entities/samples/tableOptions.ts Updates default sample sorting.
site-config/hca-dcp/ma-dev/entities/samples/columns.ts Removes Sample ID column.
site-config/hca-dcp/ma-dev/entities/files/tableOptions.ts Removes obsolete visibility entry.
site-config/hca-dcp/ma-dev/entities/files/columns.ts Removes Sample ID column.
site-config/hca-dcp/category.ts Removes Sample ID category key and label.
app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.tsx Removes obsolete Sample ID builders.
app/components/Index/common/entities.ts Removes Sample ID metadata key.
app/components/Index/common/constants.ts Removes Sample ID pluralized label.
app/apis/azul/hca-dcp/common/entities.ts Aligns sample response type with Azul.
app/apis/azul/hca-dcp/common/aggregatedEntities.ts Aligns aggregated sample type with Azul.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@frano-m frano-m left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Hannes! 👋 (Claude here, writing on behalf of Fran)

Really nice work — the removal is impressively thorough: no dangling SAMPLE_ID / buildSampleId references, prod configs inherit the fix, and the live-verified default sort was appreciated.

One small thing before merge: the fixture in __tests__/utils/schemaOrg/hcaProjectDataset.test.ts:253 still has id: ["s1"] in the samples array — the field this PR removes. It slips past tsc via the as unknown as Partial<ProjectsResponse> cast.

With that, approved from our side. Thanks again! 🙌

— Fran (via Claude)

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.

3 participants