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

Fix resolving of CEL plugins for the file #279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

goccy
Copy link
Member

@goccy goccy commented Mar 10, 2025

  • Consider the import path in the order of resolving file references
  • Retrieve the list of CEL plugins used from the file

This comment has been minimized.

Copy link

Code Metrics Report

main (a6f5e1d) #279 (bd7cff9) +/-
Coverage 65.4% 65.4% +0.0%
Code to Test Ratio 1:0.3 1:0.3 -0.1
Test Execution Time 6m55s 7m4s +9s
Details
  |                     | main (a6f5e1d) | #279 (bd7cff9) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          65.4% |          65.4% | +0.0% |
  |   Files             |             78 |             78 |     0 |
  |   Lines             |          13833 |          13840 |    +7 |
+ |   Covered           |           9050 |           9059 |    +9 |
- | Code to Test Ratio  |          1:0.3 |          1:0.3 |  -0.1 |
  |   Code              |          42491 |          42503 |   +12 |
  |   Test              |          15932 |          15932 |     0 |
- | Test Execution Time |          6m55s |           7m4s |   +9s |

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

Files Coverage +/-
resolver/file.go 86.2% -3.2%
resolver/resolver.go 83.7% +0.2%

Reported by octocov

@goccy goccy requested a review from Copilot March 10, 2025 04:49

Choose a reason for hiding this comment

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

PR Overview

This PR fixes the resolution of CEL plugins by refactoring how they are retrieved from each file, ensuring that plugins are correctly gathered via the import file hierarchy and cached appropriately. Key changes include:

  • Adding the AllCELPlugins function to the File type.
  • Removing the old celPluginMap mechanism from Resolver.
  • Updating Resolver methods (resolveFile, resolveService, and createCELEnv) to use the new AllCELPlugins function.

Reviewed Changes

File Description
resolver/file.go Introduces a public AllCELPlugins function to aggregate and sort plugins from the file and its imports.
resolver/resolver.go Removes the celPluginMap caching, adjusts file caching logic, and updates service and environment resolution to use AllCELPlugins.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

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.

1 participant