Repository navigation
Keep one copy of 25 duplicated helpers, in R/ (part of #10) - #11
Merged
Merged
Conversation
The app sources R/ and then server-*.R into the server scope, so a helper defined in both places always ran the server copy while the tests ran the R/ copy, and 13 pairs had drifted. - Delete the server copies of 15 identical helpers and of 7 that differed only in pkg:: prefixes; the R/ versions are now the ones the app runs - step_log2, step_peptide_filter, plot_ordination_biplot: move the app's version into R/ and update their tests (lowercase assay keys, DE table instead of seqAnnoList, label column for biplot arrows) - Delete inst/app/input_example.R: never sourced, held 7 more old copies - Add a guard test: app files must not redefine package functions; the 6 helpers that read server-scope reactives are still allowlisted Assisted-by: AI coding agent
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.
Part of #10. First of two steps; the 6 helpers that read server-scope reactives follow in a second PR.
Why
R/and thenserver-*.Rinto the server scope, so a helper defined in both ran the server copy in the app and theR/copy in the teststest-ordination.Rassertedstep_log2(..., "TPM")while the app passes lowercase assay keysChanges
R/copy kept (identical code, 15):batch_correction_design,collapse_guides_to_genes,is_url,parse_gene_text,select_genes_by_sd,plot_ordination_samples,step_batch_correction,step_group_subset,step_top_n_sd,buildCitationsList,detectDEMethod,formatRefBuild,generateMethodsText,getFastpVersion,getPackageVersionsR/copy kept (differed only inpkg::prefixes, 7):apply_batch_correction,calculate_pca,calculate_pcoa,calculate_glmpca,prepare_biplot_data,dataSummary,detectAlignerR/, server copy deleted, tests updated (3):step_log2(lowercase assay keys),step_peptide_filter(takes the DE table, checks fornrPeptides),plot_ordination_biplot(arrow labels from alabelcolumn, falling back togene)inst/app/input_example.Rdeleted: never sourced, held 7 more old copiestest-no_duplicate_helpers.R: app files must not redefine package functions (6 pending helpers allowlisted)Behaviour: none for the app. Every helper now runs the code the app ran before; the 3 drifted ones keep the app's version.
Deployment: prod sources
exploreDE/Rfrom the same checkout (app.R,../../R), so agit pullshipsR/andinst/app/together; no base-image change.Verified locally
test-prolfquapp_h5ad.R, identical on unchangedmain(local prolfquapp 2.11.1 writes h5advarmthe reader rejects), unrelatedserver-summary.Ris restored (names the 7 helpers), passes after revertingPrepared with the assistance of an AI coding agent.