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

fix: allow hapi plugin from array to be registered as argument #1253

Merged
merged 2 commits into from
Oct 30, 2022
Merged

fix: allow hapi plugin from array to be registered as argument #1253

merged 2 commits into from
Oct 30, 2022

Conversation

dmathieu
Copy link
Member

Which problem is this PR solving?

I missed this in #1046.
HAPI plugins can be registered directly as objects, with server.register(plugin). But they can also be registered as an array, with server.register([plugin]).

Right now, we only accept server.register([{plugin: plugin}]);, which doesn't match the hapi documentation.
See https://hapi.dev/tutorials/plugins/?lang=en_US#loading

Short description of the changes

Allow registering hapi plugins from an array when the object is passed directly, and they are not nested within a deeper object.

@dmathieu dmathieu requested a review from a team October 26, 2022 09:38
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #1253 (bc53a9d) into main (180b336) will increase coverage by 3.10%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1253      +/-   ##
==========================================
+ Coverage   96.08%   99.19%   +3.10%     
==========================================
  Files          14        5       -9     
  Lines         893      247     -646     
  Branches      191       36     -155     
==========================================
- Hits          858      245     -613     
+ Misses         35        2      -33     
Impacted Files Coverage Δ
...emetry-instrumentation-hapi/src/instrumentation.ts 99.31% <100.00%> (ø)
...umentation-user-interaction/src/instrumentation.ts
...etapackages/auto-instrumentations-web/src/utils.ts
...entation-document-load/src/enums/AttributeNames.ts
...metry-propagator-aws-xray/src/AWSXRayPropagator.ts
...lugin-react-load/src/BaseOpenTelemetryComponent.ts
...metry-propagator-ot-trace/src/OTTracePropagator.ts
...lemetry-instrumentation-document-load/src/utils.ts
...y-instrumentation-long-task/src/instrumentation.ts
...erator-aws-xray/src/internal/xray-id-generation.ts
... and 10 more

@dmathieu
Copy link
Member Author

Failing browser test seems unrelated to the changes in this PR.

@blumamir blumamir merged commit 1db3b7e into open-telemetry:main Oct 30, 2022
@dyladan dyladan mentioned this pull request Oct 30, 2022
@dmathieu dmathieu deleted the hapi-plugin-array branch October 31, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants