Pre-submission checklist
Description
The plugin docs (Database Migrations → "Optional Capabilities") tell plugins to implement migrations like this:
import (
"src.techknowlogick.com/xormigrate"
"xorm.io/xorm"
)
func (p *MyPlugin) Migrations() []*xormigrate.Migration {
return []*xormigrate.Migration{{
ID: "20240101000000-create-plugin-table",
Migrate: func(tx *xorm.Engine) error { return tx.Sync2(new(PluginData)) },
}}
}
This doesn't work under the yaegi loader. Neither xorm nor xormigrate is registered in the symbol table (pkg/yaegi_symbols/), which exposes only db, events, log, models, plugins, user, echo/v5, watermill/message. A plugin importing either fails to load at the import itself (verified against vikunja/vikunja:2.5, yaegi loader):
package main
import (
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/plugins"
"src.techknowlogick.com/xormigrate"
"xorm.io/xorm"
)
type P struct{}
func (p *P) Name() string { return "repro-migration" }
func (p *P) Version() string { return "0.0.1" }
func (p *P) Init() error { return nil }
func (p *P) Shutdown() error { return nil }
func (p *P) Migrations() []*xormigrate.Migration {
return []*xormigrate.Migration{{
ID: "20260101000000-repro",
Migrate: func(tx *xorm.Engine) error { return tx.Sync2(new(struct{ ID int64 `xorm:"pk autoincr"` })) },
}}
}
func NewPlugin() plugins.Plugin { return &P{} }
func NewMigrationPlugin() plugins.MigrationPlugin { return &P{} }
level=ERROR msg="Failed to load yaegi plugin custom-fields: evaluating main.go: 7:2: import \"src.techknowlogick.com/xormigrate\" error: unable to find source related to: \"src.techknowlogick.com/xormigrate\". Either the GOPATH environment variable, or the Interpreter.Options.GoPath needs to be set"
The loader stops at the first unresolvable import (xormigrate here; xorm would fail identically). A minimal plugin using only the registered packages loads cleanly against the same instance.
The runtime wiring for plugin migrations exists and runs (MigrationPlugin, NewMigrationPlugin(), pkg/plugins/manager.go → migration.AddPluginMigrations → Migrate), but it's unreachable under yaegi because a plugin can't import the package that defines *xormigrate.Migration.
Vikunja Version
2.5.0
Browser and version
No response
Can you reproduce the bug on the Vikunja demo site?
No
Screenshots
No response
Pre-submission checklist
Description
The plugin docs (Database Migrations → "Optional Capabilities") tell plugins to implement migrations like this:
This doesn't work under the yaegi loader. Neither
xormnorxormigrateis registered in the symbol table (pkg/yaegi_symbols/), which exposes onlydb,events,log,models,plugins,user,echo/v5,watermill/message. A plugin importing either fails to load at the import itself (verified againstvikunja/vikunja:2.5, yaegi loader):The loader stops at the first unresolvable import (
xormigratehere;xormwould fail identically). A minimal plugin using only the registered packages loads cleanly against the same instance.The runtime wiring for plugin migrations exists and runs (
MigrationPlugin,NewMigrationPlugin(),pkg/plugins/manager.go→migration.AddPluginMigrations→Migrate), but it's unreachable under yaegi because a plugin can't import the package that defines*xormigrate.Migration.Vikunja Version
2.5.0
Browser and version
No response
Can you reproduce the bug on the Vikunja demo site?
No
Screenshots
No response