Skip to content

Update migration guide and test docs#316

Merged
PGijsbers merged 5 commits intomainfrom
update-migration
Apr 16, 2026
Merged

Update migration guide and test docs#316
PGijsbers merged 5 commits intomainfrom
update-migration

Conversation

@PGijsbers
Copy link
Copy Markdown
Contributor

No description provided.

@PGijsbers PGijsbers added the documentation Improvements or additions to documentation label Apr 16, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Warning

Rate limit exceeded

@PGijsbers has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 20 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 20 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d83ef562-c7a0-4b1d-bd69-98862fecf335

📥 Commits

Reviewing files that changed from the base of the PR and between eee5760 and d8d0346.

📒 Files selected for processing (2)
  • docs/contributing/tests.md
  • docs/migration.md

Walkthrough

This pull request contains updates to two documentation files. The first adds a new section to the testing documentation explaining how database fixtures manage transactions during test execution and provides guidance for migration tests involving multiple database interactions. The second updates migration documentation to describe RFC 9457-compliant error response formats with standardized fields and corrects HTTP status code mappings for specific error scenarios. Both changes are documentation-only with no modifications to code.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a brief description explaining the purpose of these documentation updates and any context reviewers should know.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: updating documentation in both migration.md and tests.md files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-migration

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 and usage tips.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • In migration.md, under 'Appropriate HTTP Status Codes', fix minor wording issues like 'There are several cases were the PHP server...' → 'where' and consider tightening phrases like 'aims to correct that' to something more precise (e.g., 'corrects this').
  • In tests.md, the sentence 'We do not want our tests to side effects' is missing 'have' and should be clarified (e.g., 'We do not want our tests to have side effects, as they might lead to inconsistent behavior').
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `migration.md`, under 'Appropriate HTTP Status Codes', fix minor wording issues like 'There are several cases were the PHP server...' → 'where' and consider tightening phrases like 'aims to correct that' to something more precise (e.g., 'corrects this').
- In `tests.md`, the sentence 'We do not want our tests to side effects' is missing 'have' and should be clarified (e.g., 'We do not want our tests to have side effects, as they might lead to inconsistent behavior').

## Individual Comments

### Comment 1
<location path="docs/migration.md" line_range="37" />
<code_context>
+You will notice that the response still contains a "code" of "111" (though as a top level property not embedded in the "error" scope).
+This field is included to support the migration of clients, but should be considered deprecated.
+As per the RFC9457 standard, the "type" field now includes the unique code for the error.
+The "title" field is a human readable summary of the general issue and the "detail" case may provide additional information for the specific request.
+They _will_ be resolvable URIs in the future, providing a page with more information.
+
</code_context>
<issue_to_address>
**issue (typo):** Consider changing "detail" case" to "detail" field" for grammatical correctness.

Using "field" for both "title" and "detail" will keep the terminology consistent and clearer, e.g. "the \"detail\" field may provide additional information for the specific request."

```suggestion
As per the RFC9457 standard, the "type" field now includes the unique code for the error.
The "title" field is a human readable summary of the general issue and the "detail" field may provide additional information for the specific request.
```
</issue_to_address>

