Skip to content

Commit

Permalink
Debug Protocol Enhancements (#107)
Browse files Browse the repository at this point in the history
* Add initial DebugProtocolServer and handshake test

* Add test plugin to intercept requests.

* Port "not correct magic" test to new flow

* Fix handshake version handling

* Adds all request classes

* Refactored response classes

* Add more updates

* Move readStringNT to protocolUtils.
Rename Debugger to DebugProtocolClient

* Migrate more responses to new structure

* Many more tweaks. VariablesRequest mostly functional now

* More fixes

* Fix VariablesResponse

* Fix tsc errors

* Fix handshake request/response issues.

* PascalCase enums

* Fix forceCaseInsensitive variables command logic

* Fix unit tests and add better logging.

* Fix npm package issues

* Rename ProtocolUtils to singular.
Add testHelpers tests

* test enable/disable flags

* Fix broken tests

* test tcp server defaults

* Fix lint issue

* better HandshakeResponse coverage

* Handle all variable types

* Responses 100% coverage

* More DebugProtocolClient tests

* fix server support mulitple requests in single buffer

* Support for DebugProtocolReplaySession

* Add basic ProtocolClient plugin support

* Better logging

* Better port handling in ReplaySession

* Fix io socket replacing server socket

* Fix several bugs.

* Process more frequently

* Discard unrecognized updates/responses

* Clean up sockets after session is complete

* Fixed socket issues during testing

* fix port issues

* try to prevent getting stuck

* only run the PR build

* Try fixing logging issues

* skip failing test.

* skip another

* increase timeout for all tests, reenable disabled

* Fix node 12 server never close

* Better socket teardowns

* fix broken breakpoint response in ProtocolClient

* Better tests for breakpoint requests

* Fix empty stack trace response

* Refactor protocol vars logic (local vars broken)

* fix tests

* Fix local vars and add array size

* rename "AA" to "AssociativeArray"

* add new util.hasNonNullishProperty func

* Load errorData for requests.
Handle variablesResponse error data

* Improve bad variable presentations

* Fix tests for invalid/uninitialized vals

* Fix parent var type lookup

* Fixed wording for subtyped objects.

* Add better test coverage

* Fix issues in null var lookup stuff

* Fix breakpoint bugs

* fix lint errors

* Fix lint issue

* Discard breakpoints that got deleted before verified (#138)

* Discard breakpoints that got deleted before verified

* Add log entry for when we removed the breakpoint

* disable coveralls publishing

* Logging improvements (#140)

* Discard breakpoints that got deleted before verified

* Add log entry for when we removed the breakpoint

* disable coveralls publishing

* Improve logging output for request/response/update

* increase timeout for DebugProtocolAdapter tests

* More graceful shutdown (#141)

* More graceful shutdown

* remove unnecessary test

* Better exec recovery (#142)

* More graceful shutdown

* remove unnecessary test

* Don't store failed exec commands

* Support new logging format for replay session

* Merge branch 'master' of https://github.com/rokucommunity/roku-debug into DebugProtocolServer

* Fix breakpoint sync issues (#143)

* support marking breakpoints as `pending`

* Implement `deleteBreakpoint` for bp manager

* retain bp "pending" status if bp is deleted

* Fix breakpoint deviceId issues

* Only run single breakpoint sync at a time

* BreakpointRef support

* Fix failing test

* Prevent tests from stalling out

* Resurrect breakpoints when device failed to remove

* Fix bp resurrection

* Make the bp events more generic

* Add unit test for removing failed add breakpoints

* Update changelog for v0.18.9

* 0.18.9

* Update changelog for v0.18.10

* 0.18.10

* Fix crash by using postman-request (#151)

* Update changelog for v0.18.11

* 0.18.11

* Fix `file already exists` error and hung process (#152)

* Remove axios in favor of postman-request (#153)

* Update changelog for v0.18.12

* 0.18.12

* File logging (#155)

* Adds FileLoggingManager

* Fix missing cwd

* Update changelog for v0.19.0

* 0.19.0

* Merge branch 'master' of https://github.com/rokucommunity/roku-debug into DebugProtocolServer

* Simplified the relay session test

* Move @types/request to deps to fix d.bs files

* Update changelog for v0.19.1

* 0.19.1

* Support sgrendezvous through ecp (#150)

* A lot of foundational work

* Update testing

* Push some of the more foundational functions

* Add minversion function and await to an async function

* Ending curly bracket

* Add types

* Add add launch config info to device info

* Capture rendezvous

* Wrap up rendezvous support

* delete log

* Make code more easily testable

* Change a few things around how to handle the rendezvous data

* test pingEcpRendezvous

* Fix bug with telnet and ecp mismatch

* Drive usage based on launch config setting instead of device.
Move rendezvous events out of adapters.

---------

Co-authored-by: Bronley Plumb <[email protected]>

* Update changelog for v0.20.0

* 0.20.0

* Fix rendezvous crash (#156)

* Fix timing bugs during rendezvous tracking startup

* Only emit rendezvous data if new data was received

* Update changelog for v0.20.1

* 0.20.1

* Bump word-wrap from 1.2.3 to 1.2.4 (#157)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update changelog for v0.20.2

* 0.20.2

* Add option to delete dev channel before install (#158)

* Update changelog for v0.20.3

* 0.20.3

* When a breakpoint fails to delete because of error NOT_STOPPED. Store
the breakpoints and delete later.

* Store the srcHash and destHash as different hashes
Create a mapping of destHash to breakpoint deviceId

* Unit test fixes

* Fix another test

* Remove more bp resurrection tests

* Always set deviceId for bps, even on error

* Remove unnecessary cache and resurrection references

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Milap Naik <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Holbrook <[email protected]>

* Add some breakpoint logging

* DebugProtocol compile-error handling (#161)

* support marking breakpoints as `pending`

* Implement `deleteBreakpoint` for bp manager

* retain bp "pending" status if bp is deleted

* Fix breakpoint deviceId issues

* Only run single breakpoint sync at a time

* BreakpointRef support

* Fix failing test

* Prevent tests from stalling out

* Resurrect breakpoints when device failed to remove

* Fix bp resurrection

* Make the bp events more generic

* Add unit test for removing failed add breakpoints

* Merge branch 'master' of https://github.com/rokucommunity/roku-debug into DebugProtocolServer

* Simplified the relay session test

* When a breakpoint fails to delete because of error NOT_STOPPED. Store
the breakpoints and delete later.

* Store the srcHash and destHash as different hashes
Create a mapping of destHash to breakpoint deviceId

* Unit test fixes

* Fix another test

* Remove more bp resurrection tests

* Always set deviceId for bps, even on error

* Add better suppport for compile error output

* Changes that need to be verified

* Small comments, fix leftover merge items

* Small stability tweaks

* Properly shut down the adapter on debugger close

* Fix telnet complib error detection

* Shut down if compile error exists when using debug nav commands

* send responses earlier to feel more responsive

* Dedupe compile errors. add diagnostic source

* better diagnostic source handling

* Fix tests

* Simplify the response sending logic

---------

Co-authored-by: Christian Holbrook <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Milap Naik <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Holbrook <[email protected]>
  • Loading branch information
4 people authored Oct 16, 2023
1 parent 4eb13ad commit d6afe4b
Show file tree
Hide file tree
Showing 126 changed files with 13,123 additions and 4,229 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
- v*
pull_request:


jobs:
ci:
runs-on: ${{ matrix.os }}
Expand All @@ -26,7 +25,6 @@ jobs:
- run: npm run build
- run: npm run lint
- run: npm run test
#code coverage server is failing, so disable it for now. (If you're reading this, re-enable please)
#- run: npm run publish-coverage
npm-release:
#only run this task if a tag starting with 'v' was used to trigger this (i.e. a tagged release)
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"type": "node",
"request": "launch",
"name": "Run Roku Sample Project",
"skipFiles": [
Expand All @@ -17,7 +17,7 @@
},
{
"name": "Debug Tests",
"type": "pwa-node",
"type": "node",
"request": "launch",
"smartStep": false,
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
Expand All @@ -34,4 +34,4 @@
"internalConsoleOptions": "openOnSessionStart"
}
]
}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"files.trimTrailingWhitespace": false,
"files.trimTrailingWhitespace": true,
"[markdown]": {
"files.trimTrailingWhitespace": false
},
Expand Down
2,736 changes: 2,110 additions & 626 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"preversion": "npm run build && npm run lint && npm run test",
"lint": "eslint \"src/**\"",
"watch": "tsc --watch",
"test": "nyc mocha \"src/**/*spec.ts\"",
"test:nocover": "mocha \"src/**/*.spec.ts\"",
"test": "nyc mocha \"src/**/*spec.ts\" --exclude \"src/**/*.device.spec.ts\"",
"device-test": "mocha --spec \"src/**/*.device.spec.ts\"",
"test:nocover": "mocha \"src/**/*.spec.ts\" --exclude \"src/**/*.device.spec.ts\"",
"publish-coverage": "nyc report --reporter=text-lcov | coveralls"
},
"typings": "dist/index.d.ts",
Expand All @@ -24,6 +25,10 @@
"source-map-support/register",
"ts-node/register"
],
"watchFiles": [
"src/**/*"
],
"timeout": 2000,
"fullTrace": true,
"watchExtensions": [
"ts"
Expand Down Expand Up @@ -55,13 +60,15 @@
"devDependencies": {
"@types/chai": "^4.2.22",
"@types/dateformat": "~3",
"@types/debounce": "^1.2.1",
"@types/decompress": "^4.2.4",
"@types/dedent": "^0.7.0",
"@types/find-in-files": "^0.5.1",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.6",
"@types/request": "^2.48.8",
"@types/semver": "^7.3.9",
"@types/sinon": "^10.0.6",
"@types/vscode": "^1.61.0",
Expand All @@ -77,6 +84,7 @@
"mocha": "^9.1.3",
"nyc": "^15.1.0",
"p-defer": "^4.0.0",
"portfinder": "^1.0.32",
"rimraf": "^3.0.2",
"rmfr": "^2.0.0",
"rxjs": "^7.4.0",
Expand All @@ -89,7 +97,8 @@
"@rokucommunity/logger": "^0.3.3",
"@types/request": "^2.48.8",
"brighterscript": "^0.65.8",
"dateformat": "~4",
"dateformat": "^4.6.3",
"debounce": "^1.2.1",
"eol": "^0.9.1",
"eventemitter3": "^4.0.7",
"fast-glob": "^3.2.11",
Expand All @@ -100,7 +109,7 @@
"replace-in-file": "^6.3.2",
"replace-last": "^1.2.6",
"roku-deploy": "^3.10.3",
"semver": "^7.5.3",
"semver": "^7.5.4",
"serialize-error": "^8.1.0",
"smart-buffer": "^4.2.0",
"source-map": "^0.7.4",
Expand Down
Loading

0 comments on commit d6afe4b

Please sign in to comment.