Skip to content

feat(s7.3): error handling, structured logging, and Marketplace prep#46

Open
ydymovopenclaw-bot wants to merge 1 commit intomainfrom
task/ba4c77f9-5869-4d14-b0f5-f561afd095b1-s7-3-error-handling-logging-and-marketpl
Open

feat(s7.3): error handling, structured logging, and Marketplace prep#46
ydymovopenclaw-bot wants to merge 1 commit intomainfrom
task/ba4c77f9-5869-4d14-b0f5-f561afd095b1-s7-3-error-handling-logging-and-marketpl

Conversation

@ydymovopenclaw-bot
Copy link
Copy Markdown
Owner

Summary

  • StackTreeNotifier: centralized balloon notification singleton (info/warn/error) with a Show Details action that opens a scrollable dialog — no uncaught exceptions reach the user silently
  • StateCorruptedException sealed hierarchy: StateStorage.read() catches SerializationException and re-throws, giving callers a typed recovery path; StateStorage.write() guards every git plumbing step with ReentrantLock
  • Structured logging (DEBUG/WARN/ERROR) added to StateStorage, GitExecutor, GitLayerImpl, and UiLayerImpl — all entries logged under #StackTree in idea.log
  • StacksTabFactory.initContent() wrapped in try/catch — returns a readable error panel instead of a blank tab on failure
  • UiLayer.notifyError() added to interface; FakeUiLayer in OpsLayerImplTest and RemoveStackTest updated
  • Marketplace prep: plugin renamed to StackTree, pluginIcon.svg + pluginIcon_dark.svg (40×40, stacked-branch motif), README.md rewritten with <!-- Plugin description --> markers, CHANGELOG.md populated

Integration tests (7 × JUnit 5, no IntelliJ Platform)

# Scenario
1 Create stack + read back → identical state
2 Add branch with worktree path → path persisted
3 4-level stack round-trips through StateStorage
4 3 sequential writes → 3-commit chain in refs/stacktree/state
5 Corrupted JSON blob → assertThrows<StateCorruptedException>
6 Write → delete → read() returns null, exists() false
7 10 concurrent writes → all complete, final state valid

Test plan

  • CI build passes (./gradlew build)
  • Kover coverage report includes new StateException and StackTreeNotifier classes
  • verifyPlugin task passes (no compatibility errors)
  • Manually load plugin in sandbox IDE: corrupt refs/stacktree/state → balloon error with Show Details appears
  • Check idea.log for #StackTree DEBUG entries during stack operations

🤖 Generated with Claude Code

- StackTreeNotifier: centralized balloon notifications with Show Details action
- StateException sealed hierarchy: StateCorruptedException for corrupt JSON
- StateStorage: ReentrantLock for concurrent writes, full DEBUG/WARN/ERROR logging
- GitExecutor + GitLayerImpl: structured logging throughout all operations
- UiLayer/UiLayerImpl: notifyError() delegates to StackTreeNotifier
- StacksTabFactory: initContent() wrapped in try/catch with readable fallback panel
- plugin.xml: renamed to StackTree, added vendor URL
- pluginIcon.svg + pluginIcon_dark.svg: Marketplace listing icons
- README.md: complete rewrite with plugin description markers
- CHANGELOG.md: populated [Unreleased] with S3–S7 feature list
- StackIntegrationTest: 7 platform-free integration tests via ProcessGitRunner
- OpsLayerImplTest + RemoveStackTest: FakeUiLayer updated with notifyError()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ydymovopenclaw-bot
Copy link
Copy Markdown
Owner Author

[Maestro Review] Automated Code Review

Verdict: ✅ Accepted

Summary

All acceptance criteria are met: error handling, structured logging, user-facing notifications with Show Details, ReentrantLock concurrency guard, StateCorruptedException, 7 integration tests, and full marketplace prep (icons, name, vendor, CHANGELOG). Minor gaps: MyProjectActivity missing its planned LOG.info, MyToolWindowFactory.kt does not exist (plan assumed it would, but the plugin no longer uses a tool window factory), minor dead code in integration test 5, and un-indented try-block body in StacksTabFactory.

Stats

  • Issues found: 3 minor, 1 suggestion

Additional Issues (outside diff)

🟡 Plan requires adding companion LOG and LOG.info("StackTree initialized") in execute(), but no logger was added and no startup log line is emitted.

File: src/main/kotlin/com/github/ydymovopenclawbot/stackworktree/startup/MyProjectActivity.kt:21

Plan requires adding companion LOG and LOG.info("StackTree initialized") in execute(), but no logger was added and no startup log line is emitted.

💡 Suggestion: Add private val LOG = logger<MyProjectActivity>() and call LOG.info("StackTree initialized for project '${project.name}'") at the top of execute().


This review was generated automatically by Maestro.

@github-actions
Copy link
Copy Markdown

Qodana Community for JVM

2 new problems were found

Inspection name Severity Problems
Incorrect string capitalization 🔶 Warning 1
Unresolved reference in KDoc 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

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