-
Notifications
You must be signed in to change notification settings - Fork 5
v1.1.0 - Extract plugin ceremony into automatic convenience methods on Team instances #20
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
Conversation
vburzynski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few suggestions, I'll need to finish my review tomorrow
|
Thank you @vburzynski for your feedback so far. I've implemented it, so please let me know if it's looking better now. Thanks! |
vburzynski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. I think we could open this up for review
|
We got the build updated so it runs ruby 3.2 - 3.4. |
This reverts commit 3daff59.
Co-authored-by: Valerie Burzynski <jediyautja@gmail.com>
8971de1 to
a29287e
Compare
This version update addresses an issue with using
CodeTeamsplugins, which is that a developer must manually inline the plugin where they want to access that data in the code.For example, if I want to use my github plugin, my production code has to look like this:
We are proposing to extract this extra work away from the developer and provide a convenient interface that is automatically baked into the
CodeTeams::Teaminstance:In this PR:
bin/rspecCodeTeams::Team:team.githubfor a givenGithubpluginMyPlugin.for(team).my_pluginstill works, but it has been rendered unnecessaryteam.my_pluginNot much has changed about how to develop a plugin, except that the ideal way to define it is such that your plugin's data access method should match the name of the plugin class (this is a convention developers at Gusto are already using informally). There is an option to deviate from the convention by overriding the default
data_accessor_name(shown below)Note that these examples just show a simplified plugin where the method returns a static value instead of the whole ceremony of turning the
raw_hashinto a struct (another informal convention seen in most of the plugins at Gusto - we plan to release a major update that will standardize that as an internal implementation feature ofCodeTeams::Plugin)If you need your plugin to use a custom
data_accessor_namefor the data: