Skip to content
Merged
Changes from all commits
Commits
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
19 changes: 14 additions & 5 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,28 @@ jobs:
fi
echo "📦 SDK commit hash: $SDK_COMMIT_HASH"

# 1. Update versions in pyproject.toml using poetry
echo "📝 Updating pyproject.toml..."
# 1. Update versions in pyproject.toml using poetry (root)
echo "📝 Updating root pyproject.toml..."
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Important: No error checking. If poetry add fails, the workflow continues and will fail later with a confusing error.

Add error checking:

poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION" || exit 1

Comment on lines +165 to 167
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: The numbered comments (# 1., # 2., etc.) are maintenance burden. Every time a step is added or removed, all subsequent numbers need updating.

The echo statements already provide clear context. Consider removing the numbers:

# Update versions in pyproject.toml using poetry (root)
echo "📝 Updating root pyproject.toml..."


# 2. Generate poetry.lock in root
# 2. Update versions in enterprise/pyproject.toml using poetry
# Must be done BEFORE running poetry lock in root to avoid conflicting constraints
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: This comment is verbose. The commit message and the fix itself make this clear.

Consider a more concise version:

# Update enterprise pyproject.toml (must be done before root poetry lock)

echo "📝 Updating enterprise/pyproject.toml..."
cd enterprise
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
cd ..
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Important: The cd enterprise / cd .. pattern is fragile and error-prone.

Problems:

  • If any command between the cd operations fails, the script continues in the wrong directory
  • No verification that we return to the correct location
  • Makes debugging harder

Better approach:

(cd enterprise && poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION") || exit 1

The subshell (...) ensures we always return to the original directory, and || exit 1 provides error handling.


# 3. Generate poetry.lock in root
echo "🔒 Running poetry lock in root..."
poetry lock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Important: Add error checking here too:

Suggested change
poetry lock
poetry lock || exit 1

If poetry lock fails, we should stop immediately rather than continue with an inconsistent state.


# 3. Generate poetry.lock in enterprise directory
# 4. Generate poetry.lock in enterprise directory
echo "🔒 Running poetry lock in enterprise/..."
cd enterprise
poetry lock
cd ..
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Important: Same fragile cd pattern here. Use a subshell for safety:

Suggested change
cd ..
(cd enterprise && poetry lock) || exit 1


# 4. Update the hash in sandbox_spec_service.py
# 5. Update the hash in sandbox_spec_service.py
echo "🔧 Updating AGENT_SERVER_IMAGE hash..."
SANDBOX_SPEC_FILE="openhands/app_server/sandbox/sandbox_spec_service.py"
if [ -f "$SANDBOX_SPEC_FILE" ]; then
Expand All @@ -201,6 +208,7 @@ jobs:
-m "" \
-m "Changes:" \
-m "- Updated SDK packages to v$VERSION in pyproject.toml" \
-m "- Updated SDK packages to v$VERSION in enterprise/pyproject.toml" \
-m "- Regenerated poetry.lock" \
-m "- Regenerated enterprise/poetry.lock" \
-m "- Updated AGENT_SERVER_IMAGE hash to ${SDK_COMMIT_HASH}" \
Expand All @@ -221,6 +229,7 @@ jobs:

### Changes
- Updated SDK packages in \`pyproject.toml\`
- Updated SDK packages in \`enterprise/pyproject.toml\`
- Regenerated \`poetry.lock\`
- Regenerated \`enterprise/poetry.lock\`
- Updated \`AGENT_SERVER_IMAGE\` hash to \`${SDK_COMMIT_HASH}\` in \`sandbox_spec_service.py\`
Expand Down
Loading