Skip to content
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

2891 Rails 7 #3819

Merged
merged 62 commits into from
May 16, 2024
Merged

2891 Rails 7 #3819

merged 62 commits into from
May 16, 2024

Conversation

mjy
Copy link
Member

@mjy mjy commented Feb 12, 2024

No description provided.

@mjy mjy changed the title Update Gem dependencies to succeed for Rails 7.1 bundle update. 2891 Rails 7 Feb 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2024

Codecov Report

Attention: Patch coverage is 79.34783% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 60.61%. Comparing base (1226625) to head (09aa6f8).
Report is 3 commits behind head on development.

Current head 09aa6f8 differs from pull request most recent head 165ab11

Please upload reports for the commit 165ab11 to get more accurate results.

Files Patch % Lines
spec/support/controller_spec_helper.rb 0.00% 8 Missing ⚠️
lib/batch_load/import.rb 0.00% 6 Missing ⚠️
...batch_load/import/taxon_names/nomen_interpreter.rb 50.00% 2 Missing ⚠️
app/models/import_dataset/darwin_core.rb 0.00% 1 Missing ⚠️
app/models/taxon_name_relationship.rb 95.23% 1 Missing ⚠️
lib/queries/sqed_depiction/filter.rb 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@               Coverage Diff                @@
##           development    #3819       +/-   ##
================================================
- Coverage        72.37%   60.61%   -11.77%     
================================================
  Files             1925     1663      -262     
  Lines            65939    55511    -10428     
================================================
- Hits             47723    33646    -14077     
- Misses           18216    21865     +3649     

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

LocoDelAssembly and others added 3 commits February 13, 2024 17:39
Remove require_dependencies
!! validates_uniqueness_of now compares "across the system", which apperently means unsaved objects in this case, this is very different behaviour (if interpretation is correct)  that we may have to take into account in import scripts.
mjy and others added 20 commits February 15, 2024 12:17
* Move towards handling setting `cached_` values `after_commit`.  This should help to eliminate the potential cascading touches on objects.
* Updated original batch framework to save off by type, not row-by-row
* TaxonName validate_parent_is_set is the same as one root per project, removed
* Softened, but made more flexible cascading validation checks through `TaxonName#children` via changes to `TaxonName#parent_is_set?`
* Removed the largely redundant subject/object validation in TaxonNameRelationship, this was added during Nomen batch load, and causes many redundant checks.  Fixes to Batch save order made these unnecessary.
@kleintom
Copy link
Contributor

I'm guessing maybe you already considered this and decided nothing needs changing, but I'll mention it just in case since it showed up in my logs.

The situation was doing a batch create of new loan items from tags, where the batch create failed because one of the items was already on loan. I noticed the following deprecation warning:

DEPRECATION WARNING: Using `return`, `break` or `throw` to exit a transaction block is
deprecated without replacement. If the `throw` came from
`Timeout.timeout(duration)`, pass an exception class as a second
argument so it doesn't use `throw` to abort its block. This results
in the transaction being committed, but in the next release of Rails
it will rollback.
 (called from batch_create_from_tags at /app/app/models/loan_item.rb:275)

and here's the code:

def self.batch_create_from_tags(keyword_id, klass, loan_id)
created = []
LoanItem.transaction do
begin
if klass
klass.constantize.joins(:tags).where(tags: {keyword_id:}).each do |o|
created.push LoanItem.create!(loan_item_object: o, loan_id:)
end
else
Tag.where(keyword_id:).where(tag_object_type: ['Container', 'Otu', 'CollectionObject']).distinct.all.each do |o|
created.push LoanItem.create!(loan_item_object: o.tag_object, loan_id:)
end
end
rescue ActiveRecord::RecordInvalid
return false
end
end
return created
end

I guess now instead of commiting the loan items that succeeded before the error, now none of them will be commited. If there's anything I can help with here feel free to let me know.

@LocoDelAssembly LocoDelAssembly merged commit 165ab11 into development May 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants