Skip to content

fix: filter not wanted plugins changes#361

Merged
raven-wing merged 6 commits into
Problematy:mainfrom
raven-wing:goodmap_plugin
Jun 14, 2026
Merged

fix: filter not wanted plugins changes#361
raven-wing merged 6 commits into
Problematy:mainfrom
raven-wing:goodmap_plugin

Conversation

@raven-wing

@raven-wing raven-wing commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Updated plugin discovery to use the revised entry-point group for loading plugins.
    • Automatically aggregates shortcode definitions from content-transforming plugins and passes them into page rendering.
  • Chores
    • Re-exported GoodmapPluginBase at the package top level.
    • Updated the platzky dependency version.
  • Tests
    • Added a unit test ensuring shortcodes from content-transforming plugins are collected and provided to page rendering.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@raven-wing, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 31 minutes and 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1c2e56d3-9838-4aef-b743-992d86138aaf

📥 Commits

Reviewing files that changed from the base of the PR and between 07fe043 and 340716d.

📒 Files selected for processing (1)
  • goodmap/goodmap.py
📝 Walkthrough

Walkthrough

Adds GoodmapPluginBase and re-exports it from the package, switches plugin discovery to the goodmap.plugins group, collects shortcodes from ContentTransformerPluginBase instances during app setup, and includes a unit test and platzky version bump.

Changes

Plugin System Updates

Layer / File(s) Summary
Plugin base class definition and export
goodmap/plugin.py, goodmap/__init__.py
New GoodmapPluginBase subclass of PluginBase is defined and exported at package level.
Plugin discovery configuration and dependencies
goodmap/goodmap.py, pyproject.toml
Plugin entry-point group changed to goodmap.plugins; ContentTransformerPluginBase import added for plugin filtering; platzky dependency bumped to 2.0.0a3.
Shortcode aggregation from transformer plugins
goodmap/goodmap.py, tests/unit_tests/test_goodmap.py
During app setup shortcodes are collected by iterating app.loaded_plugins, selecting ContentTransformerPluginBase instances, and merging their plugin.shortcodes into a dict passed to core_pages; new unit test verifies collection behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A tiny class hops into place,
Plugins find their new namespace,
Transformers share their shortcode keys,
Manifest gathers all with ease,
Hooray — the map now maps with grace!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'filter not wanted plugins changes' is vague and does not clearly convey the main technical changes in the PR. The changeset includes refactoring plugin entry points, implementing a new plugin base class, updating shortcode collection logic, and upgrading a dependency. Use a more descriptive title that clarifies the main purpose, such as 'Refactor plugin system to collect shortcodes from ContentTransformerPluginBase plugins' or 'Switch plugin entry point group and filter shortcode collection'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/unit_tests/test_goodmap.py (1)

166-171: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update manifest module assertion to match current plugin contract.

This test still expects "./Button", but the app now emits "./Plugin", so the assertion is stale.

Suggested fix
-            "module": "./Button",
+            "module": "./Plugin",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit_tests/test_goodmap.py` around lines 166 - 171, The test assertion
for app.config["PLUGIN_MANIFEST"] is stale: update the expected manifest entry's
"module" value from "./Button" to the current contract "./Plugin" so the
assertion matches the emitted manifest; locate the assertion in
tests/unit_tests/test_goodmap.py that compares app.config["PLUGIN_MANIFEST"] and
change the module field in that expected dict to "./Plugin".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/unit_tests/test_goodmap.py`:
- Around line 166-171: The test assertion for app.config["PLUGIN_MANIFEST"] is
stale: update the expected manifest entry's "module" value from "./Button" to
the current contract "./Plugin" so the assertion matches the emitted manifest;
locate the assertion in tests/unit_tests/test_goodmap.py that compares
app.config["PLUGIN_MANIFEST"] and change the module field in that expected dict
to "./Plugin".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31467e5f-8bd2-402a-bf11-5bb52e1e49e0

📥 Commits

Reviewing files that changed from the base of the PR and between 537693f and 8230fe3.

📒 Files selected for processing (4)
  • goodmap/__init__.py
  • goodmap/goodmap.py
  • goodmap/plugin.py
  • tests/unit_tests/test_goodmap.py

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/unit_tests/test_goodmap.py (1)

166-171: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update stale manifest module expectation to match runtime output.

Line 170 still asserts "./Button", but goodmap/goodmap.py now emits "./Plugin" at Line 70. This makes the test contract inconsistent with current behavior.

Suggested patch
     assert app.config["PLUGIN_MANIFEST"] == [
         {
             "scope": "my_plugin",
             "url": "/plugins/my_plugin/static/remoteEntry.js",
-            "module": "./Button",
+            "module": "./Plugin",
         }
     ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit_tests/test_goodmap.py` around lines 166 - 171, The test asserts
app.config["PLUGIN_MANIFEST"] contains a module "./Button" but the runtime
(goodmap.py) now emits "./Plugin"; update the expected manifest entry in the
test assertion to use "module": "./Plugin" so the test matches actual output
(locate the assertion comparing app.config["PLUGIN_MANIFEST"] in the test and
replace "./Button" with "./Plugin").
🧹 Nitpick comments (1)
tests/unit_tests/test_goodmap.py (1)

294-307: ⚡ Quick win

Strengthen regression coverage by making one plugin explicitly non-field.

The new test currently gives both plugins ALL_CONTENT_TYPES, so it won’t fail if field-only filtering is accidentally reintroduced later. Make one plugin omit "field" to assert the intended behavior change.

Suggested patch
                 {
                     "name": "post_plugin",
                     "config": {},
-                    "allowed_content_types": list(ALL_CONTENT_TYPES),
+                    "allowed_content_types": [
+                        ct for ct in ALL_CONTENT_TYPES if ct != "field"
+                    ],
                     "allowed_topics": ["general", "content", "security"],
                 },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit_tests/test_goodmap.py` around lines 294 - 307, The test currently
gives both plugins ALL_CONTENT_TYPES; update the plugin definitions created via
_make_test_app_config so one plugin is explicitly non-field by removing "field"
from its allowed_content_types (e.g., keep "field_plugin" as-is and change
"post_plugin" to use allowed_content_types that exclude "field", e.g.
list(ALL_CONTENT_TYPES - {"field"}) or an explicit list without "field") so the
test will catch regressions that reintroduce field-only filtering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/unit_tests/test_goodmap.py`:
- Around line 166-171: The test asserts app.config["PLUGIN_MANIFEST"] contains a
module "./Button" but the runtime (goodmap.py) now emits "./Plugin"; update the
expected manifest entry in the test assertion to use "module": "./Plugin" so the
test matches actual output (locate the assertion comparing
app.config["PLUGIN_MANIFEST"] in the test and replace "./Button" with
"./Plugin").

---

Nitpick comments:
In `@tests/unit_tests/test_goodmap.py`:
- Around line 294-307: The test currently gives both plugins ALL_CONTENT_TYPES;
update the plugin definitions created via _make_test_app_config so one plugin is
explicitly non-field by removing "field" from its allowed_content_types (e.g.,
keep "field_plugin" as-is and change "post_plugin" to use allowed_content_types
that exclude "field", e.g. list(ALL_CONTENT_TYPES - {"field"}) or an explicit
list without "field") so the test will catch regressions that reintroduce
field-only filtering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f3896c2d-503c-464b-a789-aca8da6cfe71

📥 Commits

Reviewing files that changed from the base of the PR and between 8230fe3 and 951e52a.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • goodmap/goodmap.py
  • pyproject.toml
  • tests/unit_tests/test_goodmap.py
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml

@github-actions

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: 69824fd

⚠️ E2E Stress Test Results

Performance data not found. See workflow logs for details.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
goodmap/goodmap.py (1)

30-30: ⚠️ Potential issue | 🟠 Major

Update documentation to reflect plugin entry-point group change from platzky.plugins to goodmap.plugins.

The code now uses goodmap.plugins as the plugin discovery group, but docs/plugins.rst still references the old platzky.plugins group. This inconsistency will mislead plugin developers. Update the documentation to consistently refer to goodmap.plugins throughout.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@goodmap/goodmap.py` at line 30, The _PLUGIN_ENTRY_POINT_GROUP constant in
goodmap.py has been updated to use "goodmap.plugins", but the documentation in
docs/plugins.rst still references the old "platzky.plugins" entry point group.
Update all references to the plugin entry point group in docs/plugins.rst to use
"goodmap.plugins" instead of "platzky.plugins" to maintain consistency with the
code change and prevent misleading plugin developers.
🧹 Nitpick comments (1)
goodmap/goodmap.py (1)

171-171: 💤 Low value

Tighten the type annotation for shortcodes.

The type annotation dict[str, Any] is too broad. Based on the test context showing shortcodes: ClassVar[dict[str, Shortcode]], a more precise type would improve type safety.

♻️ Proposed fix to use a more specific type
+from platzky.shortcodes import Shortcode
+
-    shortcodes: dict[str, Any] = {}
+    shortcodes: dict[str, Shortcode] = {}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@goodmap/goodmap.py` at line 171, The shortcodes variable is currently typed
as dict[str, Any] which is too broad and reduces type safety. Change the type
annotation for the shortcodes variable to dict[str, Shortcode] to provide a more
precise type that accurately reflects the values stored in the dictionary, based
on the test context showing the expected structure of this class variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@goodmap/goodmap.py`:
- Around line 171-174: The shortcodes.update call in the loop iterating over
app.loaded_plugins silently overwrites duplicate shortcode names without any
indication. Before calling shortcodes.update for each
ContentTransformerPluginBase plugin, check if any shortcode names already exist
in the shortcodes dictionary by comparing the keys of shortcodes with the keys
of plugin.shortcodes. When a collision is detected, log a warning message that
identifies the conflicting shortcode names and which plugin is overwriting them,
then proceed with the update. This ensures visibility into shortcode conflicts
while maintaining the current behavior of allowing later plugins to override
earlier ones.

---

Outside diff comments:
In `@goodmap/goodmap.py`:
- Line 30: The _PLUGIN_ENTRY_POINT_GROUP constant in goodmap.py has been updated
to use "goodmap.plugins", but the documentation in docs/plugins.rst still
references the old "platzky.plugins" entry point group. Update all references to
the plugin entry point group in docs/plugins.rst to use "goodmap.plugins"
instead of "platzky.plugins" to maintain consistency with the code change and
prevent misleading plugin developers.

---

Nitpick comments:
In `@goodmap/goodmap.py`:
- Line 171: The shortcodes variable is currently typed as dict[str, Any] which
is too broad and reduces type safety. Change the type annotation for the
shortcodes variable to dict[str, Shortcode] to provide a more precise type that
accurately reflects the values stored in the dictionary, based on the test
context showing the expected structure of this class variable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7093f8b-2fdc-4f49-acd8-445b9f2be550

📥 Commits

Reviewing files that changed from the base of the PR and between 951e52a and 3f7f49b.

📒 Files selected for processing (1)
  • goodmap/goodmap.py

Comment thread goodmap/goodmap.py Outdated
@github-actions

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: 3f7f49b

⚠️ E2E Stress Test Results

Performance data not found. See workflow logs for details.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: 340716d

⚠️ E2E Stress Test Results

Performance data not found. See workflow logs for details.

@raven-wing raven-wing merged commit 206f947 into Problematy:main Jun 14, 2026
10 of 11 checks passed
@raven-wing raven-wing deleted the goodmap_plugin branch June 14, 2026 16:43
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.

1 participant