#!/usr/bin/env bash
set -euo pipefail
# Requires an authenticated glab; creates synthetic proof data only.
project_id=$(glab api -X POST projects -f name=proof-linked-row-48696-1204 -f visibility=private -f initialize_with_readme=true | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
glab api -X POST "projects/$project_id/repository/branches" -f branch=develop -f ref=main --silent
glab api -X POST "projects/$project_id/repository/branches" -f branch=feature-old -f ref=main --silent
glab api -X POST "projects/$project_id/repository/files/change.txt" -f branch=feature-old -f content='first line
second line
' -f commit_message='Add sample change' --silent
glab api -X POST "projects/$project_id/merge_requests" -f source_branch=feature-old -f target_branch=main -f title='Old MR title' --silent
printf 'GitLab project id: %s (replace the project id and repository in the scenario for a new run)\n' "$project_id"
