Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7cdad30
Track gopher-orch br_release branch and bump submodule to 0.1.23 (#9)
Jun 17, 2026
d155c19
Bind five new ReActAgent factories in ctypes FFI layer fix (#9)
Jun 17, 2026
ee93259
Expose five new ReActAgent factories on GopherAgent fix (#9)
Jun 17, 2026
4497ac3
Document the builder gap for the new routing factories fix (#9)
Jun 17, 2026
f8c8ac5
Surface the FFI handle type at the package root fix (#9)
Jun 17, 2026
1261c86
Add contract tests for the five new routing factories fix (#9)
Jun 17, 2026
aefecf3
Add Python example for create_with_api_key fix (#9)
Jun 17, 2026
c454665
Add Python example for create_with_server_config fix (#9)
Jun 17, 2026
da74f4b
Add Python example for create_with_server_id fix (#9)
Jun 17, 2026
54a42f5
Add Python example for create_with_server_name fix (#9)
Jun 17, 2026
9d4857c
Add Python example for create_with_gateway_id fix (#9)
Jun 17, 2026
40e628e
Add Python example for create_with_gateway_name fix (#9)
Jun 17, 2026
ccbff9f
Add Python example for create_with_url fix (#9)
Jun 17, 2026
d329df0
Add seven *_run.sh wrappers for the examples/api/ create_by_* set fix…
Jun 17, 2026
3ff7a19
Add examples/api/README.md fix (#9)
Jun 17, 2026
1093243
Auto-populate CHANGELOG.md in dump-version.sh (#9)
Jun 17, 2026
d4a957e
Switch examples/api/ to resolve against PyPI fix (#9)
Jun 18, 2026
256e64b
Format code
Jun 18, 2026
d8ab619
Track gopher-orch main
Jul 28, 2026
8c24d43
Bind optional routing FFI symbols independently
Jul 30, 2026
f7a2b6c
Report missing routing FFI symbols clearly
Jul 30, 2026
18bb5f3
Require routing FFI symbols for factory contract tests
Jul 30, 2026
2a7f4e6
Avoid unreleased routing factory version references
Jul 30, 2026
89e404f
Use reachable tag for release note range
Jul 30, 2026
6582f8d
Derive previous orch version from tagged package
Jul 30, 2026
b476f19
Harden generated release note splicing
Jul 30, 2026
cb238eb
Prefer highest release tag on HEAD
Jul 31, 2026
e202310
Warn on mismatched release tag versions
Jul 31, 2026
c4feb45
Deduplicate API example runners
Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dist/
# Native library directories
native/
test-project-api/
examples/api/test-project-*/

# Python cache
__pycache__/
Expand Down
187 changes: 169 additions & 18 deletions dump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
# 1. Fetch latest version from gopher-orch releases
# 2. Validate and determine the target version
# 3. Update pyproject.toml (main and platform packages)
# 4. Update __init__.py files
# 5. Update CHANGELOG.md ([Unreleased] -> [X.Y.Z] - date)
# 6. Commit the changes
# 4. Auto-populate CHANGELOG.md [Unreleased] section from:
# - git log of this repo since the previous tag
# - the gopher-orch GitHub release notes for the new version
# (manual entries already in [Unreleased] are preserved and shown first)
# 5. Update __init__.py files and platform packages
# 6. Promote [Unreleased] -> [X.Y.Z] - date
# 7. Commit the changes
#
# After running this script:
# 1. Review the changes: git diff HEAD~1
Expand Down Expand Up @@ -148,34 +152,181 @@ if [ "$CURRENT_VERSION" = "$TARGET_VERSION" ]; then
fi

# -----------------------------------------------------------------------------
# Step 4: Check [Unreleased] section has content
# Step 4: Build release notes from git log + gopher-orch release notes
# -----------------------------------------------------------------------------
echo ""
echo -e "${YELLOW}Step 4: Checking [Unreleased] section...${NC}"
echo -e "${YELLOW}Step 4: Building release notes...${NC}"

if [ ! -f "$CHANGELOG_FILE" ]; then
echo -e "${RED}Error: $CHANGELOG_FILE not found${NC}"
exit 1
fi

# Extract content between [Unreleased] and next ## section
UNRELEASED_CONTENT=$(sed -n '/^## \[Unreleased\]/,/^## \[/p' "$CHANGELOG_FILE" | \
grep -v "^## \[" | grep -v "^$" | head -20)
# Fetch tags so PREV_TAG resolution is accurate even on shallow clones
git fetch --tags --quiet 2>/dev/null || true

if [ -z "$UNRELEASED_CONTENT" ]; then
echo -e "${YELLOW}Warning: [Unreleased] section in CHANGELOG.md appears empty${NC}"
echo "You may want to add release notes before continuing."
read -p "Continue anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
# Previous Python tag reachable from HEAD. Prefer the highest version tag
# directly on HEAD when release tags are stacked on one commit; otherwise use
# git describe to keep the range anchored to this branch.
PREV_TAG=$(git tag --points-at HEAD --list 'v*' --sort=-v:refname | head -1)
if [ -z "$PREV_TAG" ]; then
PREV_TAG=$(git describe --tags --abbrev=0 --match 'v*' HEAD 2>/dev/null || true)
fi
if [ -n "$PREV_TAG" ]; then
echo -e " Previous Python tag: ${CYAN}$PREV_TAG${NC}"
PY_RANGE="$PREV_TAG..HEAD"
else
echo -e " Previous Python tag: ${YELLOW}none (first release)${NC}"
PY_RANGE="HEAD"
fi

# Previous gopher-orch version from the package version recorded at the
# previous tag. Extended Python versions are X.Y.Z.E, where X.Y.Z tracks
# gopher-orch.
PREV_GOPHER_ORCH_VERSION=""
if [ -n "$PREV_TAG" ]; then
PREV_PY_VERSION=$(git show "$PREV_TAG:$PYPROJECT_TOML" 2>/dev/null | \
Comment thread
dIvYaNshhh marked this conversation as resolved.
grep -E '^version\s*=' | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
if echo "$PREV_PY_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'; then
PREV_GOPHER_ORCH_VERSION=$(echo "$PREV_PY_VERSION" | \
sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+)(\.[0-9]+)?$/\1/')
PREV_TAG_BASE=$(echo "${PREV_TAG#v}" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
if [ "$PREV_GOPHER_ORCH_VERSION" != "$PREV_TAG_BASE" ]; then
echo -e " ${YELLOW}Warning: $PREV_TAG records package version $PREV_PY_VERSION; tag name and recorded version disagree${NC}"
PREV_GOPHER_ORCH_VERSION=""
fi
elif [ -n "$PREV_PY_VERSION" ]; then
echo -e " ${YELLOW}Warning: could not derive previous gopher-orch version from $PREV_TAG:$PYPROJECT_TOML version '$PREV_PY_VERSION'${NC}"
else
echo -e " ${YELLOW}Warning: could not read previous package version from $PREV_TAG:$PYPROJECT_TOML${NC}"
fi
fi
if [ -n "$PREV_GOPHER_ORCH_VERSION" ]; then
echo -e " Previous gopher-orch: ${CYAN}v$PREV_GOPHER_ORCH_VERSION${NC}"
else
echo -e " Previous gopher-orch: ${YELLOW}unknown${NC}"
fi
echo -e " New gopher-orch: ${GREEN}v$GOPHER_ORCH_VERSION${NC}"

if ! grep -q '^## \[Unreleased\]' "$CHANGELOG_FILE"; then
echo -e "${RED}Error: [Unreleased] section not found in $CHANGELOG_FILE${NC}"
exit 1
fi

# Preserve any manually-authored entries already under [Unreleased]
MANUAL_CONTENT=$(awk '
/^## \[Unreleased\]/ { capture = 1; next }
/^## \[/ && capture { capture = 0 }
capture { print }
' "$CHANGELOG_FILE")

# Collect Python repo commits since previous tag (skip merges + prior release commits)
PY_COMMITS=$(git log --no-merges --pretty=format:'- %s' \
--invert-grep --grep='^Release version' --grep='^\[release\]' \
$PY_RANGE 2>/dev/null || true)

PY_COMMIT_COUNT=0
if [ -n "$PY_COMMITS" ]; then
PY_COMMIT_COUNT=$(printf '%s\n' "$PY_COMMITS" | wc -l | tr -d ' ')
fi
echo -e " Python commits in range:${GREEN} $PY_COMMIT_COUNT${NC}"
if [ -n "$PREV_TAG" ] && [ "$PY_COMMIT_COUNT" -eq 0 ]; then
echo -e " ${YELLOW}Warning: no Python SDK commits found in $PY_RANGE; SDK changes section will be omitted.${NC}"
fi

# Extract the "What's Changed" block from the gopher-orch release notes,
# stripping the Build Information preamble and the trailing Full Changelog link.
# Rewrite PR refs and user mentions so this repo's rendered changelog does not
# point #NNN at gopher-mcp-python or ping users from the upstream release.
GOPHER_ORCH_NOTES=$(gh release view "v$GOPHER_ORCH_VERSION" \
Comment thread
dIvYaNshhh marked this conversation as resolved.
--repo GopherSecurity/gopher-orch \
--json body -q '.body' 2>/dev/null | \
awk '
/^## What.s Changed/ { capture = 1; next }
/^\*\*Full Changelog\*\*/ { capture = 0 }
capture { print }
' | sed -E \
-e '/^---$/d' \
-e 's/#([0-9]+)/https:\/\/github.com\/GopherSecurity\/gopher-orch\/pull\/\1/g' \
-e 's/@([A-Za-z0-9][A-Za-z0-9-]*)/github.com\/\1/g')

if [ -n "$GOPHER_ORCH_NOTES" ]; then
echo -e " gopher-orch notes: ${GREEN}fetched${NC}"
else
echo -e " ${GREEN}[Unreleased] section has content${NC}"
echo " Preview:"
echo "$UNRELEASED_CONTENT" | head -5 | sed 's/^/ /'
echo -e " gopher-orch notes: ${YELLOW}empty (using link only)${NC}"
fi

# Build the new [Unreleased] body
RELEASE_NOTES_FILE=$(mktemp)
CHANGELOG_TMP="${CHANGELOG_FILE}.gen"
trap 'rm -f "$RELEASE_NOTES_FILE" "$CHANGELOG_TMP"' EXIT
{
if printf '%s' "$MANUAL_CONTENT" | grep -q '[^[:space:]]'; then
printf '%s\n\n' "$MANUAL_CONTENT"
fi

echo "### Changed"
echo ""
if [ -n "$PREV_GOPHER_ORCH_VERSION" ] && \
[ "$PREV_GOPHER_ORCH_VERSION" != "$GOPHER_ORCH_VERSION" ]; then
echo "- Bump \`gopher-orch\` native library from v$PREV_GOPHER_ORCH_VERSION to [v$GOPHER_ORCH_VERSION](https://github.com/GopherSecurity/gopher-orch/releases/tag/v$GOPHER_ORCH_VERSION)."
else
echo "- Pin \`gopher-orch\` native library to [v$GOPHER_ORCH_VERSION](https://github.com/GopherSecurity/gopher-orch/releases/tag/v$GOPHER_ORCH_VERSION)."
fi
echo ""

if [ -n "$PY_COMMITS" ]; then
if [ -n "$PREV_TAG" ]; then
echo "#### SDK changes since $PREV_TAG"
else
echo "#### SDK changes"
fi
echo ""
printf '%s\n' "$PY_COMMITS"
echo ""
fi

if [ -n "$GOPHER_ORCH_NOTES" ]; then
echo "#### gopher-orch v$GOPHER_ORCH_VERSION highlights"
echo ""
printf '%s\n' "$GOPHER_ORCH_NOTES"
fi
} > "$RELEASE_NOTES_FILE"

# Splice the generated body in: replace everything between
# "## [Unreleased]" and the next "## [" with the new content.
awk -v notes_file="$RELEASE_NOTES_FILE" '
BEGIN {
while ((getline line < notes_file) > 0) {
notes = notes (notes ? "\n" : "") line
}
close(notes_file)
}
/^## \[Unreleased\]/ {
print
print ""
print notes
print ""
skipping = 1
next
}
/^## \[/ && skipping { skipping = 0 }
skipping { next }
{ print }
' "$CHANGELOG_FILE" > "$CHANGELOG_TMP"
mv "$CHANGELOG_TMP" "$CHANGELOG_FILE"

# Recompute UNRELEASED_CONTENT for the eventual commit message
UNRELEASED_CONTENT=$(awk '
/^## \[Unreleased\]/ { capture = 1; next }
/^## \[/ && capture { capture = 0 }
capture { print }
' "$CHANGELOG_FILE" | sed -e '/^[[:space:]]*$/d')

echo -e " ${GREEN}[Unreleased] section populated${NC}"
echo " Preview:"
printf '%s\n' "$UNRELEASED_CONTENT" | head -12 | sed 's/^/ /'

# -----------------------------------------------------------------------------
# Step 5: Update version files
# -----------------------------------------------------------------------------
Expand Down
Loading