Skip to content

Commit

Permalink
feat: added common lib for ingestion and query utility
Browse files Browse the repository at this point in the history
  • Loading branch information
JayGhiya committed Oct 23, 2024
1 parent a84cc68 commit f5058fb
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/configuration/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": true,
"component": "unoplat-code-confluence-query-engine"
},
"unoplat-code-confluence-commons": {
"release-type": "python",
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": true,
"component": "unoplat-code-confluence-commons"
}
}
}
1 change: 1 addition & 0 deletions .github/workflows/python_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- 'unoplat-code-confluence/**'
- 'unoplat-code-confluence-query-engine/**'
- 'unoplat-code-confluence-commons/**'
jobs:
prepare-matrix:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python_publish_release_management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
with:
poetry-version: "1.8.3"
- name: Build poetry
working-directory: unoplat-code-confluence
working-directory: ${{ matrix.path }}
run: poetry build -f wheel

# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: unoplat-code-confluence/dist
# packages-dir: ${{ matrix.path }}/dist

Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from neomodel import (
StructuredNode,
StringProperty,
JSONProperty,
ArrayProperty,
StructuredRel
)

class BaseNode(StructuredNode):
"""Base node with common properties"""
qualified_name = StringProperty(unique_index=True, required=True)
objective_embedding = ArrayProperty(default=[])
implementation_embedding = ArrayProperty(default=[])

class ContainsRelationship(StructuredRel):
"""Relationship for representing containment between nodes"""
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .base_models import BaseNode, ContainsRelationship
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One

class Class(BaseNode):
"""Represents a class in a package"""
node_name = StringProperty(required=True)
node_summary = StringProperty(default="")
node_objective = StringProperty(default="")
# Class relationships
package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=One)
methods = RelationshipTo('Method', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from neomodel import (
StringProperty,
RelationshipTo,
RelationshipFrom,
ZeroOrMore,
One
)
from .base_models import BaseNode, ContainsRelationship

class Codebase(BaseNode):
"""Represents a codebase in the system"""
codebase_summary = StringProperty(default="")
codebase_objective = StringProperty(default="")
# One codebase can contain multiple packages
packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)



Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .base_models import BaseNode, ContainsRelationship
from neomodel import RelationshipFrom, StringProperty,One

class Method(BaseNode):
"""Represents a method in a class"""
function_name = StringProperty(required=True)
function_summary = StringProperty(default="")
# Method relationships
class_ = RelationshipFrom('Class', 'CONTAINS', model=ContainsRelationship, cardinality=One)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from .base_models import BaseNode, ContainsRelationship
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One

class Package(BaseNode):
"""Represents a package in the codebase"""
package_objective = StringProperty(required=True)
package_summary = StringProperty(required=True)
# Package relationships
codebase = RelationshipFrom('Codebase', 'CONTAINS', model=ContainsRelationship, cardinality=One)
sub_packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
parent_package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
classes = RelationshipTo('Class', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)

0 comments on commit f5058fb

Please sign in to comment.