Skip to content

feat: --workspace-root makes published file keys and ids repo-relative - #220

Draft
georgesafta wants to merge 1 commit into
mainfrom
feat/add-workspace-root
Draft

georgesafta wants to merge 1 commit into
mainfrom
feat/add-workspace-root

Conversation

@georgesafta

Copy link
Copy Markdown

Motivation and Context

With --workspace-root, symbol_table keys, module ids and every id below them, and artifact keys/paths/ids are relative to the workspace root instead of --input, matching codeanalyzer-java. The re-key happens at emission only: signatures, entrypoint path rules, test-file detection and the cache keep the input-relative key. --input outside the root is an InputError.

How Has This Been Tested?

  • Unit tests
  • compared the output (analysis.json and graph.cypher) before and after the change using the same application to see if anything node, edge is missing and to see if the only change is the id and path.

Breaking Changes

There's a new --workspace-root option and the ids and paths are updated when the option is used. When not used the output stays the same as previously.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Related to: #219

#219)

With --workspace-root, symbol_table keys, module ids and every id below
them, and artifact keys/paths/ids are relative to the workspace root
instead of --input, matching codeanalyzer-java. The re-key happens at
emission only: signatures, entrypoint path rules, test-file detection
and the cache keep the input-relative key. --input outside the root is
an InputError.
@pavuluri

Copy link
Copy Markdown

@georgesafta , again checking the existing neo4j database case. For typescript, we do have the "--eager" to purge - perhaps should document it and require to use it in case there is data already in neo4j.
Also, we prefix the symbol_table keys, but imports[].resolved_module and exports[].resolved_module still appear to use the input-relative paths.

This branch has not been deployed

No deployments
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.

2 participants