Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FalkorDB/code-graph-backend
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.1
Choose a base ref
...
head repository: FalkorDB/code-graph-backend
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.2
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 5, 2025

  1. add list commits

    AviAvni committed Mar 5, 2025
    Copy the full SHA
    345e3e9 View commit details
  2. bump version

    AviAvni committed Mar 5, 2025
    Copy the full SHA
    42d13df View commit details

Commits on Mar 6, 2025

  1. Merge pull request #84 from FalkorDB/add-list-commits

    Add list commits
    gkorland authored Mar 6, 2025
    Copy the full SHA
    2d71c19 View commit details
Showing with 40 additions and 1 deletion.
  1. +39 −0 api/index.py
  2. +1 −1 pyproject.toml
39 changes: 39 additions & 0 deletions api/index.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@

from api.analyzers.source_analyzer import SourceAnalyzer
from api.git_utils import git_utils
from api.git_utils.git_graph import GitGraph
from api.graph import Graph, get_repos, graph_exists
from api.info import get_repo_info
from api.llm import ask
@@ -448,3 +449,41 @@ def switch_commit():
}

return jsonify(response), 200

@app.route('/list_commits', methods=['POST'])
@public_access # Apply public access decorator
@token_required # Apply token authentication decorator
def list_commits():
"""
Endpoint to list all commits of a specified repository.
Request JSON Structure:
{
"repo": "repository_name"
}
Returns:
JSON response with a list of commits or an error message.
"""

# Get JSON data from the request
data = request.get_json()

# Validate the presence of the 'repo' parameter
repo = data.get('repo')
if repo is None:
return jsonify({'status': f'Missing mandatory parameter "repo"'}), 400

# Initialize GitGraph object to interact with the repository
git_graph = GitGraph(git_utils.GitRepoName(repo))

# Fetch commits from the repository
commits = git_graph.list_commits()

# Return success response with the list of commits
response = {
'status': 'success',
'commits': commits
}

return jsonify(response), 200
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "code-graph-backend"
version = "0.4.1"
version = "0.4.2"
description = "code_graph is designed to help developers visualize and analyze the structure of their source code. It takes source code as input and generates a graph representation, making it easier to understand relationships and dependencies within the codebase."
authors = ["Roi Lipman <roilipman@gmail.com>"]
readme = "README.md"