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: gateway #3708

Merged
merged 2 commits into from
Aug 8, 2023
Merged

refactor: gateway #3708

merged 2 commits into from
Aug 8, 2023

Conversation

atzoum
Copy link
Contributor

@atzoum atzoum commented Aug 5, 2023

Description

Doing some preliminary work for being able to perform another refactoring that is going to modify gateway's functions to start relying on sourceID rather than writeKey:

  • Stop using global (config) variables in the gateway package
  • Stop using global config, logger & stats variables in gateway.Handle
  • Organise gateway.Handle fields into logical groups
  • Adapt gateway#Setup to fill in necessary configuration moved from global configuration
  • Remove methods/variables that are no longer necessary
  • Split gateway.go into more files containing logically grouped gateway functionalities
  • Wait for gateway to initialise its backend configuration in gateway's tests

Linear Ticket

Link

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Patch coverage: 80.08% and project coverage change: +0.11% 🎉

Comparison is base (7719719) 68.17% compared to head (bf88c80) 68.29%.

❗ Current head bf88c80 differs from pull request most recent head 26499ca. Consider uploading reports for the commit 26499ca to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3708      +/-   ##
==========================================
+ Coverage   68.17%   68.29%   +0.11%     
==========================================
  Files         320      324       +4     
  Lines       50469    50437      -32     
==========================================
+ Hits        34409    34446      +37     
+ Misses      13836    13765      -71     
- Partials     2224     2226       +2     
Files Changed Coverage Δ
runner/runner.go 70.28% <ø> (-0.12%) ⬇️
app/apphandlers/gatewayAppHandler.go 13.33% <33.33%> (+0.71%) ⬆️
gateway/handle_http.go 59.18% <59.18%> (ø)
app/apphandlers/embeddedAppHandler.go 76.22% <66.66%> (+0.18%) ⬆️
gateway/handle.go 79.74% <79.74%> (ø)
gateway/handle_lifecycle.go 85.71% <85.71%> (ø)
gateway/handle_config.go 98.03% <98.03%> (ø)
gateway/import_handler.go 100.00% <100.00%> (ø)
gateway/regular_handler.go 100.00% <100.00%> (ø)

... and 16 files with indirect coverage changes

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

gateway/gateway.go Outdated Show resolved Hide resolved
gateway/handle_config.go Outdated Show resolved Hide resolved
gateway/handle_lifecycle.go Outdated Show resolved Hide resolved
@atzoum atzoum force-pushed the refactor.gateway branch 2 times, most recently from 7eeacde to a493f43 Compare August 8, 2023 12:19
gateway/types.go Outdated Show resolved Hide resolved
Copy link
Member

@lvrach lvrach left a comment

Choose a reason for hiding this comment

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

Most of the comments are irrelevant for this PR since large portions of code moved and this is preparatory PR.

gateway/types.go Outdated Show resolved Hide resolved
gateway/handle_http.go Outdated Show resolved Hide resolved
gateway/handle.go Outdated Show resolved Hide resolved
gateway/import_handler.go Outdated Show resolved Hide resolved
@atzoum atzoum force-pushed the refactor.gateway branch 3 times, most recently from 12ebf81 to bf88c80 Compare August 8, 2023 13:43
@atzoum
Copy link
Contributor Author

atzoum commented Aug 8, 2023

Most of the comments are irrelevant for this PR since large portions of code moved and this is preparatory PR.

tried to address them nevertheless :)

@atzoum atzoum merged commit 3cc17f3 into master Aug 8, 2023
33 checks passed
@atzoum atzoum deleted the refactor.gateway branch August 8, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants