Skip to content

Add better WorkflowSummary type #19779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ahmedhamidawan
Copy link
Member

@ahmedhamidawan ahmedhamidawan commented Mar 10, 2025

Related to #19777 (?)
Follows up on #19294 (comment)
Fixes #19681

Creates a WorkflowSummary type which we use in cases where StoredWorkflowDetailed is not needed (or is rather not the actual return from the backend in fact).

Then also adds the AnyWorkflow type to generalize usage:

export type AnyWorkflow = WorkflowSummary | StoredWorkflowDetailed;

Moves methods from workflows.services to the client/src/api/workflows.ts file

I moved some functions that have a typed response from workflows.services to workflows.ts to make it more uniform with what we do in other places (e.g.: datasets.ts).

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@ahmedhamidawan
Copy link
Member Author

Does this improve on the concerns here @mvdbeek ?

@ahmedhamidawan
Copy link
Member Author

I moved some functions that have a typed response from workflows.services to workflows.ts to make it more uniform with what we do in other places (e.g.: datasets.ts).

@davelopez Does what I have done here make sense?

@davelopez
Copy link
Contributor

Does what I have done here make sense?

Yes, it does to me :)

@jmchilton
Copy link
Member

jmchilton commented Mar 11, 2025

Current errors: 10
Baseline errors: 11
vue-tsc error count did not increase.

xref #19681

@ahmedhamidawan
Copy link
Member Author

@jmchilton I think this takes care of what #19681 reports then 🤔 ?

mvdbeek

This comment was marked as outdated.

@mvdbeek
Copy link
Member

mvdbeek commented Mar 11, 2025

Does this improve on the concerns here @mvdbeek ?

No. You'll want to have an extremely good reason to cast a defined type to something else. I think this should be limited to responses from non-fastapi endpoints.

@mvdbeek
Copy link
Member

mvdbeek commented Mar 11, 2025

I think this should be limited to responses from non-fastapi endpoints.

I had forgotten that we have fastapi endpoints without defined models. This is fine then.

@mvdbeek mvdbeek dismissed their stale review March 11, 2025 16:21

We don't have types in the first place so this is all moot.

@mvdbeek mvdbeek merged commit c727338 into galaxyproject:dev Mar 11, 2025
36 checks passed
@mvdbeek
Copy link
Member

mvdbeek commented Mar 11, 2025

Thanks @ahmedhamidawan!

@ahmedhamidawan ahmedhamidawan deleted the improve_workflow_typing_client branch March 12, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Typing in WorkflowCard & WorkflowCardList.
4 participants