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

Plugin API: Loading Improvements #372

Merged
merged 11 commits into from
Feb 10, 2017
Merged

Conversation

kjin
Copy link
Contributor

@kjin kjin commented Feb 7, 2017

  • Warn if module version is unsatisfied by plugin
  • Fix possible bad behavior if patch.versions doesn't exist
  • Fix programming error related to patch sets
  • Store multiple module versions
  • Add plugin loader tests

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 7, 2017
matthewloring
matthewloring previously approved these changes Feb 7, 2017
Copy link
Contributor

@matthewloring matthewloring left a comment

Choose a reason for hiding this comment

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

LGTM with nit

@@ -116,16 +116,20 @@ function activate(agent) {
if (!patchSet) {
// Load the plugin object
var plugin = originalModuleLoad(instrumentation.file, module, false);
patchSet = [];
patchSet = {};

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@kjin
Copy link
Contributor Author

kjin commented Feb 9, 2017

I realize that the amount of change the plugin loader needs to go through (due to bugginess) doesn't instill confidence. So I have added tests that should hopefully showcase that things work smoothly now, and also to bump coverage up.

@GoogleCloudPlatform/node-team PTAL

@kjin kjin dismissed matthewloring’s stale review February 9, 2017 22:03

Bulk of changes after approval

}

// Future requires get patched as they get loaded.
return function Module_load(request, parent, isMain) {
var instrumentation = plugins[request];

if (instrumentation &&
agent.config().excludedHooks.indexOf(request) === -1) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -197,19 +147,6 @@ function activate(agent) {
}

function deactivate() {
for (var moduleName in plugins) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

// plugin loader as the trace agent. It accepts the list of plugins that the
// plugin loader reads.
function createFakeAgent(plugins) {
function writeToLog(log, data) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@kjin
Copy link
Contributor Author

kjin commented Feb 10, 2017

@matthewloring Thanks for taking a look at this again!

@kjin kjin merged commit 9011c8a into googleapis:master Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants