Skip to content

Fix: go restful api tests - #17247

Merged
wangq8 merged 11 commits into
infiniflow:mainfrom
Lynn-Inf:fix/go-restful-api-tests
Jul 22, 2026
Merged

wangq8 merged 11 commits into
infiniflow:mainfrom
Lynn-Inf:fix/go-restful-api-tests

Conversation

@Lynn-Inf

Copy link
Copy Markdown
Contributor

Summary

Align create_memory go api to python api.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 22, 2026
@Lynn-Inf
Lynn-Inf requested a review from wangq8 July 22, 2026 08:59
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Memory name validation now rejects whitespace-only input, reports updated errors, classifies additional validation failures as argument errors, and enables related REST tests for Go proxy runs with updated payload identifiers.

Changes

Memory name validation

Layer / File(s) Summary
Memory name validation flow
internal/common/app_name.go, internal/handler/memory.go
Whitespace-only names are rejected, the empty-name message is updated, and additional name errors are recognized as argument errors.
REST validation coverage
test/testcases/restful_api/conftest.py, test/testcases/restful_api/test_memory_messages.py, test/testcases/restful_api/test_memories_messages.py
Five memory and message tests are no longer skipped for Go proxy runs, and memory payload identifiers are updated.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checks each name with care,
No empty fluff slips through the air.
Errors hop into the right lane,
Go tests wake from skips again.
New IDs sparkle in the tray—
“Validated!” squeaks the hare today.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is related to the change, but it is broad and doesn’t clearly highlight the main API validation alignment.
Description check ✅ Passed The description matches the required Summary section and states the main goal clearly, though it is brief.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@Lynn-Inf Lynn-Inf added the ci Continue Integration label Jul 22, 2026

@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 `@test/testcases/restful_api/conftest.py`:
- Line 68: Remove the commented-out "test_memory_update_invalid_name" entry from
the skip-list configuration in conftest.py, leaving active entries unchanged.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8302799-376e-4d75-8903-333e2e8c36c4

📥 Commits

Reviewing files that changed from the base of the PR and between 21e5f00 and 3045597.

📒 Files selected for processing (4)
  • internal/common/app_name.go
  • internal/handler/memory.go
  • test/testcases/restful_api/conftest.py
  • test/testcases/restful_api/test_memory_messages.py

Comment thread test/testcases/restful_api/conftest.py Resolved

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

Overall looks good — the TrimSpace change in CreateMemory correctly aligns Go with Python behavior, and the added argument error prefixes ensure proper error code classification.

A few notes:

  1. conftest.py: Commenting out tests with # instead of using @pytest.mark.skip(reason="...") makes them invisible to the test runner. Consider using @pytest.mark.skip or @pytest.mark.xfail so they still appear in the test report as skipped rather than silently vanishing.

  2. Model IDs in tests: The change from @Builtin → @Local@Builtin and @ZHIPU-AI → @CI@ZHIPU-AI assumes Local and CI instance names exist in all test environments. Are these always present, or could this break CI/Docker test setups?

  3. isArgumentError: The new prefix "name length is" is intentionally broad — it will match any name-length error. Is this prefix also used by ValidateName? I see the error format is "name length is %d which is large than %d" — which contains a typo in "large" (should be "larger"). Not introduced by this PR, but worth a follow-up fix.

@wangq8
wangq8 merged commit 32ddf59 into infiniflow:main Jul 22, 2026
5 checks passed
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (6a85d1c) to head (c30b96a).
⚠️ Report is 56 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17247      +/-   ##
==========================================
- Coverage   94.56%   90.65%   -3.91%     
==========================================
  Files          10       10              
  Lines         717      717              
  Branches      118      118              
==========================================
- Hits          678      650      -28     
- Misses         25       39      +14     
- Partials       14       28      +14     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot mentioned this pull request Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants