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

CodeAnalyzer Update/Download Versioning #58

Open
alibrahimzada opened this issue Oct 26, 2024 · 7 comments
Open

CodeAnalyzer Update/Download Versioning #58

alibrahimzada opened this issue Oct 26, 2024 · 7 comments
Assignees

Comments

@alibrahimzada
Copy link
Contributor

There is a problem when downloading the latest codeanalyzer. In https://github.com/IBM/codenet-minerva-code-analyzer/releases, the last two releases do not have datetime format in the release name (instead its v1.0.1). Also the last release adds an extra -1.0.1 in the .jar file name. As a result this line never becomes True. I think a good solution would be to continue releasing with proper tag name (e.g., YYYYMMDDTHHMMSS) and .jar file name (e.g., codeanalyzer.jar) in https://github.com/IBM/codenet-minerva-code-analyzer, and add a rule to make sure there is no conflict in tag and file names in the future.

@rofrano
Copy link
Member

rofrano commented Oct 26, 2024

Hi @alibrahimzada Thanks for reporting this but this change was made on purpose. You should be using Release v0.1.4 of CLDK and installing it with:

pip install cldk==0.1.4

The commit you pointed to (508b25e) is no longer supported. CLDK also no longer downloads Code Analyzer because the compatible version of codeanalyzer.jar is now package with CLDK in the PyPi package. You will get the correct version when you pip install it.

BTW, Code Analyzer has moved to semantic versioning and no longer uses simple timestamps because they cannot convey the nuance of fixes, features, and breaking changes like semantic versioning can.

@rofrano rofrano closed this as completed Oct 26, 2024
@zhangxii
Copy link

zhangxii commented Nov 4, 2024

Hi @alibrahimzada Thanks for reporting this but this change was made on purpose. You should be using Release v0.1.4 of CLDK and installing it with:

pip install cldk==0.1.4

The commit you pointed to (508b25e) is no longer supported. CLDK also no longer downloads Code Analyzer because the compatible version of codeanalyzer.jar is now package with CLDK in the PyPi package. You will get the correct version when you pip install it.

BTW, Code Analyzer has moved to semantic versioning and no longer uses simple timestamps because they cannot convey the nuance of fixes, features, and breaking changes like semantic versioning can.

Hi, @rofrano , I installed the CLDK with pip, but when running the demo raise a exception, like:

cldk.utils.exceptions.exceptions.CodeanalyzerExecutionException: Command '['java', '-jar', 'None', '-i', '/root/autodl-tmp/commons-cli-rel-commons-cli-1.7.0', '--analysis-level=1']' returned non-zero exit status 1.

I try to download the codeanalyzer.jar directly and pass in the parameters, as follows

analysis = cldk.analysis(project_path=os.getenv("JAVA_APP_PATH"),  analysis_backend_path="/root/autodl-tmp/codellm-devkit/cldk/analysis/java/codeanalyzer/jar")

Although analysis can be initialized, run tothe for loop, the analysis.get_symbol_table() returns a null, resulting in an error.

File "/root/autodl-tmp/codellm-devkit/demo.py", line 89, in <module>
for file_path, class_file in analysis.get_symbol_table().items():
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
AttributeError: 'NoneType' object has no attribute 'items'

I'm sure there's code in the JAVA_APP_PATH folder, but I still get null.

@rofrano
Copy link
Member

rofrano commented Nov 5, 2024

Reopening this to that the team can take a look at it. @rahlk

@rofrano rofrano reopened this Nov 5, 2024
@rahlk
Copy link
Collaborator

rahlk commented Nov 5, 2024

Thanks @alibrahimzada @rofrano, I will investigate this issue.

@rahlk rahlk self-assigned this Nov 5, 2024
@rahlk
Copy link
Collaborator

rahlk commented Nov 12, 2024

@alibrahimzada can you check to see if this issue still persists in the lastest CLDK? (version v0.3.0)

@alibrahimzada
Copy link
Contributor Author

I didn't have any problems when I did pip3 install cldk==0.1.4 as per @rofrano's suggestion. I guess the issue was reopened by @zhangxii.

@rofrano
Copy link
Member

rofrano commented Nov 14, 2024

@alibrahimzada , I reopened if because @zhangxii found a problem that we still need to investigate. I'm glad it's working for you.

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

No branches or pull requests

4 participants