Skip to content

feat: support loading config from explicit path#78

Merged
chenjiahan merged 6 commits into
mainfrom
chenjiahan/feat-load-explicit-config-path
Jul 26, 2026
Merged

feat: support loading config from explicit path#78
chenjiahan merged 6 commits into
mainfrom
chenjiahan/feat-load-explicit-config-path

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

Rstack config consumers need to load a known rstack.config.* file without relying on CLI-global state. This PR adds a configFilePath option to loadRstackConfig, delegates relative-path resolution to @rstackjs/load-config, and preserves the existing CLI-state and default-discovery fallbacks. It covers explicit-path precedence and config-state cleanup.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: f14ea2c
Status:⚡️  Build in progress...

View logs

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

loadRstackConfig now accepts an optional explicit configuration file path, preferring it over the legacy state path and otherwise retaining filename discovery. New fixtures and tests verify explicit loading, dependency resolution, missing-file errors, state cleanup after success or failure, and fresh-loading behavior. Shared test cleanup now resets configuration state and the fresh-load counter after each test.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title accurately summarizes the main change: loading config from an explicit path.
Description check ✅ Passed The description matches the changeset and explains the new explicit-path loading behavior and preserved fallbacks.
✨ 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 chenjiahan/feat-load-explicit-config-path

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@packages/rstack/src/config.ts`:
- Around line 29-32: The documentation comment for configFilePath should
describe the actual fallback precedence: when the option is omitted, use the
CLI-provided state.configPath first, and perform default config-file discovery
only when that state path is unset. Update the wording near configFilePath
without changing implementation behavior.
🪄 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 Plus

Run ID: 9ddd99ad-9c1d-46fb-be19-d0f8a14022ba

📥 Commits

Reviewing files that changed from the base of the PR and between bf15b96 and f83b47e.

📒 Files selected for processing (5)
  • packages/rstack/src/config.ts
  • packages/rstack/tests/config/load-state/explicit-dependency.ts
  • packages/rstack/tests/config/load-state/explicit.config.ts
  • packages/rstack/tests/config/load-state/fresh.config.ts
  • packages/rstack/tests/config/load-state/index.test.ts

Comment thread packages/rstack/src/config.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f83b47e3da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rstack/src/config.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dad79428e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rstack/src/config.ts
@chenjiahan
chenjiahan merged commit a8c34ef into main Jul 26, 2026
3 of 4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/feat-load-explicit-config-path branch July 26, 2026 09:22
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