Skip to content

refactor(spider-storage)!: Remove the redundant _config suffix from RuntimeConfig's fields. - #433

Merged
LinZhihao-723 merged 7 commits into
y-scope:mainfrom
LinZhihao-723:config-rename
Aug 11, 2026
Merged

refactor(spider-storage)!: Remove the redundant _config suffix from RuntimeConfig's fields.#433
LinZhihao-723 merged 7 commits into
y-scope:mainfrom
LinZhihao-723:config-rename

Conversation

@LinZhihao-723

@LinZhihao-723 LinZhihao-723 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Description

Every field in spider-storage's RuntimeConfig carries a _config suffix. The suffix is redundant: the struct is already named RuntimeConfig, each field's type is already a *Config, and the fields are reached as config.db_config, config.ready_queue_config, and so on. The suffix also leaks into the YAML configuration schema, making the keys under runtime: needlessly verbose.

This PR drops the suffix from all four fields:

Before After
db_config db
ready_queue_config ready_queue
task_instance_pool_config task_instance_pool
job_cache_gc_config job_cache_gc

Since these fields are deserialized from storage.yaml, the configuration keys change accordingly:

runtime:
  db:
    host: "spider-database"
    max_connections: 64
    name: "spider-db"
    port: 3306
  ready_queue:
    cleanup_capacity: 256
    commit_capacity: 256
    task_capacity: 1048576

The Helm chart is updated in lockstep: templates/configmap.yaml renders db: instead of db_config:, and values.yaml exposes spiderConfig.storage.runtime.ready_queue instead of ready_queue_config. The chart version is bumped to satisfy the chart linting workflow.

Existing storage configuration files must rename these four keys. This applies to custom Helm values as well: the chart passes spiderConfig.storage.runtime through with toYaml, so a stale ready_queue_config (or any other old key) in a user's overrides lands in the rendered config and is rejected by Serde when the storage server starts.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Ensure all workflows pass.

Summary by CodeRabbit

  • Breaking Changes

    • Updated storage runtime configuration names for database, ready queue, task instance pool, and job cache settings.
    • Deployment configurations must use the updated key names to ensure runtime settings continue to load correctly.
  • Deployment

    • Updated the Helm chart version to 0.1.10.
    • Aligned Helm defaults and generated configuration with the revised runtime setting names.
  • Bug Fixes

    • Updated runtime recovery configuration to remain compatible with the renamed settings.

@LinZhihao-723
LinZhihao-723 requested review from a team and sitaowang1998 as code owners August 7, 2026 21:10
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

RuntimeConfig fields now omit the _config suffix. Runtime creation, recovery tests, and Helm configuration use the renamed fields. The Helm chart version increases from 0.1.9 to 0.1.10.

Changes

Runtime configuration field rename

Layer / File(s) Summary
RuntimeConfig contract and wiring
components/spider-storage/src/state/runtime.rs, components/spider-storage/tests/runtime_recovery_test.rs
Renames the public RuntimeConfig fields and updates runtime creation and recovery test construction.
Helm configuration alignment
tools/deployment/spider-helm/Chart.yaml, tools/deployment/spider-helm/templates/configmap.yaml, tools/deployment/spider-helm/values.yaml
Renames the Helm database and ready-queue keys. Updates the chart version to 0.1.10.

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

Possibly related PRs

  • y-scope/spider#434: Shares the same RuntimeConfig field renames and Helm configuration updates.
  • y-scope/spider#435: Modifies the same runtime and Helm configuration areas with related queue field renames.

Suggested reviewers: sitaowang1998

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the redundant _config suffix from RuntimeConfig fields.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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

Instead of changing the variable name, how about changing the serialization name?

@LinZhihao-723

Copy link
Copy Markdown
Member Author

Instead of changing the variable name, how about changing the serialization name?

By looking at the diff I don't really see a benefit of doing that.

@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)
components/spider-storage/tests/runtime_recovery_test.rs (1)

204-207: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add coverage for the renamed configuration keys.

This helper only constructs RuntimeConfig in Rust. It does not verify that db, ready_queue, task_instance_pool, and job_cache_gc are accepted from the storage YAML path.

Add a focused deserialisation fixture or test for the rendered configuration. Include a migration test if legacy keys must remain supported.

🤖 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 `@components/spider-storage/tests/runtime_recovery_test.rs` around lines 204 -
207, Add focused YAML deserialization coverage for the renamed RuntimeConfig
fields db, ready_queue, task_instance_pool, and job_cache_gc, rather than only
constructing them directly in Rust. Verify the rendered storage configuration
accepts the new keys, and add a migration test for legacy key support if that
compatibility is required.
🤖 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 `@components/spider-storage/tests/runtime_recovery_test.rs`:
- Around line 204-207: Add focused YAML deserialization coverage for the renamed
RuntimeConfig fields db, ready_queue, task_instance_pool, and job_cache_gc,
rather than only constructing them directly in Rust. Verify the rendered storage
configuration accepts the new keys, and add a migration test for legacy key
support if that compatibility is required.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eee1b9ee-eb10-4a2c-83d2-3cb1f03029bc

📥 Commits

Reviewing files that changed from the base of the PR and between 6b966ba and d30baf9.

📒 Files selected for processing (5)
  • components/spider-storage/src/state/runtime.rs
  • components/spider-storage/tests/runtime_recovery_test.rs
  • tools/deployment/spider-helm/Chart.yaml
  • tools/deployment/spider-helm/templates/configmap.yaml
  • tools/deployment/spider-helm/values.yaml

@LinZhihao-723
LinZhihao-723 merged commit a2e8c9c into y-scope:main Aug 11, 2026
18 checks passed
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.

2 participants