Skip to content

chore: align Python release publishing with Ruby#716

Merged
marandaneto merged 5 commits into
mainfrom
chore/align-python-release-with-ruby
Jul 1, 2026
Merged

chore: align Python release publishing with Ruby#716
marandaneto merged 5 commits into
mainfrom
chore/align-python-release-with-ruby

Conversation

@marandaneto

@marandaneto marandaneto commented Jul 1, 2026

Copy link
Copy Markdown
Member

💡 Motivation and Context

Align the split Python release workflow with the Ruby release workflow so publish-time tag creation uses the checkout credentials instead of an explicit GH_TOKEN, while keeping gh release create authenticated with ${{ github.token }} like Ruby.

The publish job now configures git, fetches tags, skips package releases when the expected tag already exists, creates annotated tags with git, and creates GitHub releases from a generated release-notes.md file. The release-notes extraction preserves the fallback text when the latest changelog section is missing or empty.

The root CHANGELOG.md now mirrors Ruby's package index pattern and points to the package-specific changelogs. The historical posthog changelog moved to posthog/CHANGELOG.md, and the release workflow copies it into the root only while running sampo release, then moves the generated changelog back to posthog/CHANGELOG.md and restores the root index.

RELEASING.md is updated to document all published packages, package-specific changelog locations, and package-prefixed release tags.

This also includes a patch changeset for both posthog and openfeature-provider-posthog so the updated release flow can be exercised after merge.

💚 How did you test it?

  • Parsed .github/workflows/release.yml with PyYAML.
  • Tested the release-notes extraction locally with populated, empty, and missing-section changelog cases.
  • Simulated the sampo release changelog relocation flow in a temporary clone with a temporary changeset and confirmed the root changelog stays as an index while posthog/CHANGELOG.md receives the generated entry.
  • Ran SAMPO_RELEASE_BRANCH=main sampo release --dry-run with the committed changeset and confirmed planned patch releases for both packages.
  • Ran git diff --check.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Pi was used to compare the Python release workflow with the Rust and Ruby release workflows, then update Python's publish job to follow Ruby's multi-job release pattern more closely. The key decisions were to keep the default workflow token in the publish job, remove explicit token wiring from tag creation, use git-based annotated tags plus release notes files like Ruby, make the root changelog an index to the package-specific changelogs, document the multi-package release setup, include a small changeset to test the release workflow after merge, and preserve fallback release notes when the latest changelog section is empty.

@marandaneto marandaneto self-assigned this Jul 1, 2026
@marandaneto marandaneto marked this pull request as ready for review July 1, 2026 07:02
@marandaneto marandaneto requested a review from a team as a code owner July 1, 2026 07:02
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "chore: align Python release publishing w..." | Re-trigger Greptile

Comment thread .github/workflows/release.yml
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

posthog-python Compliance Report

Date: 2026-07-01 07:30:51 UTC
Duration: 176145ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 516ms
Format Validation.Event Has Uuid 1507ms
Format Validation.Event Has Lib Properties 1507ms
Format Validation.Distinct Id Is String 1507ms
Format Validation.Token Is Present 1506ms
Format Validation.Custom Properties Preserved 1507ms
Format Validation.Event Has Timestamp 1506ms
Retry Behavior.Retries On 503 9519ms
Retry Behavior.Does Not Retry On 400 3506ms
Retry Behavior.Does Not Retry On 401 3506ms
Retry Behavior.Respects Retry After Header 9514ms
Retry Behavior.Implements Backoff 23516ms
Retry Behavior.Retries On 500 7512ms
Retry Behavior.Retries On 502 7516ms
Retry Behavior.Retries On 504 7511ms
Retry Behavior.Max Retries Respected 23526ms
Deduplication.Generates Unique Uuids 1500ms
Deduplication.Preserves Uuid On Retry 7514ms
Deduplication.Preserves Uuid And Timestamp On Retry 14521ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 7505ms
Deduplication.No Duplicate Events In Batch 1506ms
Deduplication.Different Events Have Different Uuids 1506ms
Compression.Sends Gzip When Enabled 1507ms
Batch Format.Uses Proper Batch Structure 1507ms
Batch Format.Flush With No Events Sends Nothing 1005ms
Batch Format.Multiple Events Batched Together 1505ms
Error Handling.Does Not Retry On 403 3509ms
Error Handling.Does Not Retry On 413 3507ms
Error Handling.Retries On 408 7510ms

Feature_Flags Tests

16/16 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 1007ms
Request Payload.Flags Request Uses V2 Query Param 1006ms
Request Payload.Flags Request Hits Flags Path Not Decide 1006ms
Request Payload.Flags Request Omits Authorization Header 1007ms
Request Payload.Token In Flags Body Matches Init 1006ms
Request Payload.Groups Round Trip 1009ms
Request Payload.Groups Default To Empty Object 1006ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It 1006ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 1007ms
Request Payload.Disable Geoip Omitted Defaults To False 1006ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 1006ms
Request Lifecycle.No Flags Request On Init Alone 502ms
Request Lifecycle.No Flags Request On Normal Capture 1507ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 1010ms
Request Lifecycle.Mock Response Value Is Returned To Caller 1003ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 1509ms

@marandaneto marandaneto force-pushed the chore/align-python-release-with-ruby branch from 1a0d989 to 163b8b7 Compare July 1, 2026 07:17
@marandaneto marandaneto merged commit c6350b6 into main Jul 1, 2026
35 checks passed
@marandaneto marandaneto deleted the chore/align-python-release-with-ruby branch July 1, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants