コンテンツにスキップ

2026-04 WordPress Plugin Sentry Surface 要件

背景

WordPress 側の Sentry は runtime/browser 送信自体は入っているが、監視対象が WordPress 全体として曖昧で、自作 plugin の配備差分と結びつきにくい。

本 repo で保守対象なのは WordPress core ではなく apps/wordpress-cms/plugins/ritsubi-ec-plugin であるため、Sentry 上でも custom plugin を独立 surface として扱う

要件

  1. WordPress の Sentry surface は「WordPress 全体」ではなく ritsubi-ec-plugin を正本にする。
  2. plugin version の正本は plugin header (Version:) とする。
  3. PHP runtime event / browser event の双方に、少なくとも以下を付与する。
  4. wp_plugin_slug
  5. wp_plugin_version
  6. ritsubi_plugin context
  7. release は以下の優先順で解決する。
  8. WORDPRESS_PLUGIN_SENTRY_RELEASE
  9. SENTRY_RELEASE
  10. ritsubi-ec-plugin@<plugin-version>
  11. packaging / workflow で再利用できるよう、plugin header から slug/version/release を解決する script を checked-in する。
  12. VPS deploy recipe は plugin release を自動解決し、WordPress 側 option 同期と Sentry deploy marker に同じ release を使う。
  13. plugin package workflow は zip artifact と同時に WORDPRESS_PLUGIN_SENTRY_RELEASE を解決し、配布物と監視面の release 名を揃える。

非要件

  • 今回は WordPress core / theme を release 対象にしない
  • 今回は plugin 用 sourcemap upload を必須化しない

受け入れ条件

  1. includes/sentry.php が plugin header version を client version / tag / context / release fallback に利用する。
  2. browser / PHP の Sentry event が cms_surface=wordpress-plugin を持つ。
  3. scripts/ops/wordpress-plugin-release.mjs で plugin metadata を解決できる。
  4. just wp-deploy-vpsWORDPRESS_PLUGIN_SENTRY_RELEASE / WORDPRESS_PLUGIN_SENTRY_ENVIRONMENT を自動注入する。
  5. deploy 成功時、必要な Sentry credentials があれば WordPress plugin deploy marker を作成する。
  6. .github/workflows/package-wordpress-plugin.yml が plugin zip artifact と release metadata を同時に出力する。