You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix group deletion for single-artifact groups - #113
Fixes group deletion when the Databus API returns databus:hasArtifact as a single JSON object instead of a list.
Previously, the deletion implementation expected a list of artifact dictionaries. When the API returned a single dictionary, iteration processed its keys instead of the artifact object, potentially causing an AttributeError.
This change normalizes the single-artifact response before processing it.
Changes
Normalize a single artifact dictionary into a list.
Preserve support for multiple artifacts.
Skip malformed non-dictionary artifact entries.
Validate artifact URIs before processing.
Add regression tests for single-artifact group deletion and relevant edge cases.
Tests
CAND-2 regression tests: 7 passed.
Full test suite: 207 passed, 3 skipped.
Ruff: All checks passed.
Python: 3.11.18.
Scope
Only the following files are changed:
databusclient/api/delete.py
tests/test_delete_group.py
No unrelated deployment changes are included.
Summary by CodeRabbit
Bug Fixes
Group deletion now handles artifact information provided as either a single item or a list. Missing or invalid artifact entries are safely skipped, while valid artifact references continue through the existing deletion process. This prevents unexpected artifact data from interrupting group deletion.
No actionable comments were generated in the recent review.
Walkthrough
_delete_group now accepts a single artifact object or a list of artifacts. It skips values and entries that do not contain a non-empty string @id. Tests cover supported artifact shapes and invalid values.
Changes: Group deletion
Layer / File(s)
Summary
Normalize and validate artifact entries databusclient/api/delete.py, tests/test_delete_group.py
_delete_group normalizes a single artifact object into a list and treats missing or unexpected values as no artifacts. It skips non-dictionary entries and entries without a non-empty string @id. Tests cover these cases and verify valid IDs are passed to deletion.
Group deletion now handles groups whose single artifact is returned as a JSON object, and it skips malformed entries. The change is small and tested, and no merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: group deletion now handles a group whose databus:hasArtifact is a single object. The changeset normalizes that single artifact into a list in databusclient/api/delete.…
Description check
The description follows the repository template. It links Issue #112, names the change type as a bug fix in the description text, and lists the changes, tests, and scope. The template's Type of change…
Linked Issues check
Issue #112 requires group deletion to handle three cases: a single artifact as a JSON object, multiple artifacts as a JSON array, and no artifacts. At the reviewed head, _delete_group in `databuscli…
Out of Scope Changes check
The PR changes databusclient/api/delete.py and tests/test_delete_group.py, as stated in the PR description. The delete.py changes are confined to the _delete_group artifact-normalization and U…
Full details: Title check
Explanation
The title names the main change: group deletion now handles a group whose databus:hasArtifact is a single object. The changeset normalizes that single artifact into a list in databusclient/api/delete.py and adds regression tests, so the title matches the primary fix.
Full details: Description check
Explanation
The description follows the repository template. It links Issue #112, names the change type as a bug fix in the description text, and lists the changes, tests, and scope. The template's Type of change checkboxes and most Checklist items are not ticked, and the description does not state the change type or confirm the checklist items explicitly. The described changes and the test evidence are specific.
Full details: Linked Issues check
Explanation
Issue #112 requires group deletion to handle three cases: a single artifact as a JSON object, multiple artifacts as a JSON array, and no artifacts. At the reviewed head, _delete_group in databusclient/api/delete.py wraps a dict databus:hasArtifact in a list. It passes a list through unchanged. It sets any missing, None, or other-typed value to an empty list. It then skips non-dictionary items and items whose @id is missing, non-string, or empty, before calling _delete_artifact on each remaining URI. This covers the proposed solution in #112. The PR summary reports regression tests in tests/test_delete_group.py for a single artifact dictionary, a list of artifacts, and the no-artifact and malformed-entry edge cases. Those tests were not read directly. The head source alone establishes the behavior. No unmet coding requirement was found.
Full details: Out of Scope Changes check
Explanation
The PR changes databusclient/api/delete.py and tests/test_delete_group.py, as stated in the PR description. The delete.py changes are confined to the _delete_group artifact-normalization and URI-collection logic that #112 addresses. The reviewed head shows no unrelated logic in that function. The added filter that skips versioned artifact URIs is described in the summary as continuing the existing version check, so it is not a new behavior. The whole-PR merge base blob could not be read, so the exact base-to-head diff was not verified directly. This limits confidence about whether the version filter is pre-existing, but the summary does not describe it as new.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: e92a9ac1-3f30-438d-9c8e-b09b93c217ce
Commits
Reviewing files that changed from the base of the PR and between 70fb67f and 995bda9.
Files selected for processing: 2
databusclient/api/delete.py
tests/test_delete_group.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Closes #112
Fixes group deletion when the Databus API returns
databus:hasArtifactas a single JSON object instead of a list.Previously, the deletion implementation expected a list of artifact dictionaries. When the API returned a single dictionary, iteration processed its keys instead of the artifact object, potentially causing an AttributeError.
This change normalizes the single-artifact response before processing it.
Changes
Tests
Scope
Only the following files are changed:
databusclient/api/delete.pytests/test_delete_group.pyNo unrelated deployment changes are included.
Summary by CodeRabbit