Repository navigation
Lint: no non-null assertions in the GSA form (52 → 0) - #896
Merged
Merged
Conversation
A dataset in the store fills in as it loads (its summary, annotations, statistical design), so each reader now says what it needs: - The reducer changes a design through updateDesign and a summary through fromSummary, which leave the state as it is before the dataset has one, as the entity helper already does for a dataset there is not. Annotation columns are made for the datasets that have annotations. - The selectors read the design once, and say "not complete" where it is missing rather than throwing. - The submitted design is built by submittedDesign, tested: a design without its groups or a covariate's column is refused through the path a refused request takes (loadFailure, its reason shown), not sent without them for the service to refuse. - A finished load with no dataset id fails as a summary that could not be had. Lint 1,129 -> 1,077 (no-non-null-assertion 203 -> 151). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # lint-baseline.json
# Conflicts: # lint-baseline.json
From #896's review. The default analysis group comes from the service, not from the annotation header, so the form can show a design complete whose group names a column the samples lack; submitting it said only that the design was not complete. It now names the column, as it does for a chosen covariate with no column. The refusal is made by refusal(), tested as a 400 with its reason in detail: a 503 would be retried every minute as the service being busy. Both tests were seen failing (a 503; the message removed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Independent review, with main merged in: no regression that matters; the state shape is unchanged. Acted on (5388605, both tests seen failing under mutation):
Left as they are, all on paths the form's steps do not reach in normal use:
The lint baseline is regenerated after the merge: 931 → 879 warnings. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lint ratchet:
@typescript-eslint/no-non-null-assertion, first area. This removes all 52 non-null assertions from the GSA form library (projects/reactome-gsa-form).What changed
A dataset in the store fills in as it loads: first its summary, then its annotations, then its statistical design. Each reader now states what it needs, instead of asserting that the data is there.
updateDesign, and a change made from a summary goes throughfromSummary. Before the dataset has a design or summary, both leave the state as it is. The entity helper already does the same for a dataset that does not exist.loadingStatus!.statusthrew when the status was absent.submittedDesign, which is exported and tested.loadFailure, with the reason shown). Before, it was sent without them for the service to refuse.Request.DatasetandRequest.DataInformationare exported so the function can be typed./summary/undefined.typeonly when it exists. The!onidwas unnecessary, becauseidis required.Counts
no-non-null-assertionTested
submittedDesignspec covers a complete design, a design missing its groups, and a covariate with no column. I removed the comparison-group check and it failed.analysis.spec.tsandanalysis-results.spec.ts, which include the GSA form: 33 passed.Note for review
This branch was cut before #895 merged. Both PRs touch
lint-baseline.json, so whichever merges second needs its baseline regenerated; I'll rebase this one once #895 is in.🤖 Generated with Claude Code