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 generated codes #82

Merged
merged 1 commit into from
Dec 26, 2023
Merged

Refactor generated codes #82

merged 1 commit into from
Dec 26, 2023

Conversation

goccy
Copy link
Member

@goccy goccy commented Dec 26, 2023

Simplify auto-generated code by generics

  • Use the EvalDef function to evaluate def block
  • Use the EvalDefMap function to evaluate def with map expr
  • Introduce a LocalValue structure to hide lock and CEL-related logic

Copy link

Code Metrics Report

main (f605c26) #82 (fb3d94d) +/-
Coverage 65.6% 64.3% -1.3%
Code to Test Ratio 1:0.4 1:0.5 +0.0
Test Execution Time 3m19s 3m24s +5s
Details
  |                     | main (f605c26) | #82 (fb3d94d) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          65.6% |         64.3% | -1.3% |
  |   Files             |             60 |            61 |    +1 |
  |   Lines             |           8727 |          8878 |  +151 |
- |   Covered           |           5724 |          5708 |   -16 |
+ | Code to Test Ratio  |          1:0.4 |         1:0.5 |  +0.0 |
  |   Code              |          25503 |         24715 |  -788 |
  |   Test              |          11161 |         11161 |     0 |
- | Test Execution Time |          3m19s |         3m24s |   +5s |

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

Files Coverage +/-
generator/code_generator.go 84.5% -1.4%
grpc/federation/cel.go 0.0% 0.0%
grpc/federation/error.go 0.0% 0.0%
grpc/federation/validation.go 0.0% 0.0%

Reported by octocov

"google.golang.org/genproto/googleapis/rpc/errdetails"
)

type PreconditionFailureViolation struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

naruhodo...

Copy link
Contributor

@shuheiktgw shuheiktgw left a comment

Choose a reason for hiding this comment

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

LGTM 🙆‍♂️

@goccy goccy merged commit 7a390f6 into main Dec 26, 2023
4 checks passed
@goccy goccy deleted the refactor branch December 26, 2023 11:16
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