Skip to content

fix(plugins): register compiled-in plugins as pointers - #9326

Open
ahnazary wants to merge 1 commit into
apache:mainfrom
ahnazary:fix/register-plugins-as-pointers
Open

ahnazary wants to merge 1 commit into
apache:mainfrom
ahnazary:fix/register-plugins-as-pointers

Conversation

@ahnazary

@ahnazary ahnazary commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

tools/pluginsgen registers compiled-in plugins by value (plugin.MustRegister(org.Org{})). Methods declared on pointer receivers are not in a value's method set, so org (whose Init and ApiResources are on *Org) is never initialised and gets no routes. Since v1.0.3-beta19 every /plugins/org/* endpoint (teams.csv, users.csv, user_account_mapping.csv, ...) returns 404.

Shared-object loading always registered a pointer (plugin.Lookup("PluginEntry") returns *T), so registering &T{} restores the pre-#9288 behaviour for every plugin.

Changes

  • tools/pluginsgen: emit plugin.MustRegister(&pkg.Type{})
  • plugins/all/all.go: regenerated

Does this close any open issues?

Closes #9327. Regression from #9288.

🤖 Generated with Claude Code

@ahnazary
ahnazary marked this pull request as ready for review November 4, 2026 12:12
Copilot AI balanced review requested due to automatic review settings November 4, 2026 12:12

Copilot AI 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.

🟡 Changes recommended

The new test incorrectly fails for supported plugin configurations that omit org and needs to skip the org-specific check when that plugin is not compiled in.

1 open issue
1 file not reviewed
  • backend/plugins/all/all.go: Generated file
What changed in this PR

Restores pointer-receiver methods for compiled-in DevLake plugins, addressing missing org initialization and routes introduced by #9288.

Changes:

  • Updates the generator to register plugin pointers instead of values.
  • Regenerates all 47 compiled-in plugin registrations.
  • Adds a regression test checking that registered org implements PluginApi and PluginInit.
File Description
backend/​tools/​pluginsgen/​main.go Generates pointer-based registrations.
backend/​plugins/​all/​all.go Registers all compiled-in plugins as pointers.
backend/​plugins/​all/​all_test.go Checks preservation of org pointer-receiver interfaces.

Review effort: Balanced

Comment thread backend/plugins/all/all_test.go Resolved
The generated registry registered plugins by value, so methods declared on
pointer receivers were dropped from the method set. org declares Init and
ApiResources on *Org, so in v1.0.3-beta19 it is never initialised and every
/plugins/org/* route returns 404. Shared-object loading always registered a
pointer (plugin.Lookup returns *T), so this restores that behaviour.

Closes apache#9327

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ahnazary
ahnazary force-pushed the fix/register-plugins-as-pointers branch from a475db0 to 9a01288 Compare November 4, 2026 12:23
@ahnazary ahnazary closed this Nov 4, 2026
@ahnazary ahnazary reopened this Nov 4, 2026
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.

[Bug][org] All /plugins/org/* endpoints return 404 since v1.0.3-beta19

2 participants