Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugin ordering bug #1892

Merged
merged 4 commits into from
Dec 14, 2023
Merged

Fix plugin ordering bug #1892

merged 4 commits into from
Dec 14, 2023

Conversation

benjie
Copy link
Member

@benjie benjie commented Dec 14, 2023

Description

Previously if there was no provider for a particular order constraint, then that order was ignored. It turns out there's no provider for smart-tags, but it has a lot of before and after constraints on it; all of which were ignored, which could result in plugins with before: ["smart-tags"] being loaded after plugins with after: ["smart-tags"]. Even though there's no provider for this, clearly this shouldn't be the case.

This PR solves the issue by creating a fake provider during the plugin sorting and then filtering it back out again at the end, enforcing that all before: ["smart-tags"] plugins are loaded before all after: ["smart-tags"] plugins.

Performance impact

Negligible startup cost.

Security impact

None known, unless someone is playing silly buggers with plugin ordering... but plugins are trusted code so we don't see that as a security vulnerability.

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

…en there was no provider; this now means PgSmartTagsPlugin is correctly loaded before PgFakeConstraintPlugin, fixing the `postgraphile.tags.json5` file.
Copy link

changeset-bot bot commented Dec 14, 2023

🦋 Changeset detected

Latest commit: 8f68109

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
graphile-config Patch
postgraphile Patch
@localrepo/grafast-bench Patch
@dataplan/pg Patch
grafast Patch
@grafserv/persisted Patch
grafserv Patch
ruru Patch
graphile-build-pg Patch
graphile-build Patch
graphile-utils Patch
pgl Patch
graphile Patch
@dataplan/json Patch
ruru-components Patch
@localrepo/grafast-website Patch
graphile-export Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benjie benjie merged commit 87450fb into main Dec 14, 2023
24 checks passed
@benjie benjie deleted the plugin-ordering branch December 14, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

1 participant