Skip to content

Fix: Update conditional statement for COG inheritance to allow DwC Archive update - #8413

Merged
CarolineDenis merged 3 commits into
mainfrom
issue-8411
Aug 11, 2026
Merged

Fix: Update conditional statement for COG inheritance to allow DwC Archive update#8413
CarolineDenis merged 3 commits into
mainfrom
issue-8411

Conversation

@CarolineDenis

@CarolineDenis CarolineDenis commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #8411

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR
  • Add migration function to
    def fix_schema_config(stdout: WriteToStdOut | None = None):

Testing instructions

  • Go to User Tools
  • Click on either Create DwC Archive or Update RSS Feed
  • Check notifications
  • Verify it works

Summary by CodeRabbit

  • Bug Fixes
    • Restricted inheritance queries to supported table and field combinations.
    • Field names are now handled consistently regardless of capitalization.
    • Unsupported tables or requests without a catalog number are now safely ignored.

@github-actions

Copy link
Copy Markdown

Warning

One or more dependencies are approaching or past End-of-Life.
Please plan upgrades accordingly.

STATUS=WARNING
NODE_VERSION=20
NODE_CYCLE=20
EOL_DATE=2026-04-30
DAYS_REMAINING=-103

--- Node.js ---
Version: 20
EOL: 2026-04-30
Status: WARNING

STATUS=OK
PYTHON_VERSION=3.12
PYTHON_CYCLE=3.12
EOL_DATE=2028-10-31
DAYS_REMAINING=812

--- Python ---
Version: 3.12
EOL: 2028-10-31
Status: OK

STATUS=WARNING
DJANGO_VERSION=4.2
DJANGO_CYCLE=4.2
EOL_DATE=2026-04-07
DAYS_REMAINING=-126

--- Django ---
Version: 4.2
EOL: 2026-04-07
Status: WARNING


@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c0cb1384-34df-4e16-8e4f-78c56c4ef4fc

📥 Commits

Reviewing files that changed from the base of the PR and between b181624 and 8508f1f.

📒 Files selected for processing (1)
  • specifyweb/backend/inheritance/api.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • specifyweb/backend/inheritance/api.py

📝 Walkthrough

Walkthrough

Changes

The inheritance query processor now normalizes requested field names to lowercase. Processing continues only for table 1 requests that include catalognumber; other requests return do_nothing.

Inheritance query processing

Layer / File(s) Summary
Tighten processor eligibility
specifyweb/backend/inheritance/api.py
The processor lowercases field names, requires table 1 and catalognumber, and uses the normalized field name for index lookup.
🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Automatic Tests ⚠️ Warning The PR changes backend query eligibility and field normalization, but only modifies api.py; existing COG tests are unchanged and the checklist leaves automated tests unchecked. Add a regression test for lowercase catalognumber input and the table/field eligibility conditions, then run the relevant stored-query test.
Testing Instructions ⚠️ Warning The steps name both affected User Tools actions, but “either” does not require testing both and “check notifications” lacks explicit success criteria for the asynchronous operations. Test Create DwC Archive and Update RSS Feed separately; wait for completion and verify “DwCA export completed” and “RSS Export feed has been updated,” with no failure notification.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the conditional update for COG inheritance that enables DwC Archive and RSS Feed operations.
Linked Issues check ✅ Passed The targeted conditional change addresses the catalog-number eligibility failure reported in issue [#8411].
Out of Scope Changes check ✅ Passed The pull request changes one inheritance eligibility condition and contains no unrelated modifications.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8411

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@specifyweb/backend/inheritance/api.py`:
- Line 44: Use one canonical spelling for the catalog-number field in the
inheritance check and the subsequent .index lookup: update the logic around
first_field_names and its lookup so both use the repository’s normalized
field-name convention, allowing valid CollectionObject requests to proceed with
inheritance processing.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 02467e56-8190-4e86-a3d2-3ebfb48de9df

📥 Commits

Reviewing files that changed from the base of the PR and between 2948e3d and b181624.

📒 Files selected for processing (1)
  • specifyweb/backend/inheritance/api.py

Comment thread specifyweb/backend/inheritance/api.py Outdated
@github-project-automation github-project-automation Bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Aug 11, 2026

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Verify it works

Looks good, can export DwcA without error

@emenslin
emenslin requested a review from a team August 11, 2026 13:18
@CarolineDenis
CarolineDenis merged commit fb1c6d6 into main Aug 11, 2026
23 checks passed
@CarolineDenis
CarolineDenis deleted the issue-8411 branch August 11, 2026 17:54
@github-project-automation github-project-automation Bot moved this from Dev Attention Needed to ✅Done in General Tester Board Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Creating DwC Archive throws an error

2 participants