Skip to content

Support XGoPackage marker alongside legacy GopPackage#2474

Merged
xushiwei merged 2 commits intomainfrom
xgopilot/claude/issue-2473-1760329633
Oct 14, 2025
Merged

Support XGoPackage marker alongside legacy GopPackage#2474
xushiwei merged 2 commits intomainfrom
xgopilot/claude/issue-2473-1760329633

Conversation

@xgopilot
Copy link

@xgopilot xgopilot bot commented Oct 13, 2025

Summary

This PR enables XGo packages to use either GopPackage or XGoPackage as the marker constant for enabling XGo-specific transformations (e.g., overload processing).

Changes

  • doc/z_gop.go: Added XGoPackage constant and updated isGopPackage() function to check for both GopPackage and XGoPackage markers
  • cl/outline/outline.go: Updated constant filtering logic to skip both GopPackage and XGoPackage from the outline
  • doc/_testdata/: Added regression test cases for XGoPackage marker:
    • xgoOverloadFn/: Tests function overload with XGoPackage marker
    • xgoOverloadMethod/: Tests method overload with XGoPackage marker

Testing

All existing tests pass, including the new test cases that verify the XGoPackage marker works equivalently to GopPackage:

go test ./doc -v

Backward Compatibility

This change maintains full backward compatibility:

  • Existing packages using GopPackage continue to work without modification
  • New packages can choose to use XGoPackage to align with the XGo branding
  • Both markers are treated identically by the compiler and tooling

Fixes #2473

Generated with codeagent

This change enables XGo packages to use either GopPackage or XGoPackage
as the marker constant for enabling XGo-specific transformations.

Changes:
- Update isGopPackage() to accept both GopPackage and XGoPackage markers
- Update outline builder to filter out both markers from public constants
- Add regression tests for XGoPackage marker

This maintains backward compatibility while aligning with the XGo rebranding.

Fixes #2473

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <[email protected]>
@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.33%. Comparing base (064087b) to head (9d2095d).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2474   +/-   ##
=======================================
  Coverage   93.33%   93.33%           
=======================================
  Files          34       34           
  Lines       11608    11608           
=======================================
  Hits        10834    10834           
  Misses        609      609           
  Partials      165      165           

☔ 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.

@aofei
Copy link
Member

aofei commented Oct 13, 2025

@codex please take a look at this one.

/gemini you too.

@gemini-code-assist
Copy link
Contributor

Thanks for tagging me, @aofei! I've reviewed the changes in this pull request.

The modifications to cl/outline/outline.go and doc/z_gop.go correctly introduce and handle the XGoPackage marker, aligning perfectly with the PR's objective to support it alongside GopPackage. The addition of new test cases in doc/_testdata/xgoOverloadFn and doc/_testdata/xgoOverloadMethod is also a great way to ensure the new functionality works as expected and maintains backward compatibility.

Overall, the changes are clear, concise, and well-tested. This looks good to merge!

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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 👍.

doc/z_gop.go Outdated
xgoPackage = "XGoPackage"
)

func isGopPackage(in *doc.Package) bool {
Copy link
Member

Choose a reason for hiding this comment

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

@xgopilot rename isGopPackage to isXGoPackage

Copy link
Author

@xgopilot xgopilot bot Oct 14, 2025

Choose a reason for hiding this comment

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

✅ Completed: Renamed isGopPackage to isXGoPackage

Successfully renamed the function and all its usages across the codebase:

Files modified:

  • doc/z_gop.go:32 - renamed function definition
  • doc/z_transform.go:251 - renamed function call
  • doc/z_test.go:54-56 - renamed test function TestIsXGoPackage and calls

Verification:

  • ✓ All files formatted with go fmt
  • ✓ All tests pass (6/6 subtests in TestFromTestdata, including TestIsXGoPackage)
  • ✓ Changes committed and pushed to branch

Commit: 9d2095d4


Job Run | Branch: xgopilot/claude/issue-2473-1760329633

- Renamed function definition in doc/z_gop.go
- Updated function call in doc/z_transform.go
- Updated test function and calls in doc/z_test.go

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xushiwei <[email protected]>
@xushiwei xushiwei merged commit 84487b2 into main Oct 14, 2025
29 checks passed
@xushiwei xushiwei deleted the xgopilot/claude/issue-2473-1760329633 branch October 14, 2025 22:56
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.

Support XGoPackage marker alongside legacy GopPackage

4 participants