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

feat: scaffold config dependency graph implementation #6010

Merged
merged 4 commits into from
May 16, 2024

Conversation

czeslavo
Copy link
Contributor

@czeslavo czeslavo commented May 13, 2024

What this PR does / why we need it:

Scaffolds code for building config dependency graph:

  • adds a hack/generators/config-graph code generator that outputs NewConfigGraphFromCacheStores function ensuring that we include all objects from the store in the graph
  • adds a "framework" for resolving particular object types dependencies (public ResolveDependencies along with the internal resolveIngressDependencies for Ingress - leaving the rest to be implemented in separate PR(s))

Which issue this PR fixes:

Part of #5929.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@czeslavo czeslavo self-assigned this May 13, 2024
@czeslavo czeslavo added area/feature New feature or request and removed size/XL labels May 13, 2024
@czeslavo czeslavo added this to the KIC v3.2.x milestone May 13, 2024
@czeslavo czeslavo force-pushed the feat/generate-config-graph branch from 08637d6 to b1789fa Compare May 13, 2024 18:09
@czeslavo czeslavo force-pushed the feat/generate-config-graph branch 2 times, most recently from 13f5964 to 89cc2d8 Compare May 13, 2024 18:20
@czeslavo czeslavo marked this pull request as ready for review May 13, 2024 18:21
@czeslavo czeslavo requested a review from a team as a code owner May 13, 2024 18:21
@czeslavo czeslavo force-pushed the feat/generate-config-graph branch 2 times, most recently from 418561c to 0088c60 Compare May 14, 2024 13:08
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

Definite change request on the units having multiple expected children for one to many dependency relationships, maybe change request on the template approach.


If we do need templates: my kingdom for Github/editors having the ability to syntax highlight templated Go code and my not needing to copy it into something else and remove the string delimiters. How do we not have a

// syntaxhint:go
`// Code generated by hack/generators/config-graph; DO NOT EDIT.
package fallback
import (
	"errors"
...
`

that understands "oh, Go with templating occasionally, use (mostly) Go syntax highlighting rules" instead of magic AI code writing assistants? I want to read code more quickly, not write code more quickly, damnit.

internal/dataplane/fallback/graph_dependencies.go Outdated Show resolved Hide resolved
hack/generators/config-graph/main.go Outdated Show resolved Hide resolved
@czeslavo czeslavo force-pushed the feat/generate-config-graph branch 2 times, most recently from d3fc937 to 50a3c2b Compare May 15, 2024 09:49
@czeslavo czeslavo requested a review from rainest May 15, 2024 09:55
Copy link

codecov bot commented May 15, 2024

Codecov Report

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

Project coverage is 73.1%. Comparing base (6e16f27) to head (ed8b7a1).

❗ Current head ed8b7a1 differs from pull request most recent head 8df360c. Consider uploading reports for the commit 8df360c to get more accurate results

Files Patch % Lines
internal/dataplane/fallback/graph.go 66.6% 6 Missing and 6 partials ⚠️
...l/dataplane/fallback/graph_dependencies_ingress.go 88.4% 4 Missing and 2 partials ⚠️
internal/dataplane/fallback/graph_dependencies.go 92.8% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           main   #6010      +/-   ##
=======================================
+ Coverage      0   73.1%   +73.1%     
=======================================
  Files         0     188     +188     
  Lines         0   18513   +18513     
=======================================
+ Hits          0   13539   +13539     
- Misses        0    4034    +4034     
- Partials      0     940     +940     

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

@czeslavo czeslavo force-pushed the feat/generate-config-graph branch 2 times, most recently from e665105 to ed8b7a1 Compare May 15, 2024 13:35
programmer04
programmer04 previously approved these changes May 15, 2024
@czeslavo czeslavo force-pushed the feat/generate-config-graph branch from 975ed51 to 8df360c Compare May 15, 2024 14:01
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

Think we're clear here, approving without merging in case there's anything further @programmer04 wanted to wrap up in #6010 (comment)

@czeslavo czeslavo enabled auto-merge (squash) May 16, 2024 07:56
@czeslavo czeslavo merged commit 7814be3 into main May 16, 2024
36 checks passed
@czeslavo czeslavo deleted the feat/generate-config-graph branch May 16, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/feature New feature or request size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants