Skip to content

Conversation

@hunterckx
Copy link
Collaborator

@hunterckx hunterckx commented May 21, 2025

Closes #470

Passing the hashes through from the stepper to the Galaxy API requires some changes to how the steps work:

  • ConfiguredInput now contains a specific set of fields which may have different types, rather than containing arbitrary entries all of the same type.
  • Labels are no longer stored in ConfiguredInput -- instead, the view model builder for the side panel maps over the STEPS array, and for each step uses the label field to determine the entry label, and the function in the renderValue field to determine how the value is displayed. (Note: I believe this is the one place where the new system is less powerful than the old one -- with the new system, there's a one-to-one correspondence between steps and side panel entries.)
  • Due to the change in how labels are used, onConfigure just takes a key and a value. Since the values may be different types, this requires the type system to know what the key is, so keys are referenced via the step config constant rather than being passed to the step component as a prop.

@hunterckx
Copy link
Collaborator Author

@mvdbeek, could you review this, in particular for the actual Galaxy-related changes in galaxy-api.ts?

@frano-m, let me know if the stepper changes look reasonable!

Thanks!

@hunterckx hunterckx requested a review from Copilot May 21, 2025 22:10
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

Adds MD5 hashes to paired FASTQ collections sent to Galaxy and refactors configuration inputs to use a typed key/value system across the stepper and side-panel UI.

  • Introduce ConfiguredInput with explicit fields and update OnConfigure to accept typed tuples
  • Map side-panel entries via STEPS and renderValue instead of storing labels in ConfiguredInput
  • Enhance Galaxy API payloads to include file hashes and update all step components to use the new STEP.key and renderValue patterns

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
UseConfigureInputs/types.ts Define explicit ConfiguredInput and OnConfigureParams
viewModelBuilders.ts Replace generic loop with STEPS+renderValue mapping
galaxy-api.ts Accept EnaPairedReads[], include hashes in payload
entities.ts Add EnaPairedReads & EnaFileInfo, define WorkflowDatasetHash
stepper.tsx Switch to STEPS props, use STEP.key, drop entryKey
Multiple Step/*/step.ts and related components Refactor each step to use typed STEP config and renderValue
Numerous Step/*/* UI components Remove old entryKey/entryLabel props, use onConfigure(STEP.key, …)
Comments suppressed due to low confidence (1)

app/utils/galaxy-api/galaxy-api.ts:146

  • [nitpick] The error message could include the actual lengths to aid debugging, e.g. Hash list length ${splitMd5Hashes.length} does not match URL list length ${splitUrls.length}.
if (splitMd5Hashes.length !== splitUrls.length)
    throw new Error("Hash list has different length than URL list");

return (
<Step
key={key}
key={i}
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Using the array index as a React key can lead to rendering issues if the steps array ever changes order; consider using a stable identifier such as STEP.key or label.

Suggested change
key={i}
key={label}

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think i should work fine here since it's an index in a constant and indices are established as a way to identify the steps elsewhere in the code

* Possible tuples containing a key and its associated value type.
*/
export type OnConfigureParams = {
[K in keyof Required<ConfiguredInput>]: [K, ConfiguredInput[K]];
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

[nitpick] The Required<ConfiguredInput> wrapper is unnecessary since it has the same keys as ConfiguredInput; consider simplifying to keyof ConfiguredInput for clarity.

Suggested change
[K in keyof Required<ConfiguredInput>]: [K, ConfiguredInput[K]];
[K in keyof ConfiguredInput]: [K, ConfiguredInput[K]];

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are not in fact equivalent

}>;
}

interface WorkflowDatasetHash {
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

This interface is referenced in public types but not exported; consider adding export so it can be used externally if needed.

Suggested change
interface WorkflowDatasetHash {
export interface WorkflowDatasetHash {

Copilot uses AI. Check for mistakes.
Copy link
Member

@mvdbeek mvdbeek left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

const splitUrls = enaUrls.split(";");
const splitMd5Hashes = enaMd5Hashes.split(";");
if (splitMd5Hashes.length !== splitUrls.length)
throw new Error("Hash list has different length than URL list");
Copy link
Member

Choose a reason for hiding this comment

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

Is that gracefully handled somewhere in the UI ? Will a user have an alternative ? We could also just render a warning but allow using the files anyway, it's not a critical requirement for functionality, but a nice to have that allows us to do some optimizations on the galaxy backend.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's no special handling for the different errors that might be thrown, but the page content will be replaced with an error message if one occurs, so the user will at least know that something has happened and be able to reload the page to try something else

function getPairedRunUrlsInfo(enaUrls: string): {
forwardUrl: string;
reverseUrl: string;
function getPairedRunUrlsInfo(
Copy link
Member

Choose a reason for hiding this comment

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

generally speaking it might be good to place ENA parsing in a separate file ? I guess I wouldn't look for this in galaxy-api.ts ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I agree -- I didn't do that in this PR because we already had getPairedRunUrlsInfo in galaxy-api.ts and moving it seemed out-of-scope, so I've just opened #547 to cover separating out the ENA stuff

Copy link
Contributor

@frano-m frano-m left a comment

Choose a reason for hiding this comment

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

LGTM thank you @hunterckx 🌭

@hunterckx hunterckx merged commit d069869 into main May 27, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Include checksums in landing requests

4 participants