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

Enable the ContextualLibrary #92

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Enable the ContextualLibrary #92

merged 1 commit into from
Jan 23, 2024

Conversation

shuheiktgw
Copy link
Contributor

Enabled the ContextualLibrary I've added in #89.

@@ -35,7 +38,7 @@ func IsStandardLibraryType(typeName string) bool {
}

func (lib *Library) LibraryName() string {
return "grpc.federation"
return lib.name
Copy link
Contributor Author

@shuheiktgw shuheiktgw Jan 23, 2024

Choose a reason for hiding this comment

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

I've noticed that we cannot use the same library name between the static and contextual libraries since the libraries are singleton and hence immutable.

https://github.com/google/cel-go/blob/df072086206afaba0112df1facdd7cf7183af8a3/cel/library.go#L76-L81

I've circumvented the problem by using the different names between the two. Another option may be to stop using the SingletonLibrary interface, but what do you think? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

The library name does not affect the gRPC Federation's user, so I think this is good 👍

Copy link

Code Metrics Report

main (203b2fe) #92 (df31dbf) +/-
Coverage 64.4% 64.4% -0.0%
Code to Test Ratio 1:0.5 1:0.5 -0.0
Test Execution Time 3m33s 3m23s -10s
Details
  |                     | main (203b2fe) | #92 (df31dbf) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          64.4% |         64.4% | -0.0% |
  |   Files             |             62 |            62 |     0 |
  |   Lines             |           8848 |          8851 |    +3 |
+ |   Covered           |           5700 |          5701 |    +1 |
- | Code to Test Ratio  |          1:0.5 |         1:0.5 |  -0.0 |
  |   Code              |          24692 |         24701 |    +9 |
+ |   Test              |          11255 |         11258 |    +3 |
+ | Test Execution Time |          3m33s |         3m23s |  -10s |

Code coverage of files in pull request scope (77.6% → 77.6%)

Files Coverage +/-
grpc/federation/cel.go 0.0% 0.0%
grpc/federation/cel/lib.go 100.0% +6.2%
resolver/resolver.go 88.0% 0.0%

Reported by octocov

@goccy goccy merged commit 99831d8 into main Jan 23, 2024
4 checks passed
@goccy goccy deleted the set_contextual_lib branch January 23, 2024 10:36
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.

None yet

2 participants