Repository navigation
feat(cel): restore ap./nn. namespace aliases for backward compatibility #901
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Suppress SA1019 at these call sites, otherwise lint fails.
golangci-lint reports SA1019 for lines 72 and 73, because
containerprofile.APandcontainerprofilenetwork.NNcarryDeprecated:markers. This registration is the intended call site, so add a targeted suppression instead of removing the calls. Keep the suppression narrow, so that other deprecated usages still fail lint.🔧 Proposed fix for the lint errors
📝 Committable suggestion
🧰 Tools
🪛 golangci-lint (2.12.2)
[error] 72-72: SA1019: containerprofile.AP is deprecated: #864 renamed the ap./nn. CEL helper namespaces to cp.* with no backward-compatible aliases, which silently disabled any pre-existing user-authored CEL rule still referencing the old names (pkg/utils/cel.go logs a warning and just skips the rule on compile failure). AP restores those names for a transition window: it shares the same containerProfileLibrary instance and the same funcSpecs table as cp., so every ap. call is wired to the exact same Go implementation (l.wasExecuted, l.wasPathOpened, ...) as its cp.* equivalent — only the CEL-facing function name and overload id differ (cel-go requires overload ids to be unique per environment, so ap.* can't literally reuse cp.'s FunctionOpt values). Remove once user rules have migrated to cp..
(staticcheck)
[error] 73-73: SA1019: containerprofilenetwork.NN is deprecated: #864 renamed the ap./nn. CEL helper namespaces to cp.* with no backward-compatible aliases, which silently disabled any pre-existing user-authored CEL rule still referencing the old names (pkg/utils/cel.go logs a warning and just skips the rule on compile failure). NN restores those names for a transition window: it shares the same containerProfileNetworkLibrary instance and the same funcSpecs table as cp., so every nn. call is wired to the exact same Go implementation (l.wasAddressInEgress, l.isDomainInEgress, ...) as its cp.* equivalent — only the CEL-facing function name and overload id differ (cel-go requires overload ids to be unique per environment, so nn.* can't literally reuse cp.'s FunctionOpt values). Remove once user rules have migrated to cp..
(staticcheck)
🤖 Prompt for AI Agents
Source: Linters/SAST tools