gateway icon indicating copy to clipboard operation
gateway copied to clipboard

refactor: separate conditions computing for listeners and routes into status pkg

Open shawnh2 opened this issue 1 year ago • 8 comments

What type of PR is this?

What this PR does / why we need it:

  • move gateway listeners and route conditions computing logic from internal/gatewayapi/context.go to internal/gatewayapi/status/
  • separate gateway, gatewayclass conditions computing and tests in internal/status/conditions.go into each corresponding place in internal/gatewayapi/status/xxx.go

Which issue(s) this PR fixes:

Fixes #860

shawnh2 avatar Mar 17 '24 14:03 shawnh2

Codecov Report

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

Project coverage is 64.57%. Comparing base (4c52f10) to head (aa1b606). Report is 4 commits behind head on main.

:exclamation: Current head aa1b606 differs from pull request most recent head 7321f6e. Consider uploading reports for the commit 7321f6e to get more accurate results

Files Patch % Lines
internal/gatewayapi/filters.go 71.17% 32 Missing :warning:
internal/gatewayapi/route.go 70.37% 32 Missing :warning:
internal/gatewayapi/validate.go 84.78% 14 Missing :warning:
internal/status/route.go 0.00% 11 Missing :warning:
internal/status/gateway.go 71.42% 10 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2951      +/-   ##
==========================================
- Coverage   66.89%   64.57%   -2.32%     
==========================================
  Files         163      123      -40     
  Lines       23453    21331    -2122     
==========================================
- Hits        15689    13775    -1914     
+ Misses       6838     6710     -128     
+ Partials      926      846      -80     

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

codecov[bot] avatar Mar 17 '24 14:03 codecov[bot]

should this live under internal/gatewayapi/status?

zirain avatar Mar 18 '24 05:03 zirain

should this live under internal/gatewayapi/status?

currently the conditions computing for Gateway and GatewayClass lives in internal/status, we should group them together, so I also move them into internal/status.

shawnh2 avatar Mar 18 '24 10:03 shawnh2

/retest

shawnh2 avatar Mar 20 '24 04:03 shawnh2

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

github-actions[bot] avatar Apr 19 '24 08:04 github-actions[bot]

thanks for unifying all the logic here @shawnh2 ! I'm a +1 on @zirain's idea of moving the status pieces under /internal/gatewayapi/status since they are all tied to GWAPI resources we can move out the k8s piece i.e. the updator into internal/kubernetes/status https://github.com/envoyproxy/gateway/blob/main/internal/status/status.go

arkodg avatar Apr 24 '24 21:04 arkodg

thanks for unifying all the logic here @shawnh2 !

I'm a +1 on @zirain's idea of moving the status pieces under /internal/gatewayapi/status since they are all tied to GWAPI resources

we can move out the k8s piece i.e. the updator into internal/kubernetes/status

https://github.com/envoyproxy/gateway/blob/main/internal/status/status.go

Sure, so in this case we don't need internal/status anymore.

shawnh2 avatar Apr 25 '24 01:04 shawnh2

/retest

shawnh2 avatar Apr 26 '24 08:04 shawnh2

/retest

shawnh2 avatar May 07 '24 05:05 shawnh2