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

[Access] Refactor REST Routes Package #6616

Merged

Conversation

UlyanaAndrukhiv
Copy link
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv commented Nov 4, 2024

Closes: #6615

Context

This PR introduces a significant restructuring of the access/rest folder, enhancing modularity and clarity.

  • The new organization separates http and WebSocket components into http and websockets directories, simplifying maintenance and readability.
  • Common functionality is moved to the rest/common package.
  • RouterBuilderimplementation is separated from all routes and moved to rest/router.
  • Lists of http and ws routes are now in http_routes.go and ws_routes.go, respectively.
  • The current v1/subscribe_events route is moved into the websocket/legacy folder to separate future WebSocket implementations.

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 37.11790% with 144 lines in your changes missing coverage. Please review.

Project coverage is 41.19%. Comparing base (f44c7fb) to head (6be9cc4).

Files with missing lines Patch % Lines
...e/access/rest/http/request/get_execution_result.go 0.00% 24 Missing ⚠️
engine/access/rest/router/router_test_helpers.go 0.00% 22 Missing ⚠️
engine/access/rest/http/request/get_block.go 0.00% 14 Missing ⚠️
engine/access/rest/http/request/get_transaction.go 0.00% 11 Missing ⚠️
engine/access/rest/http/request/get_collection.go 0.00% 9 Missing ⚠️
...access/rest/websockets/legacy/websocket_handler.go 62.50% 6 Missing ⚠️
...ine/access/rest/http/request/create_transaction.go 0.00% 5 Missing ⚠️
engine/access/rest/http/request/get_account.go 0.00% 5 Missing ⚠️
...ne/access/rest/http/request/get_account_balance.go 0.00% 5 Missing ⚠️
engine/access/rest/http/request/get_account_key.go 0.00% 5 Missing ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6616      +/-   ##
==========================================
- Coverage   41.19%   41.19%   -0.01%     
==========================================
  Files        2052     2052              
  Lines      182215   182219       +4     
==========================================
- Hits        75072    75070       -2     
- Misses     100850   100856       +6     
  Partials     6293     6293              
Flag Coverage Δ
unittests 41.19% <37.11%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@UlyanaAndrukhiv UlyanaAndrukhiv marked this pull request as ready for review November 4, 2024 18:19
Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

looks good. only comment is about switching to using strings for payload

engine/access/handle_irrecoverable_state_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Guitarheroua Guitarheroua left a comment

Choose a reason for hiding this comment

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

LGTM

@peterargue peterargue added this pull request to the merge queue Nov 7, 2024
Merged via the queue into onflow:master with commit b929eea Nov 7, 2024
55 checks passed
@peterargue peterargue deleted the UlyanaAndrukhiv/6615-rest-refactoring branch November 7, 2024 16:09
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.

[Access] Refactor REST Routes Package
4 participants