Skip to content

Accession samples in multiple studies#5603

Open
StephenHulme wants to merge 4 commits intodevelopfrom
sh51/accession-samples-in-multiple-studies
Open

Accession samples in multiple studies#5603
StephenHulme wants to merge 4 commits intodevelopfrom
sh51/accession-samples-in-multiple-studies

Conversation

@StephenHulme
Copy link
Contributor

Permits accessioning of samples in multiple studies

Changes proposed in this pull request

  • Permit accessioning of samples when belonging to many open (ENA) studies
  • Refactor warning dialogs in templates

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@StephenHulme StephenHulme self-assigned this Mar 10, 2026
@StephenHulme StephenHulme added the Accessioning Epic in technical roadmap June 2025, relating to improving the accessioning code. label Mar 10, 2026
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 75.75758% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.23%. Comparing base (f5ed910) to head (d6d4bcb).

Files with missing lines Patch % Lines
app/helpers/samples_helper.rb 66.66% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5603      +/-   ##
===========================================
- Coverage    87.25%   87.23%   -0.02%     
===========================================
  Files         1460     1460              
  Lines        32966    32994      +28     
  Branches      3465     3471       +6     
===========================================
+ Hits         28764    28783      +19     
- Misses        4181     4190       +9     
  Partials        21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

Choose a reason for hiding this comment

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

can there be also a separate context where study2 is a managed study for testing the mixed case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good thinking, will add some more tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d6d4bcb

@yoldas yoldas self-requested a review March 11, 2026 00:45
@StephenHulme StephenHulme requested review from andrewsparkes, neilsycamore and yoldas and removed request for yoldas March 11, 2026 11:18
@StephenHulme
Copy link
Contributor Author

StephenHulme commented Mar 11, 2026

Screenshots from @neilsycamore's testing:

Screenshot 2026-03-11 at 11 52 39 Screenshot 2026-03-11 at 11 53 08
Screenshot 2026-03-11 at 11 54 00 Screenshot 2026-03-11 at 11 54 14


unopen_studies = sample.studies_for_accessioning.reject { |study| study.study_metadata.open? }
accession_warning(
'Samples belonging to more than one study can only be accessioned if all accessionable studies are open:',
Copy link
Member

Choose a reason for hiding this comment

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

If all of them are managed, they could be accessioned to EGA, because there is no mix of open and managed. This is a discussion point I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EGA does have the extra complexity of having different data policies and contacts. But yes, technically there's no reason why not, but it's a changed of business logic that should be discussed.

let(:studies) { [managed_with_accession_1, managed_with_accession_2] }

it 'should not be accessioned' do
expect(sample.should_be_accessioned?).to be false
Copy link
Member

@yoldas yoldas Mar 11, 2026

Choose a reason for hiding this comment

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

case: if all are managed, we could allow it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are different policy and contact agreements for EGA studies that ENA studies do not have. If this is a desired change to the business logic, it should be relatively easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessioning Epic in technical roadmap June 2025, relating to improving the accessioning code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants