Skip to content

fix: sync runtime file system mutations - #123

Merged
TharmiganK merged 2 commits into
ballerina-nutcracker:mainfrom
snelusha:fix/fs-mutations
Aug 12, 2026
Merged

TharmiganK merged 2 commits into
ballerina-nutcracker:mainfrom
snelusha:fix/fs-mutations

Conversation

@snelusha

@snelusha snelusha commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Resolves #120

Summary by CodeRabbit

  • New Features

    • Generated files created while running programs now appear in the file explorer automatically.
    • File changes are synchronized after program execution completes.
    • Synchronization errors are reported in runtime output.
  • Tests

    • Added coverage confirming generated directories and files are visible in the sidebar after execution.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 19faaa6f-1b6e-4053-a9b9-8d11fc4df80c

📥 Commits

Reviewing files that changed from the base of the PR and between c201980 and ddd0ec5.

📒 Files selected for processing (3)
  • apps/web/src/providers/ballerina-provider.tsx
  • e2e/fixtures/write-file.bal
  • e2e/tests/runtime-files.spec.ts

📝 Walkthrough

Walkthrough

The runtime execution flow now synchronizes generated file mutations with the file-tree store. An end-to-end test verifies that a generated file appears in the playground sidebar.

Changes

Runtime file synchronization

Layer / File(s) Summary
Queue runtime mutations
apps/web/src/providers/ballerina-provider.tsx
run subscribes to snapshot mutations, applies them serially through useFileTreeStore, reports synchronization failures through stderr, and waits for pending updates after execution.
Validate generated file visibility
e2e/fixtures/write-file.bal, e2e/tests/runtime-files.spec.ts
The fixture writes generated/runtime-file.txt. The Playwright test verifies the generated directory and file in the sidebar.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runtime
  participant BallerinaProvider
  participant FileTreeStore
  participant Sidebar
  Runtime->>BallerinaProvider: Emit file snapshot mutation
  BallerinaProvider->>FileTreeStore: Serialize and apply mutation
  FileTreeStore->>Sidebar: Update generated files
  BallerinaProvider->>Runtime: Await queued synchronization
Loading

Possibly related PRs

Suggested reviewers: warunalakshitha

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only includes the Purpose section and omits most required sections, including Goals, Approach, testing, security, documentation, and release details. Complete the required template sections, especially Goals, Approach, Automation tests, Security checks, Documentation, Release note, and Test environment.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes synchronization of runtime file system mutations, which is the main change.
Linked Issues check ✅ Passed The provider now synchronizes runtime file mutations, and the end-to-end test verifies that generated files appear in the playground sidebar, addressing issue #120.
Out of Scope Changes check ✅ Passed The provider change, runtime fixture, and end-to-end test are directly related to displaying files generated during runtime execution.
✨ 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.

@snelusha

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

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

LGTM

@TharmiganK
TharmiganK merged commit 1c7be7f into ballerina-nutcracker:main Aug 12, 2026
2 checks passed
@snelusha
snelusha deleted the fix/fs-mutations branch August 12, 2026 04:40
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.

The files generated from Ballerina code in the playground does not show up in the side panel

2 participants