Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Untangled Go RPC code #1291

Merged
merged 1 commit into from
Oct 20, 2016

Conversation

kjlyon
Copy link
Contributor

@kjlyon kjlyon commented Oct 17, 2016

Enables #1289 to be done easily when the time comes

Summary of changes:

  • Separated Go RPC plugin libraries and non plugin related functions
  • Created files with deprecated flags to hold code that is used by GoRPC
  • Added deprecation warning that will appear when loading legacy plugins

Testing done:

  • Unit tests, Running snap

@intelsdi-x/snap-maintainers

  • Identified code used by GoRPC plugins
  • Created files with deprecated flags to hold code that is used by GoRPC plugins
  • Added deprecation warning when loading legacy plugin

@@ -0,0 +1,308 @@
/* ** DEPRECATED **
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want this separate from the copyright notice separated by a line in it's own comment block. We want attention to be drawn to it.

@@ -107,6 +107,9 @@ func newAvailablePlugin(resp plugin.Response, emitter gomit.Emitter, ep executab
}
ap.client = c
case plugin.NativeRPC:
log.WithFields(log.Fields{
"_module": "control-aplugin",
}).Warning("This plugin has been deprecated.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need more description here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested changes have been made

@@ -107,6 +107,9 @@ func newAvailablePlugin(resp plugin.Response, emitter gomit.Emitter, ep executab
}
ap.client = c
case plugin.NativeRPC:
log.WithFields(log.Fields{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give me the block also (newAvailablePlugin) so that I know exactly where this message came from.

@kjlyon kjlyon force-pushed the ib/Deprecate-legacy-plugin-lib branch 2 times, most recently from 3e4884b to cceb3f4 Compare October 18, 2016 21:02
@@ -1,3 +1,5 @@
/* ** DEPRECATED ** */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecated banner should also include a link to #1289.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the suggested updates

// These are our built-in content types for plugins
// SnapProtoBuff snap metrics serialized into protocol buffers
SnapProtoBuff = "snap.pb" // TO BE IMPLEMENTED
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constant isn't used and could be removed.

"net/rpc/jsonrpc"
"regexp"
"runtime"
"crypto/rsa" // Don't use "fmt.Print*"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment // Don't use "fmt.Print*" should be moved up below the warning or removed.

@kjlyon kjlyon force-pushed the ib/Deprecate-legacy-plugin-lib branch from cceb3f4 to c22d877 Compare October 19, 2016 16:28
@IRCody IRCody changed the title Untangled gRPC code Untangled Go RPC code Oct 19, 2016
return &common.Empty{}, err
}
return &common.Empty{}, nil
}*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to leave this stuff in here commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it there since it was in publisher_proxy before I untangled the code. I don't know if it has a purpose or future purpose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't have a future purpose and should've been removed previously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I deleted that section and a couple other places that were just commented out code.

@kjlyon kjlyon force-pushed the ib/Deprecate-legacy-plugin-lib branch from c22d877 to 81caf55 Compare October 20, 2016 18:17
"_module": "control-aplugin",
"_block": "newAvailablePlugin",
"aplugin": ap.name,
}).Warning("This plugin is using a deprecated RPC protocol. Please update " + ap.name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would look better if we change aplugin to plugin_name and then remove the name from the warning string. Instead it could be something like This plugin is using a deprecated RPC protocol.. I'm not convinced if we should have some sort of message pointing them somewhere (a url?) where they can find out more. What do you think?

- Identified code used by GoRPC plugins
- Created files with deprecated flags to hold code that is used by GoRPC plugins
- Added deprecation warning when loading legacy plugin
@kjlyon kjlyon force-pushed the ib/Deprecate-legacy-plugin-lib branch from 81caf55 to 0a30d04 Compare October 20, 2016 22:21
Copy link
Contributor

@IRCody IRCody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IRCody IRCody merged commit c476a60 into intelsdi-x:master Oct 20, 2016
@kjlyon kjlyon mentioned this pull request Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants