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

New ConceptPass based on tasks #2096

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

New ConceptPass based on tasks #2096

wants to merge 4 commits into from

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Mar 2, 2025

This PR introduces a Task, which is a granular sub-functionality within a certain Pass. The idea is that big passes, such as the one dealing with concepts can divide their work into small sub-items, while still only iterating through the graph once.

In case of the ConceptPass this allows us to traverse the whole graph via EOG and perform different concept-related things "in-place" where they should happen. This now should make it possible to do things like, read a config, provide dynamic loading based on the config and then read a config again in a later EOG path. This was not possible with the previous approach where load config and dynamic loading where distinct passes that could only be performed once.

This PR might be too big to merge-in at once, so this could possibly be split up in multiple pieces:

@oxisto oxisto force-pushed the concept-eog-pass branch from 11a3df7 to 9be6bb3 Compare March 2, 2025 00:07
Copy link

codecov bot commented Mar 2, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 48 lines in your changes missing coverage. Please review.

Project coverage is 78.53%. Comparing base (2afc88d) to head (e1c8882).

Files with missing lines Patch % Lines
...ec/cpg/passes/concepts/config/ProvideConfigTask.kt 66.07% 10 Missing and 9 partials ⚠️
...cepts/config/ini/IniFileConfigurationSourceTask.kt 67.39% 10 Missing and 5 partials ⚠️
...asses/concepts/memory/cxx/CXXDynamicLoadingTask.kt 60.00% 0 Missing and 8 partials ⚠️
...raunhofer/aisec/cpg/passes/concepts/ConceptPass.kt 88.23% 1 Missing and 1 partial ⚠️
...n/de/fraunhofer/aisec/cpg/passes/ImportResolver.kt 66.66% 0 Missing and 2 partials ⚠️
...main/kotlin/de/fraunhofer/aisec/cpg/passes/Pass.kt 95.65% 0 Missing and 1 partial ⚠️
...sec/cpg/passes/configuration/PassOrderingHelper.kt 88.88% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...r/aisec/cpg/graph/concepts/config/Configuration.kt 100.00% <100.00%> (ø)
...pts/config/python/PythonStdLibConfigurationTask.kt 63.76% <100.00%> (ø)
...cpg/passes/concepts/flows/cxx/CXXEntryPointTask.kt 80.00% <100.00%> (ø)
...in/kotlin/de/fraunhofer/aisec/cpg/MermaidHelper.kt 85.29% <ø> (ø)
...e/fraunhofer/aisec/cpg/TranslationConfiguration.kt 94.44% <100.00%> (+0.02%) ⬆️
...ain/kotlin/de/fraunhofer/aisec/cpg/helpers/Util.kt 60.63% <100.00%> (ø)
...c/cpg/passes/configuration/PassWithDependencies.kt 100.00% <100.00%> (ø)
...main/kotlin/de/fraunhofer/aisec/cpg/passes/Pass.kt 76.55% <95.65%> (+2.95%) ⬆️
...sec/cpg/passes/configuration/PassOrderingHelper.kt 81.25% <88.88%> (-0.39%) ⬇️
...raunhofer/aisec/cpg/passes/concepts/ConceptPass.kt 90.47% <88.23%> (+8.12%) ⬆️
... and 4 more

... and 2 files with indirect coverage changes

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

@oxisto oxisto marked this pull request as ready for review March 2, 2025 00:17
oxisto and others added 4 commits March 2, 2025 08:59
… of the whole config

This makes the API a little bit cleaner since we do not need to pass the conf object, which is already known and it attaches the operations to their respective counterparts, e.g. reading an option is an operation on an option now and not of the overall configuraton. It also introduces `allOps` as a way to get all the operations of the whole config again.
@oxisto oxisto force-pushed the concept-eog-pass branch from 9be6bb3 to e1c8882 Compare March 2, 2025 07:59
@oxisto oxisto marked this pull request as draft March 2, 2025 08:14
@oxisto
Copy link
Member Author

oxisto commented Mar 2, 2025

Reverting this back to draft since this needs more work and possibly the split between a concept and operation pass. I will prepare a separate PR for the "Task" stuff.

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