Excise SRA support and ngs-java dependency#1774
Merged
Merged
Conversation
The NCBI SRA reader, backed by the gov.nih.nlm.ncbi:ngs-java native library, has been a recurring source of build/runtime friction and is being removed for v5.0.0. Downstream consumers that need SRA must implement it themselves or use a different library. Removed: - gov.nih.nlm.ncbi:ngs-java api dependency from build.gradle. - The "sra" TestNG group from build.gradle's test and testExternalApis tasks (and from htsjdk.TestDataProviders.EXCLUDED_GROUPS). - The -Dsamjdk.sra_libraries_download=true JVM arg from testExternalApis. The corresponding Defaults.SRA_LIBRARIES_DOWNLOAD field is removed. - 10 main sources under htsjdk/samtools and htsjdk/samtools/sra/ (SRAFileReader, SRAIterator, SRAIndex, SRAAccession, SRALazyRecord, SRAAlignmentIterator, SRAUnalignmentIterator, SRAUtils, ReferenceCache, SRAIndexedSequenceFile). - 7 test classes under htsjdk/samtools/sra/ and the test_archive.sra resource. - SamReader.Type.SRA_TYPE. - The README's SRA license-attribution sentence. Modified (SRA hooks removed): - SamInputResource: drops InputResource.Type.SRA_ACCESSION, the abstract asSRAAccession() method and all its overrides, the SRAInputResource inner class, and the SamInputResource.of(SRAAccession) factory. - SamReaderFactory: drops the SRA dispatch in the resource type switch, the isSra() autodetection branch, the abstract applyTo(SRAFileReader, ...) method on Option and all five overrides of it, plus the instanceof SRAFileReader branch. - SamReaderFactoryTest, SamReaderTest, ReadsBundle (TODO comment): minor follow-on edits where these referenced the removed types. Verification: - ./gradlew compileJava compileTestJava: passes. - ./gradlew test: 21,877 / 21,877 pass (down from 21,936 on dev; the difference is the removed sra test classes plus DataProvider-discovered test paths that referenced the sra group). - ./gradlew spotbugsMain spotbugsTest: clean, no new findings. - ./gradlew spotlessCheck: clean (autoformat applied during compile). - Stragglers: grep'd src/, build.gradle, README, CONTRIBUTING, CHANGELOG, and .github/ for "SRA" tokens, "import ngs.", "sra" string literals, "ngs-java", and "sra_libraries" -- no remaining references. CHANGELOG entry deferred to the dedicated v5.0.0 CHANGELOG task.
5 tasks
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.
Summary
Removes all NCBI SRA reading support and the
gov.nih.nlm.ncbi:ngs-javadependency. This is a breaking API change for v5.0.0.Why
ngs-javaships native libraries that have repeatedly caused build/runtime friction (load failures, platform-specific bugs, opt-in download flag).SamReaderFactoryandSamInputResource.What's removed
Build / config:
gov.nih.nlm.ncbi:ngs-java:2.9.0apidependency."sra"TestNG group references inbuild.gradleandhtsjdk.TestDataProviders.EXCLUDED_GROUPS.-Dsamjdk.sra_libraries_download=trueJVM arg ontestExternalApis.Defaults.SRA_LIBRARIES_DOWNLOAD.Public API:
htsjdk.samtools.SRAFileReader,SRAIterator,SRAIndex.htsjdk.samtools.srapackage (SRAAccession,SRALazyRecord,SRAAlignmentIterator,SRAUnalignmentIterator,SRAUtils,ReferenceCache,SRAIndexedSequenceFile).SamInputResource.of(SRAAccession)factory + theSRA_ACCESSIONInputResource.Typevalue.SamReader.Type.SRA_TYPE.Internal:
SamReaderFactory(resource-type switch, file-type autodetection, theOptionenum'sapplyTo(SRAFileReader, …)overrides).SamInputResource.Tests / resources:
src/test/java/htsjdk/samtools/sra/andtest_archive.sra.Docs:
What downstream consumers need to do
If you have code that calls any of:
SamInputResource.of(SRAAccession)SamReader.Type.SRA_TYPEInputResource.Type.SRA_ACCESSIONhtsjdk.samtools.sra/SRAFileReader/SRAIterator/SRAIndexDefaults.SRA_LIBRARIES_DOWNLOAD-Dsamjdk.sra_libraries_download…delete it. There is no replacement in htsjdk.
Test plan
./gradlew compileJava compileTestJava— passes./gradlew test— 21,877 / 21,877 pass (down from 21,936 on dev; the difference is the removedsra-group test classes plus DataProvider paths that referenced thesragroup)./gradlew spotbugsMain spotbugsTest— clean, no new findings./gradlew spotlessCheck— cleangrepfor\bSRA[A-Za-z_],^import ngs\.,"sra",ngs-java,sra_librariesacrosssrc/,build.gradle,README.md,CONTRIBUTING.md,CHANGELOG.md,.github/— zero remaining referencestest,formatCheck,spotBugsjobs green