Skip to content

reorganize: consolidate demo directories#1283

Merged
xushiwei merged 1 commit intogoplus:mainfrom
cpunion:reorganize-demos
Sep 14, 2025
Merged

reorganize: consolidate demo directories#1283
xushiwei merged 1 commit intogoplus:mainfrom
cpunion:reorganize-demos

Conversation

@cpunion
Copy link
Collaborator

@cpunion cpunion commented Sep 9, 2025

Impl #1256

  • Consolidate _demo, _pydemo, _embdemo into single _demo directory structure
  • Organize demos by language: _demo/{go,py,c,embed}/
  • Categorize demos based on imports:
    • Python library demos (py imports) → _demo/py/
    • C/C++ library demos (c/cpp imports) → _demo/c/
    • Go-specific demos → _demo/go/
    • Embedded demos → _demo/embed/
  • Move C-related demos (asm*, cabi*, cgo*, linkname, targetsbuild) from to _demo/c/
  • Update all path references in README.md and GitHub workflows

🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.16%. Comparing base (849b230) to head (64df39b).
⚠️ Report is 56 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1283   +/-   ##
=======================================
  Coverage   90.16%   90.16%           
=======================================
  Files          42       42           
  Lines       11786    11786           
=======================================
  Hits        10627    10627           
  Misses       1026     1026           
  Partials      133      133           

☔ View full report in Codecov by Sentry.
📢 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.

- Consolidate _demo, _pydemo, _embdemo into single _demo directory structure
- Organize demos by language: _demo/{go,py,c,embed}/
- Categorize demos based on imports:
- Python library demos (py imports) → _demo/py/
- C/C++ library demos (c/cpp imports) → _demo/c/
- Go-specific demos → _demo/go/
- Embedded demos → _demo/embed/
- Move C-related demos (asm*, cabi*, cgo*, linkname, targetsbuild) from go/ to c/
- Update all path references in README.md and GitHub workflows
- Improve demo organization and navigation as requested in #1256

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@cpunion
Copy link
Collaborator Author

cpunion commented Sep 9, 2025

/review

@niupilot
Copy link

niupilot bot commented Sep 9, 2025

Code Review Progress

  • Analyze the PR context and reorganization structure
  • Review workflow file changes (.github/workflows/*)
  • Review README.md path updates
  • Check demo file relocations and any code changes
  • Verify consistency of path references across all files
  • Provide comprehensive review feedback

Review Summary ✅

This PR successfully implements the demo directory reorganization described in issue #1256. The changes are well-structured and consistent across all affected files.

What Was Done Well ✅

  1. Clean Directory Structure: The new organization by language (_demo/{c,py,go,embed}/) creates a logical separation that improves navigation and maintainability.

  2. Consistent Path Updates: All references have been properly updated:

    • Workflow files: .github/workflows/llgo.yml, targets.yml, and test_demo.sh correctly reference new paths
    • README.md: All demo links updated from _demo/foo/ to _demo/c/foo/ pattern
    • Import paths: Demo modules correctly updated their internal imports (e.g., _demo/cgofull/pymod1_demo/c/cgofull/pymod1)
  3. Build System Integration: The test script test_demo.sh:8 properly searches the new directory structure: ./_demo/go/* ./_demo/py/* ./_demo/c/*

  4. CI/CD Compatibility: Workflow changes maintain functionality:

    • llgo.yml:25,57,66,107,281: Model downloads and artifact paths updated to _demo/c/llama2-c/
    • targets.yml:46: Correctly references _demo/embed/targetsbuild

Categorization Logic ✅

The categorization follows a sensible pattern based on library dependencies:

  • C demos_demo/c/: All C/C++ interop demos (cgo*, asm*, cabi*, cpp*, etc.)
  • Python demos_demo/py/: Python library integration demos
  • Go demos_demo/go/: Pure Go or Go standard library demos
  • Embedded demos_demo/embed/: ESP32 and embedded target demos

Technical Verification ✅

  • File moves: All 100% renames with R100 status - no content corruption
  • Import path consistency: Internal module references properly updated (e.g., cgofull.go:109-110)
  • No broken references: Comprehensive path update across documentation and build files
  • Test coverage: Script updates ensure all new directories are tested

Minor Observations

  • The PR size (30 files, +31/-31 lines) indicates this was primarily a move operation with minimal content changes
  • All critical paths in workflows, tests, and documentation have been updated appropriately

Recommendation: APPROVE

This is a well-executed refactoring that improves code organization without introducing any functional regressions. The systematic approach to updating all references demonstrates careful attention to detail.


👉 Want me to re-run this review? Just type /review in the comments! For more usage examples, visit CodeAgent GitHub Repository.

@xushiwei xushiwei merged commit 17dfdd3 into goplus:main Sep 14, 2025
43 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