hyperjumptech / monika

Monika is a command line application to monitor every part of your web app using a simple YAML configuration file. Get alert not only when your site is down but also when it's slow.
https://monika.hyperjump.tech
MIT License
605 stars 67 forks source link

fix(http prober): crash on request probe type #1264

Closed syamsudotdev closed 8 months ago

syamsudotdev commented 8 months ago

Monika Pull Request (PR)

This PR resolves #1263

What feature/issue does this PR add

  1. Fix crash caused by wrong typing

How did you implement / how did you fix it

  1. Revert #1256 for request config type of HeadersInit back to object
  2. Revert HTTP prober related to type change

How to test

  1. Unit test Axios HTTP prober with npm run test.
    • Expect successful run.
  2. Run Monika to test Symon client with monika --symonUrl <URL> --symonKey <UUID> --follow-redirects=5 --retryInitialDelayMs=150000 --ignoreInvalidTLS.
    • Expect successful run with no crash happen.
  3. Force Monika to use Node.js fetch sed -i ".bak" "s/flags\[\'native\-fetch\'\]/true/g" "src/components/probe/prober/http/request.ts"
  4. Unit test Node.js fetch implementation npm run test
    • Expect successful run.
codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 62.53%. Comparing base (3d2380c) to head (345f623). Report is 1 commits behind head on main.

Files Patch % Lines
src/components/probe/prober/http/request.ts 84.61% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1264 +/- ## ========================================== + Coverage 62.37% 62.53% +0.16% ========================================== Files 111 112 +1 Lines 3378 3390 +12 Branches 590 591 +1 ========================================== + Hits 2107 2120 +13 + Misses 1080 1078 -2 - Partials 191 192 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.