DBIx-Class-Migration icon indicating copy to clipboard operation
DBIx-Class-Migration copied to clipboard

fix used_plugins to only return real traits using proper format

Open haarg opened this issue 5 years ago • 1 comments

Rather than filtering the traits list to ones not generated by MooX::Traits::Util, filter for %INC entries that came from their own files by checking that the file matches the trait name. Also ensure traits in subdirectories are returned with double colon separators, rather than slashes.

This addresses RT#134845

This entire function seems very suspect. I didn't fully investigate how it is used, but it really seems like it shouldn't exist. Basing anything on which plugins happen to have been loaded seems like a big mistake.

haarg avatar Mar 29 '21 06:03 haarg

In context, this function is basing things on plugins because it's part of a DSL for migrations, where the object managing the migration gets mixed in with the traits that are loaded.

Know that I'm seeing how flaky this is, it's probably worth looking into some better way to provide the same interface.

On Mon, Mar 29, 2021, 09:44 Graham Knop @.***> wrote:

Rather than filtering the traits list to ones not generated by MooX::Traits::Util, filter for %INC entries that came from their own files by checking that the file matches the trait name. Also ensure traits in subdirectories are returned with double colon separators, rather than slashes.

This addresses RT#134845 https://rt.cpan.org/Ticket/Display.html?id=134845

This entire function seems very suspect. I didn't fully investigate how it is used, but it really seems like it shouldn't exist. Basing anything on which plugins happen to have been loaded seems like a big mistake.

You can view, comment on, or merge this pull request online at:

https://github.com/jjn1056/DBIx-Class-Migration/pull/142 Commit Summary

  • fix used_plugins to only return real traits using proper format

File Changes

Patch Links:

  • https://github.com/jjn1056/DBIx-Class-Migration/pull/142.patch
  • https://github.com/jjn1056/DBIx-Class-Migration/pull/142.diff

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jjn1056/DBIx-Class-Migration/pull/142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFURPKRYXYKV6ETTIQN3DSTTGAVVFANCNFSM4Z67AQNA .

rabbiveesh avatar Mar 31 '21 20:03 rabbiveesh