Skip to content

Conventional dataset tag#359

Open
PGijsbers wants to merge 2 commits into
mainfrom
conventional-dataset-tag
Open

Conventional dataset tag#359
PGijsbers wants to merge 2 commits into
mainfrom
conventional-dataset-tag

Conversation

@PGijsbers

Copy link
Copy Markdown
Contributor

Add a datasets/{identifiers}/tags endpoint

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds POST /datasets/{identifier}/tags with path-based dataset identification and embedded tag input. The deprecated POST /datasets/tag endpoint delegates tagging to the new implementation while preserving its response format. Database constraint errors remain mapped to domain exceptions. Tests cover authorization, endpoint responses, direct-call behavior, duplicate tags, and missing datasets. Migration and roadmap documentation describe the deprecation, parity criteria, and future API modernization.

Possibly related PRs

Suggested labels: tests, documentation

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the change but too vague to clearly convey the new deprecated and replacement dataset tag endpoints. Use a clearer title like 'Add conventional dataset tag endpoint' or 'Deprecate POST /datasets/tag in favor of the new tags route.'
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly matches the main change by mentioning the new datasets/{identifiers}/tags endpoint.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch conventional-dataset-tag

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.

@sourcery-ai sourcery-ai 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.

Hey - I've found 1 issue, and left some high level feedback:

  • Consider returning a more semantically appropriate status code (e.g., 204 No Content) from the new POST /datasets/{identifier}/tags endpoint instead of 200 with a null body, since no response payload is provided.
  • The deprecated tag_dataset handler now calls the new tag_dataset_new route function directly; it would be cleaner to extract the shared tagging logic into a separate helper/service function that both endpoints call to avoid coupling between router handlers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider returning a more semantically appropriate status code (e.g., 204 No Content) from the new `POST /datasets/{identifier}/tags` endpoint instead of `200` with a `null` body, since no response payload is provided.
- The deprecated `tag_dataset` handler now calls the new `tag_dataset_new` route function directly; it would be cleaner to extract the shared tagging logic into a separate helper/service function that both endpoints call to avoid coupling between router handlers.

## Individual Comments

### Comment 1
<location path="docs/migration.md" line_range="136" />
<code_context>
+???+ warning "This endpoint is deprecated"
+
+    The new tag endpoint is `POST` `/datasets/{identifier}/tags`.
+    The dataset identifier is provided as part of the path, the tag is still provided in the body.
+    This endpoint is provided for easier migration in case the response matters to you.
+
</code_context>
<issue_to_address>
**issue (typo):** Fix the comma splice between the two independent clauses.

You can fix this by replacing the comma with "and", using a semicolon, or splitting it into two sentences.

```suggestion
    The dataset identifier is provided as part of the path and the tag is still provided in the body.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/migration.md
???+ warning "This endpoint is deprecated"

The new tag endpoint is `POST` `/datasets/{identifier}/tags`.
The dataset identifier is provided as part of the path, the tag is still provided in the body.

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.

issue (typo): Fix the comma splice between the two independent clauses.

You can fix this by replacing the comma with "and", using a semicolon, or splitting it into two sentences.

Suggested change
The dataset identifier is provided as part of the path, the tag is still provided in the body.
The dataset identifier is provided as part of the path and the tag is still provided in the body.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.64%. Comparing base (a1367c0) to head (68f603e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #359      +/-   ##
==========================================
- Coverage   94.65%   94.64%   -0.01%     
==========================================
  Files          77       77              
  Lines        3815     3827      +12     
  Branches      248      248              
==========================================
+ Hits         3611     3622      +11     
  Misses        137      137              
- Partials       67       68       +1     

☔ View full report in Codecov by Harness.
📢 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.

@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.

🧹 Nitpick comments (1)
docs/migration.md (1)

135-137: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the replacement request body explicitly.

The new endpoint requires an embedded payload such as {"tag": "foo"}; showing this example would prevent clients from carrying over the legacy data_id field during migration.

🤖 Prompt for 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.

In `@docs/migration.md` around lines 135 - 137, Update the migration documentation
describing the POST /datasets/{identifier}/tags endpoint to explicitly show the
replacement request body, using a payload example with the tag field such as
{"tag": "foo"} and omitting the legacy data_id field.
🤖 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.

Nitpick comments:
In `@docs/migration.md`:
- Around line 135-137: Update the migration documentation describing the POST
/datasets/{identifier}/tags endpoint to explicitly show the replacement request
body, using a payload example with the tag field such as {"tag": "foo"} and
omitting the legacy data_id field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 412be693-b754-4414-adab-161cbc1fdad6

📥 Commits

Reviewing files that changed from the base of the PR and between a1367c0 and 68f603e.

📒 Files selected for processing (4)
  • docs/migration.md
  • docs/roadmap.md
  • src/routers/datasets.py
  • tests/routers/dataset_tag_test.py

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.

1 participant