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

Only store ctx in handlers, frontends and passes #2126

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Mar 11, 2025

This is a HUGE breaking change in which we only make the TranslationContext available to handlers, frontends and passes. No storing ctx in the node any more - which had issues because we were not storing it correctly in ALL nodes.

(Unfortunately) this also made a change in the TypeManager necessary: Instead of the registerType function (which was always error-prone), we gather our types in the TypeResolver and store the information about (resolved) types in the TypeManager. This also has the advantage that we are now resolving types of each component sequentially. Beforehand, we were trying to resolving all types in all components (which was unnecessary because they were already resolved) and the information to which component it belongs was lost.

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 76.14035% with 68 lines in your changes missing coverage. Please review.

Project coverage is 78.63%. Comparing base (4ce9758) to head (f41e902).

Files with missing lines Patch % Lines
...aisec/cpg/frontends/java/JavaCallResolverHelper.kt 44.11% 8 Missing and 11 partials ⚠️
...lin/de/fraunhofer/aisec/cpg/passes/TypeResolver.kt 58.33% 14 Missing and 1 partial ⚠️
...ain/kotlin/de/fraunhofer/aisec/cpg/ScopeManager.kt 88.46% 1 Missing and 5 partials ⚠️
...tlin/de/fraunhofer/aisec/cpg/frontends/Language.kt 61.53% 2 Missing and 3 partials ⚠️
...fer/aisec/cpg/frontends/jvm/JVMLanguageFrontend.kt 0.00% 2 Missing and 2 partials ⚠️
...e/fraunhofer/aisec/cpg/TranslationConfiguration.kt 0.00% 0 Missing and 1 partial ⚠️
...tlin/de/fraunhofer/aisec/cpg/TranslationContext.kt 75.00% 0 Missing and 1 partial ⚠️
...tlin/de/fraunhofer/aisec/cpg/TranslationManager.kt 66.66% 1 Missing ⚠️
...e/fraunhofer/aisec/cpg/graph/DeclarationBuilder.kt 0.00% 0 Missing and 1 partial ⚠️
...otlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt 75.00% 0 Missing and 1 partial ⚠️
... and 14 more
Additional details and impacted files
Files with missing lines Coverage Δ
.../aisec/cpg/graph/concepts/memory/DynamicLoading.kt 76.19% <ø> (ø)
...otlin/de/fraunhofer/aisec/cpg/TranslationResult.kt 78.12% <100.00%> (+2.36%) ⬆️
...main/kotlin/de/fraunhofer/aisec/cpg/TypeManager.kt 85.85% <100.00%> (-0.94%) ⬇️
...otlin/de/fraunhofer/aisec/cpg/frontends/Handler.kt 46.87% <ø> (ø)
...fraunhofer/aisec/cpg/frontends/LanguageFrontend.kt 70.58% <ø> (ø)
...e/fraunhofer/aisec/cpg/frontends/LanguageTraits.kt 100.00% <ø> (ø)
.../kotlin/de/fraunhofer/aisec/cpg/graph/Component.kt 100.00% <100.00%> (+10.00%) ⬆️
...de/fraunhofer/aisec/cpg/graph/ExpressionBuilder.kt 91.05% <ø> (-0.07%) ⬇️
.../main/kotlin/de/fraunhofer/aisec/cpg/graph/Node.kt 86.95% <100.00%> (+2.01%) ⬆️
...in/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt 86.56% <100.00%> (-0.03%) ⬇️
... and 74 more

... and 3 files with indirect coverage changes

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oxisto oxisto marked this pull request as ready for review March 12, 2025 10:17
@oxisto oxisto force-pushed the cb/no-ctx-in-node branch from 2326d82 to 6921e49 Compare March 12, 2025 10:19
@oxisto oxisto requested a review from Copilot March 12, 2025 10:22

Choose a reason for hiding this comment

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

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

@oxisto oxisto force-pushed the cb/no-ctx-in-node branch from 17832c3 to 90cbd1e Compare March 12, 2025 11:03
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