### Comment 2
<location path="docs/migration.md" line_range="44" />
<code_context>
+In some cases the JSON endpoints previously returned XML ([example](https://github.com/openml/OpenML/issues/1200)), the new API always returns JSON.
+
+# Appropriate HTTP Status Codes
+There are several cases were the PHP server did not provide semantically correct status codes.
+The Python server aims to correct that.
+The errors that changed which are most likely to occur are probably errors when there is no result, or when the input is incorrect.
</code_context>
<issue_to_address>
**issue (typo):** Typo: use "where" instead of "were".

Use: "There are several cases where the PHP server did not provide semantically correct status codes."

```suggestion
There are several cases where the PHP server did not provide semantically correct status codes.
```
</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
Comment thread docs/migration.md Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.53%. Comparing base (8b48c59) to head (d8d0346).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #316   +/-   ##
=======================================
  Coverage   93.53%   93.53%           
=======================================
  Files          67       67           
  Lines        3109     3109           
  Branches      221      221           
=======================================
  Hits         2908     2908           
  Misses        143      143           
  Partials       58       58           

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/contributing/tests.md`:
- Line 143: Fix the grammar in the sentence that currently reads "do not want
our tests to side effects" by changing it to "do not want our tests to have side
effects" wherever that exact phrasing occurs (the sentence discussing tests and
side effects in the contributing/tests.md content).
- Around line 145-148: Update the "migration tests" section to document the
known limitation: state that migration tests for OpenML API endpoints that use
the PHP API for staging cannot assert certain authentication-failure paths
(specifically Code 103) when the legacy PHP API returns XML instead of JSON, and
add guidance to instead cover those scenarios in standard Python unit tests
after migration; reference the terms "migration tests", "php_api", "Code 103",
and "authentication-failure" so readers can find and implement the appropriate
post-migration Python unit tests.

In `@docs/migration.md`:
- Around line 38-44: Replace the wording typos in the migration doc: change
"detail case" to "detail field" and "cases were" to "cases where" in the section
that includes the sentences "The 'title' field..." and "# Appropriate HTTP
Status Codes" so the phrasing reads correctly and clearly.
- Line 32: The example response JSON in docs/migration.md has a mismatched
dataset id: the curl request references dataset 1000000 but the JSON "detail"
says 10000; update the JSON "detail" (and "code" if it encodes the id) so the
dataset id matches the curl (e.g., change "No dataset with id 10000 found." to
"No dataset with id 1000000 found.") and ensure any other example fields
referencing the id are consistent (check the JSON object containing
"type","title","status","detail","code").
🪄 Autofix (Beta)

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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b7a8d94e-fdb5-473c-852f-b695c12960c8

📥 Commits

Reviewing files that changed from the base of the PR and between 8b48c59 and eee5760.

📒 Files selected for processing (3)
  • docs/contributing/tests.md
  • docs/migration.md
  • tests/routers/openml/estimation_procedure_test.py

Comment thread docs/contributing/tests.md Outdated
Comment on lines +145 to +148
There is one situation where you may need to commit to the database: migration tests.
Since the PHP API communicates to the database in a separate transaction, changes made within the transaction in "Python land" are not visible to PHP.
In this case, be extremely careful! You *must* write the test so that even if things fail unexpectedly, there is no data left behind.
Generally speaking, you want to use a context manager that cleans up after you. In some cases you may need to clean up after yourself during the test.
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.

⚠️ Potential issue | 🟡 Minor

Add the known migration-test limitation for auth failure paths.

This section should mention that some authentication-failure scenarios cannot be asserted through migration tests when the PHP side returns XML instead of JSON, and should be covered in Python unit tests post-migration.

Suggested doc addition
 There is one situation where you may need to commit to the database: migration tests.
 Since the PHP API communicates to the database in a separate transaction, changes made within the transaction in "Python land" are not visible to PHP.
 In this case, be extremely careful! You *must* write the test so that even if things fail unexpectedly, there is no data left behind.
 Generally speaking, you want to use a context manager that cleans up after you. In some cases you may need to clean up after yourself during the test.
+
+Also note: for some legacy endpoints, authentication failure paths are not suitable for migration comparison tests if the PHP API returns XML error payloads. Cover those in Python unit tests once the dependent endpoint is migrated.

Based on learnings: Migration tests for OpenML API endpoints that rely on php_api for data staging cannot test authentication failure paths (Code 103) when the legacy PHP API returns XML instead of JSON; these paths should be tested in standard Python unit tests after dependent endpoints are migrated.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
There is one situation where you may need to commit to the database: migration tests.
Since the PHP API communicates to the database in a separate transaction, changes made within the transaction in "Python land" are not visible to PHP.
In this case, be extremely careful! You *must* write the test so that even if things fail unexpectedly, there is no data left behind.
Generally speaking, you want to use a context manager that cleans up after you. In some cases you may need to clean up after yourself during the test.
There is one situation where you may need to commit to the database: migration tests.
Since the PHP API communicates to the database in a separate transaction, changes made within the transaction in "Python land" are not visible to PHP.
In this case, be extremely careful! You *must* write the test so that even if things fail unexpectedly, there is no data left behind.
Generally speaking, you want to use a context manager that cleans up after you. In some cases you may need to clean up after yourself during the test.
Also note: for some legacy endpoints, authentication failure paths are not suitable for migration comparison tests if the PHP API returns XML error payloads. Cover those in Python unit tests once the dependent endpoint is migrated.
🧰 Tools
🪛 LanguageTool

[style] ~147-~147: As an alternative to the over-used intensifier ‘extremely’, consider replacing this phrase.
Context: ...re not visible to PHP. In this case, be extremely careful! You must write the test so that even...

(EN_WEAK_ADJECTIVE)


[style] ~148-~148: Consider using “who” when you are referring to a person instead of an object.
Context: ...king, you want to use a context manager that cleans up after you. In some cases you ...

(THAT_WHO)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing/tests.md` around lines 145 - 148, Update the "migration
tests" section to document the known limitation: state that migration tests for
OpenML API endpoints that use the PHP API for staging cannot assert certain
authentication-failure paths (specifically Code 103) when the legacy PHP API
returns XML instead of JSON, and add guidance to instead cover those scenarios
in standard Python unit tests after migration; reference the terms "migration
tests", "php_api", "Code 103", and "authentication-failure" so readers can find
and implement the appropriate post-migration Python unit tests.

Comment thread docs/migration.md Outdated
Comment thread docs/migration.md Outdated
@PGijsbers PGijsbers merged commit 621e1c3 into main Apr 16, 2026
9 checks passed
@PGijsbers PGijsbers deleted the update-migration branch April 16, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant