Skip to content

Commit 27616d0

Browse files
authored
Merge branch 'main' into feature/mcpgateway.translate
2 parents d66ebc6 + 77e22fc commit 27616d0

File tree

239 files changed

+18817
-6608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+18817
-6608
lines changed

.bumpversion.cfg

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
[bumpversion]
2-
current_version = 0.1.0
3-
commit = False
4-
tag = False
5-
sign-tags = True
6-
tag_name = v{new_version} # tag format (only used if you flip tag=True later)
7-
8-
# SemVer parsing/serialising
9-
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
2+
current_version = 0.2.0
3+
commit = False
4+
tag = False
5+
sign-tags = True
6+
tag_name = v{new_version} # tag format (only used if you flip tag=True later)
7+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
108
serialize =
119
{major}.{minor}.{patch}
1210

1311
[bumpversion:file:mcpgateway/__init__.py]
14-
search = __version__ = "{current_version}"
12+
search = __version__ = "{current_version}"
1513
replace = __version__ = "{new_version}"
1614

1715
[bumpversion:file:Containerfile]
18-
search = version="{current_version}"
16+
search = version="{current_version}"
1917
replace = version="{new_version}"
2018

2119
[bumpversion:file:Containerfile.lite]
22-
search = version="{current_version}"
20+
search = version="{current_version}"
2321
replace = version="{new_version}"
2422

2523
[bumpversion:file:pyproject.toml]
26-
search = version = "{current_version}"
24+
search = version = "{current_version}"
2725
replace = version = "{new_version}"

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
},
2626
"remoteEnv": {
2727
"MCPGATEWAY_DEV_MODE": "true",
28-
"VENV_DIR": "/Users/mg/.venv/mcpgateway"
28+
"VENV_DIR": "$HOME/.venv/mcpgateway"
2929
}
3030
}

.devcontainer/postCreateCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fi
1111
make install-dev
1212

1313
# Run tests to verify setup
14-
make test
14+
# make test
1515

1616
echo "Devcontainer setup complete."
1717

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Dockerfile
2+
Dockerfile.*
3+
Containerfile.*
4+
.devcontainer
15
.github
26
docker-compose.yml
37
podman-compose-sonarqube.yaml

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ WEBSOCKET_PING_INTERVAL=30
140140
# SSE client retry timeout (milliseconds)
141141
SSE_RETRY_TIMEOUT=5000
142142

143+
144+
#####################################
145+
# Streamabe HTTP Transport Configuration
146+
#####################################
147+
148+
# Set False to use stateless sessions without event store and True for stateful sessions
149+
USE_STATEFUL_SESSIONS=false
150+
151+
# Set true for JSON responses, false for SSE streams
152+
JSON_RESPONSE_ENABLED=true
153+
154+
143155
#####################################
144156
# Federation
145157
#####################################
@@ -232,3 +244,6 @@ RELOAD=false
232244

233245
# Enable verbose logging/debug traces
234246
DEBUG=false
247+
248+
# Gateway tool name separator
249+
GATEWAY_TOOL_NAME_SEPARATOR=-

.github/CODEOWNERS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# All files in the repo
22
* @crivetimihai
33

4-
# Ownership for the mcpgateway-wrapper
5-
/mcpgateway-wrapper/ @crivetimihai @kevalmahajan @madhav165
6-
74
# Ownership for all tests
85
/tests/ @crivetimihai @kevalmahajan @madhav165

.github/ISSUE_TEMPLATE/bug-report-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Select the area of the project impacted:
1717

1818
- [ ] `mcpgateway` - API
1919
- [ ] `mcpgateway` - UI (admin panel)
20-
- [ ] `mcpgateway-wrapper` - stdio wrapper
20+
- [ ] `mcpgateway.wrapper` - stdio wrapper
2121
- [ ] Federation or Transports
2222
- [ ] CLI, Makefiles, or shell scripts
2323
- [ ] Container setup (Docker/Podman/Compose)

.github/tools/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
changelog_info.txt

.github/tools/cleanup.sh

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#!/usr/bin/env bash
2+
#───────────────────────────────────────────────────────────────────────────────
3+
# Script : cleanup.sh
4+
# Author : Mihai Criveti
5+
# Purpose: Prune old or unused GHCR container versions for IBM's MCP Context Forge
6+
# Copyright 2025
7+
# SPDX-License-Identifier: Apache-2.0
8+
#
9+
# Description:
10+
# This script safely manages container versions in GitHub Container Registry
11+
# (ghcr.io) under the IBM organization, specifically targeting the
12+
# `mcp-context-forge` package. It supports interactive and non-interactive
13+
# deletion modes to help you keep the container registry clean.
14+
#
15+
# Features:
16+
# • Dry-run by default to avoid accidental deletion
17+
# • Tag whitelisting with regular expression matching
18+
# • GitHub CLI integration with scope validation
19+
# • CI/CD-compatible via environment overrides
20+
#
21+
# Requirements:
22+
# • GitHub CLI (gh) v2.x with appropriate scopes
23+
# • jq (command-line JSON processor)
24+
#
25+
# Required Token Scopes:
26+
# delete:packages
27+
#
28+
# Authentication Notes:
29+
# Authenticate with:
30+
# gh auth refresh -h github.com -s read:packages,delete:packages
31+
# Or:
32+
# gh auth logout
33+
# gh auth login --scopes "read:packages,delete:packages,write:packages,repo,read:org,gist"
34+
#
35+
# Verify authentication with:
36+
# gh auth status -t
37+
#
38+
# Environment Variables:
39+
# GITHUB_TOKEN / GH_TOKEN : GitHub token with required scopes
40+
# DRY_RUN : Set to "false" to enable actual deletions (default: true)
41+
#
42+
# Usage:
43+
# ./cleanup.sh # Dry-run with confirmation prompt
44+
# DRY_RUN=false ./cleanup.sh --yes # Actual deletion without prompt (for CI)
45+
#
46+
#───────────────────────────────────────────────────────────────────────────────
47+
48+
set -euo pipefail
49+
50+
##############################################################################
51+
# 1. PICK A TOKEN
52+
##############################################################################
53+
NEEDED_SCOPES="delete:packages"
54+
55+
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
56+
TOKEN="$GITHUB_TOKEN"
57+
elif [[ -n "${GH_TOKEN:-}" ]]; then
58+
TOKEN="$GH_TOKEN"
59+
else
60+
# fall back to whatever gh already has
61+
if ! TOKEN=$(gh auth token 2>/dev/null); then
62+
echo "❌ No token exported and gh not logged in. Fix with:"
63+
echo " gh auth login (or export GITHUB_TOKEN)"
64+
exit 1
65+
fi
66+
fi
67+
export GH_TOKEN="$TOKEN" # gh api uses this
68+
69+
# Fixed scope checking - check for both required scopes individually
70+
if scopes=$(gh auth status --show-token 2>/dev/null | grep -oP 'Token scopes: \K.*' || echo ""); then
71+
missing_scopes=()
72+
73+
# if ! echo "$scopes" | grep -q "read:packages"; then
74+
# missing_scopes+=("read:packages")
75+
# fi
76+
77+
if ! echo "$scopes" | grep -q "delete:packages"; then
78+
missing_scopes+=("delete:packages")
79+
fi
80+
81+
if [[ ${#missing_scopes[@]} -gt 0 ]]; then
82+
echo "⚠️ Your token scopes are [$scopes] – but you're missing: [$(IFS=','; echo "${missing_scopes[*]}")]"
83+
echo " Run: gh auth refresh -h github.com -s $NEEDED_SCOPES"
84+
exit 1
85+
fi
86+
else
87+
echo "⚠️ Could not verify token scopes. Proceeding anyway..."
88+
fi
89+
90+
##############################################################################
91+
# 2. CONFIG
92+
##############################################################################
93+
ORG="ibm"
94+
PKG="mcp-context-forge"
95+
KEEP_TAGS=( "0.1.0" "v0.1.0" "0.1.1" "v0.1.1" "0.2.0" "v0.2.0" "latest" )
96+
PER_PAGE=100
97+
98+
DRY_RUN=${DRY_RUN:-true} # default safe
99+
ASK_CONFIRM=true
100+
[[ ${1:-} == "--yes" ]] && ASK_CONFIRM=false
101+
KEEP_REGEX="^($(IFS='|'; echo "${KEEP_TAGS[*]}"))$"
102+
103+
##############################################################################
104+
# 3. MAIN
105+
##############################################################################
106+
delete_ids=()
107+
108+
echo "📦 Scanning ghcr.io/${ORG}/${PKG}"
109+
110+
# Process versions and collect IDs to delete
111+
while IFS= read -r row; do
112+
id=$(jq -r '.id' <<<"$row")
113+
digest=$(jq -r '.digest' <<<"$row")
114+
tags_csv=$(jq -r '.tags | join(",")' <<<"$row")
115+
keep=$(jq -e --arg re "$KEEP_REGEX" 'any(.tags[]?; test($re))' <<<"$row" 2>/dev/null) || keep=false
116+
117+
if [[ $keep == true ]]; then
118+
printf "✅ KEEP %s [%s]\n" "$digest" "$tags_csv"
119+
else
120+
printf "🗑️ DELETE %s [%s]\n" "$digest" "$tags_csv"
121+
delete_ids+=("$id")
122+
fi
123+
done < <(gh api -H "Accept: application/vnd.github+json" \
124+
"/orgs/${ORG}/packages/container/${PKG}/versions?per_page=${PER_PAGE}" \
125+
--paginate | \
126+
jq -cr --arg re "$KEEP_REGEX" '
127+
.[] |
128+
{
129+
id,
130+
digest: .metadata.container.digest,
131+
tags: (.metadata.container.tags // [])
132+
}
133+
')
134+
135+
##############################################################################
136+
# 4. CONFIRMATION & DELETION
137+
##############################################################################
138+
if [[ ${#delete_ids[@]} -eq 0 ]]; then
139+
echo "✨ Nothing to delete!"
140+
exit 0
141+
fi
142+
143+
if [[ $DRY_RUN == true ]]; then
144+
if [[ $ASK_CONFIRM == true ]]; then
145+
echo
146+
read -rp "Proceed to delete the ${#delete_ids[@]} versions listed above? (y/N) " reply
147+
[[ $reply =~ ^[Yy]$ ]] || { echo "Aborted – nothing deleted."; exit 0; }
148+
fi
149+
echo "🚀 Re-running in destructive mode …"
150+
DRY_RUN=false exec "$0" --yes
151+
else
152+
echo "🗑️ Deleting ${#delete_ids[@]} versions..."
153+
for id in "${delete_ids[@]}"; do
154+
if gh api -X DELETE -H "Accept: application/vnd.github+json" \
155+
"/orgs/${ORG}/packages/container/${PKG}/versions/${id}" >/dev/null 2>&1; then
156+
echo "✅ Deleted version ID: $id"
157+
else
158+
echo "❌ Failed to delete version ID: $id"
159+
fi
160+
done
161+
echo "Done."
162+
fi
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
#
3+
# generate-changelog-info.sh
4+
# Author: Mihai Criveti
5+
#
6+
# Dump to one file:
7+
# 1. Full commit logs since a tag
8+
# 2. A chronologically-sorted list of issues closed since that tag
9+
# 3. Full JSON-formatted details for every one of those issues
10+
#
11+
# Dependencies: git, GitHub CLI (`gh`), jq
12+
# Usage: ./generate-changelog-info.sh [TAG] [OUTPUT_FILE]
13+
# TAG defaults to v0.1.1
14+
# OUTPUT_FILE defaults to changelog_info.txt
15+
#
16+
set -euo pipefail
17+
18+
TAG=${1:-v0.1.1}
19+
OUT=${2:-changelog_info.txt}
20+
21+
###############################################################################
22+
# 1. Commit log
23+
###############################################################################
24+
{
25+
echo "#############################"
26+
echo "## COMMITS since ${TAG}"
27+
echo "#############################"
28+
} >"$OUT"
29+
30+
git log "${TAG}"..HEAD --reverse --no-merges \
31+
--pretty=format:'%H%nAuthor: %an <%ae>%nDate: %ad%n%n%s%n%n%b%n----' \
32+
--date=short >>"$OUT"
33+
34+
###############################################################################
35+
# 2. Closed-issue list (oldest → newest)
36+
###############################################################################
37+
CUTOFF=$(git log -1 --format=%cI "$TAG") # ISO time of the tag
38+
39+
echo -e "\n#############################" >>"$OUT"
40+
echo "## ISSUES closed since ${TAG}" >>"$OUT"
41+
echo "#############################" >>"$OUT"
42+
43+
ISSUES_JSON=$(gh issue list --state closed \
44+
--search "closed:>=$CUTOFF" \
45+
--limit 1000 \
46+
--json number,title,closedAt,url)
47+
48+
echo "$ISSUES_JSON" | jq -r '
49+
sort_by(.closedAt)[]
50+
| "#\(.number) – \(.title) (closed: \(.closedAt))"
51+
' >>"$OUT"
52+
53+
###############################################################################
54+
# 3. Full issue details
55+
###############################################################################
56+
echo -e "\n#############################" >>"$OUT"
57+
echo "## ISSUE DETAILS" >>"$OUT"
58+
echo "#############################" >>"$OUT"
59+
60+
# Extract the numbers, then loop for detailed views
61+
echo "$ISSUES_JSON" | jq -r '.[].number' | while read -r NUM; do
62+
echo -e "\n---- ISSUE #$NUM ----" >>"$OUT"
63+
gh issue view "$NUM" --json number,title,author,labels,assignees,closedAt,createdAt,url,body \
64+
| jq -r '
65+
"Number: \(.number)",
66+
"Title: \(.title)",
67+
"URL: \(.url)",
68+
"Author: \(.author.login // "unknown")",
69+
"Labels: \(.labels | map(.name) | join(", "))",
70+
"Assignees: \(.assignees | map(.login) | join(", "))",
71+
"Created: \(.createdAt)",
72+
"Closed: \(.closedAt)",
73+
"",
74+
"Body:\n" + (.body // "*No description*")
75+
' >>"$OUT"
76+
done
77+
78+
echo -e "\nAll done! Results written to: $OUT"

0 commit comments

Comments
 (0)