Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 8fad28aa authored by GotthardG's avatar GotthardG
Browse files

Sync project metadata with `pyproject.toml`

Updated scripts and backend to dynamically retrieve project name and version from `pyproject.toml`. This ensures consistent metadata across the OpenAPI client generation and the FastAPI application.
parent d3d87dc9
No related branches found
No related tags found
No related merge requests found
Pipeline #44749 passed
......@@ -3,15 +3,16 @@
# Extract values from pyproject.toml
PYPROJECT_FILE="$(dirname "$0")/pyproject.toml"
VERSION=$(grep -Po '(?<=version = ")[^"]*' "$PYPROJECT_FILE")
NAME=$(grep -Po '(?<=name = ")[^\"]*' "$PYPROJECT_FILE" | sed 's/[^a-zA-Z0-9_-]//g') # Extract name and sanitize it
# Extract name directly and ignore newlines
NAME=$(awk -F'=' '/^name/ { gsub(/"/, "", $2); print $2 }' "$PYPROJECT_FILE" | xargs)
VERSION=$(awk -F'=' '/^version/ { gsub(/"/, "", $2); print $2 }' "$PYPROJECT_FILE" | xargs)
if [[ -z "$VERSION" || -z "$NAME" ]]; then
echo "Error: Could not determine version or name from pyproject.toml"
exit 1
fi
# Ensure NAME is valid (no special characters or newlines)
# Ensure the extracted name is valid (No spaces or unexpected characters)
if ! [[ "$NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then
echo "Error: Invalid project name detected: '$NAME'"
exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment