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

refactor: Graph Manager (Engine) reporting "extensions" become "plugins". #3998

Merged

Commits on Apr 16, 2020

  1. refactor: Graph Manager (Engine) reporting "extensions" become "plugi…

    …ns".
    
    Similar to 6009d8a (#3991) and 68cbc93 (#3997), which migrated the
    tracing and cache-control extensions to the (newer) request pipeline plugin
    API, this commit introduces:
    
     - Internally, a `plugin` named export which is utilized by the `agent`'s
       `newExtension` method to provide a plugin which is instrumented to
       transmit metrics to Apollo Graph Manager.  This plugin is meant to
       replicate the behavior of the `EngineReportingExtension` class which,
       as of this commit, still lives besides it.
     - Externally, a `federatedPlugin` exported on the main module of the
       `apollo-engine-reporting` package.  This plugin is meant to replicate the
       behavior of the `EngineFederatedTracingExtension` class (also exported on
       the main module) which, again as of this commit, still lives besides it!
    
    Again, the delta of the commits seemed more confusing by allowing a natural
    `diff` to be made of it, I've left the extensions in place so they can be
    compared - presumably side-by-side in an editor - on the same commit.  An
    (immediate) subsequent commit will remove the extension.
    abernix committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    de7ba72 View commit details
    Browse the repository at this point in the history
  2. fix: Keep special-cased errors (e.g. APQ not found) as unreported.

    This fixes the failing tests which correctly surfaced on the last commit.
    
    Previously, prior to the new plugin API, the Apollo Engine Reporting
    mechanism was implemented using `graphql-extensions`, the API for which
    didn't invoke `requestDidStart` until _after_ APQ had been negotiated.
    
    The new plugin API starts its `requestDidStart` _before_ APQ validation and
    various other assertions which weren't included in the `requestDidStart`
    life-cycle, even if they perhaps should be in terms of error reporting.
    
    The new plugin API is able to properly capture such errors within its
    `didEncounterErrors` lifecycle hook (thanks to
    #3614, which
    intentionally captures these failures so plugin authors can accurately react
    to them), however, for behavioral consistency reasons, we will still
    special-case those errors and maintain the legacy behavior to avoid a
    breaking change.  We can reconsider this in a future version of Apollo
    Engine Reporting (AS3, perhaps!).
    
    Ref: #3614
    Ref: #3627
    Ref: #3638
    abernix committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    78a4cb7 View commit details
    Browse the repository at this point in the history
  3. eliminate!: Remove now deprecated EngineReportingExtension.

    The plugin implementation brought in de7ba72 supersedes the need for
    this implementation!
    abernix committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    c67a6df View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2020

  1. Configuration menu
    Copy the full SHA
    dce4a24 View commit details
    Browse the repository at this point in the history
  2. 1 Configuration menu
    Copy the full SHA
    a8ab841 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2020

  1. Use optional chaining when accessing optional request.http.headers.

    ...and destructuring.
    abernix committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    fc05e8d View commit details
    Browse the repository at this point in the history
  2. Ensure metrics is present before plugin initialization.

    This eliminates the need to guard for the presence of `metrics` on the
    `requestContext` within plugins who are calling `requestDidStart`.
    
    Ref: #3998 (comment)
    abernix committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    48eab7e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8ca5d11 View commit details
    Browse the repository at this point in the history
  4. Move Trace.HTTP init inside of ensurePreflight.

    As noted in review within [[1]], there wasn't really a compelling reason for
    this to be kept separately from the other tree-building bits which existed
    within `ensurePreflight`.
    
    [1]: #3998 (comment)
    abernix committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    0658df5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fc966a4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    766c738 View commit details
    Browse the repository at this point in the history
  7. chore!: Use document / source rather than documentAST / `queryS…

    …tring`.
    
    The use of `document` and `source` is the standard within the plugin API and
    the request pipeline, so these names should be more natural going forward.
    
    This wouldn't have been possible without a breaking change, but we're
    already doing that.
    abernix committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    f4aad30 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6b0c83c View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2020

  1. Merge branch 'abernix/add-willResolveField-and-didResolveField' into …

    …abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    48b8c95 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2020

  1. Configuration menu
    Copy the full SHA
    283e82f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0949ec View commit details
    Browse the repository at this point in the history
  3. Merge branch 'abernix/add-willResolveField-and-didResolveField' into …

    …abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed May 7, 2020
    Configuration menu
    Copy the full SHA
    0a0bd14 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'abernix/add-schema-and-schemaHash-to-requestContext' in…

    …to abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed May 7, 2020
    Configuration menu
    Copy the full SHA
    1756b37 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e813e5b View commit details
    Browse the repository at this point in the history
  6. wip didResolveSource

    abernix committed May 7, 2020
    Configuration menu
    Copy the full SHA
    d913589 View commit details
    Browse the repository at this point in the history
  7. other stuff

    abernix committed May 7, 2020
    Configuration menu
    Copy the full SHA
    39ff086 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2020

  1. Merge branch 'abernix/add-schema-and-schemaHash-to-requestContext' in…

    …to abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    4be279d View commit details
    Browse the repository at this point in the history
  2. changelog: #3998

    I may re-visit this consideration.
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    ba37e68 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e9edd9a View commit details
    Browse the repository at this point in the history
  4. chore(e-r): Eliminate ensurePreflight by using (new) `didResolveSou…

    …rce`.
    
    Leverages new life-cycle `didResolveSource` which was introduced by
    [[PR #4076]] and inspired by this [[comment]].
    
    This is much nicer!
    
    [PR #4076]: #4076
    [Comment]: https://github.com/apollographql/apollo-server/pull/3998/files#r414911049
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    b981b59 View commit details
    Browse the repository at this point in the history
  5. changelog: Add note that I believe some new APQ errors are now traced.

    @glasser, are you able to confirm this belief and that it should be okay?
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    6d4777d View commit details
    Browse the repository at this point in the history
  6. Revert "changelog: Add note that I believe some new APQ errors are no…

    …w traced."
    
    This reverts commit 6d4777d.
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    bacbb17 View commit details
    Browse the repository at this point in the history
  7. fix(e-r): Do not keep traces unless we resolve the "source".

    Previously, I introduced a work-around for this in 78a4cb7,
    though that is no longer necessary with the introduction of
    `didResolveSource` in #4076
    
    I'm thrilled to remove this!
    
    Ref: #3998 (comment)
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    59b4013 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'abernix/add-schema-and-schemaHash-to-requestContext' in…

    …to abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    16e471e View commit details
    Browse the repository at this point in the history
  9. fix: Preserve client-requested operationName on op. name resolution…

    … failure.
    
    Addresses feedback in below referenced [[Comment]].
    
    If operation resolution (parsing and validating the document followed by
    selecting the correct operation) resulted in the population of the
    `operationName`, we'll use that. (For anonymous operations,
    `requestContext.operationName` is null, which we represent here as the empty
    string.)
    
    If the user explicitly specified an `operationName` in their request but
    operation resolution failed (due to parse or validation errors or because
    there is no operation with that name in the document), we still put _that_
    user-supplied `operationName` in the trace. This allows the error to be
    better understood in Graph Manager. (We are considering changing the
    behavior of `operationName` in these three error cases; see [[#3465]] below for
    details.)
    
    [Comment]: #3998 (comment)
    [#3465]: #3465
    abernix committed May 8, 2020
    2 Configuration menu
    Copy the full SHA
    b0948a8 View commit details
    Browse the repository at this point in the history
  10. Merge branch 'abernix/add-schema-and-schemaHash-to-requestContext' in…

    …to abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    7c8b8e3 View commit details
    Browse the repository at this point in the history
  11. Switch to new willResolveField object parameter, rather position.

    Implements pattern gained by a926b7e in #3988.
    
    Ref: #3998
    abernix committed May 8, 2020
    Configuration menu
    Copy the full SHA
    62fc270 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2020

  1. Configuration menu
    Copy the full SHA
    c73cd16 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'abernix/add-willResolveField-and-didResolveField' into …

    …abernix/migrate-engine-reporting-exts-to-plugin-api
    abernix committed May 11, 2020
    Configuration menu
    Copy the full SHA
    af2d6d8 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2020

  1. Configuration menu
    Copy the full SHA
    1144c7a View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/release-2.14.0' into abernix/mig…

    …rate-engine-reporting-exts-to-plugin-api
    abernix committed May 12, 2020
    Configuration menu
    Copy the full SHA
    3ccccad View commit details
    Browse the repository at this point in the history