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

CloudPG v8 Upgrade #62

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

CloudPG v8 Upgrade #62

wants to merge 46 commits into from

Conversation

CodingDepot
Copy link
Collaborator

@CodingDepot CodingDepot commented Aug 10, 2023

This PR aims to upgrade the CPG-dependency to version 7 while still maintaining the full functionality of the CloudPG.
The work done in this PR also includes changes from @oxisto to #58.

This PR is still WIP, necessary steps include:

  • Fix compilation errors
  • Use new "Name" classes for Nodes
  • Update the included RubyLanguage
  • Go: Specify a working pass evaluation order so that no Nodes are missing
  • Go: Make sure a valid path from the Label to the goal is formed and all respective tests pass
  • Python: Specify a working pass evaluation order so that no Nodes are missing
  • Python: Make sure a valid path from the Label to the goal is formed and all respective tests pass

CodingDepot and others added 12 commits July 17, 2023 10:49
* updated version in build.gradle.kts

* added new typescript module

* bump java target form 11 to 17

* remove experimental opt-ins and comment out various error sources for now

* replace String representation by Direction value and remove warning in check

* simplify equality check

* replace String value by Direction

* replace String value by Direction

* removed imports

* fixed many incompatibilities between Name and String by reading the localName and creating new Name objects without parents where needed

* added FIXME statements

* fix all remaining errors regarding Name and String types

* fix the creation of new Statements in all Handlers

* apply spotless

* fixed rest of the references in the handlers

* bumped CPG from 6.2.0 to 6.2.2 to solve issue of TranslationResult.additionalNodes not being mutable

* fix inheritance of the frontend

* trying to fix Azure.kt by replacing every instance of CallExpression.base by CallExpression.callee

* immediately bump CPG version to 7.0.0 in order to save redundant work on passes

* adapt all passes to the new structure in CPG 7.0.0

* fix pass registration to work with CPG 7.0.0

* add RubyLanguage.kt

* bump neo4j to version 4.0.5 to fix NoSuchMethod-Errors

* manually register the default Languages

* correcly overwrite visit in all IVisitors.
Also stop trying to get "additionalNodes" from scratch since they are now a part of the result

* split the searches again to prevent any order errors

* make spotless

* add comments

* apply various fixes from oxisto's branch "cpg-v6"

* fix order of evaluation leading to NPE

* made code resistant against unsafe casts, null values, empty lists. Also added comments in these places.

* remove unused import

* replace calls of deprecated TranslationResult.translationUnits

* remove heaps of warnings concerning unused variables/parameters and deprecated calls

* correctly override additional "visit" functions

* fix typo

* manage debugging comments

* add full request name parsing that was not working in previous versions

* add comments regarding (missing) functionality

* return all visitors into its original form, this prevents any subclasses from being visited as well

* manually register the GoExtraPass

* move defaultPasses after language registrations
@CodingDepot CodingDepot self-assigned this Aug 10, 2023
@CodingDepot
Copy link
Collaborator Author

CodingDepot commented Aug 21, 2023

Main problems at the moment seem to be:

  • RequestPass.kt (line 53)
  • GinGonicPass.kt (line 122)

In both locations, trying to dereference a DeclaredReferenceExpression fails as the "refersTo" field is always null.

Edit:
The CryptographyPass (line 36) suffers from the same issue.
Interestingly, GoCryptoPass (line 46) does not after adding the GoExtraPass as a dependency.

@CodingDepot
Copy link
Collaborator Author

CodingDepot commented Aug 24, 2023

The problem in the RequestPass (for python requests) can be fixed by making it depend on the GoExtraPass.

@oxisto
Copy link
Member

oxisto commented Aug 24, 2023

The problem in the RequestPass (for python requests) can be fixed by making it depend on the GoExtraPass.

This sound strange. I suspect that the general order of passes ist still incorrect. I can try to have a look later.

@oxisto
Copy link
Member

oxisto commented Aug 24, 2023

The problem in the RequestPass (for python requests) can be fixed by making it depend on the GoExtraPass.

This sound strange. I suspect that the general order of passes ist still incorrect. I can try to have a look later.

After a quick look, I would suggest that all of these special passes should depend on at least the VariableUsageResolver and the CallResolver.

We should probably add a new base class that all of those passes derive from and add the annotation to that base class.

@CodingDepot CodingDepot mentioned this pull request Nov 15, 2023
5 tasks
@immqu immqu changed the title CloudPG v7 Upgrade CloudPG v8 Upgrade Jul 23, 2024
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.

5 participants