UN-3479 [FIX] release workflow: validate before tag/publish + lint cleanup by chandrasekharan-zipstack · Pull Request #17 · Zipstack/unstract-python-client · GitHub
Skip to content

UN-3479 [FIX] release workflow: validate before tag/publish + lint cleanup - #17

Merged
chandrasekharan-zipstack merged 2 commits into
mainfrom
fix/release-workflow-lint-and-ordering
May 27, 2026
Merged

UN-3479 [FIX] release workflow: validate before tag/publish + lint cleanup#17
chandrasekharan-zipstack merged 2 commits into
mainfrom
fix/release-workflow-lint-and-ordering

Conversation

@chandrasekharan-zipstack

Copy link
Copy Markdown
Contributor

Summary

Three tightly-coupled fixes prompted by the broken v1.3 / v1.4 release dispatches today.

1. Lint failures in src/unstract/clone/

Run 26506031574 failed with 10 E501 (line-too-long > 88) violations across the new clone subpackage. These were not caught at PR time because the PR-gate workflow (test.yml) only ran pytest. Reworded the offending lines (no behavioral change) and added ruff check src/ to test.yml so lint regressions block at PR time.

2. Release workflow ordering

main.yml performed version bump → commit to main → push tag → create GH release before running lint/tests/build. So a lint failure left main with a phantom version bump and an orphaned GitHub release (v1.4.0, deleted out-of-band as part of this work).

New ordering — verification first, side-effects second:

  1. Compute new version + write to __init__.py locally (no commit)
  2. Verify version match
  3. Lint (ruff check src/)
  4. Tests (pytest)
  5. Build (uv build)
  6. Only on success: commit bump, push to main, tag, push tag, create GH release
  7. uv publish to PyPI

3. Version revert: 1.4.0 → 1.2.1

Run #1 (failed at tag step but succeeded at commit-push) and run #2 (created v1.4.0 then failed at lint) left main at 1.4.0 with no corresponding published artifact. Reverted so the next manual trigger produces the intended v1.3.0.

Test plan

  • uv run ruff check src/ passes locally
  • uv run pytest tests/ — 167 passed locally
  • gh release delete v1.4.0 + git push --delete origin v1.4.0 done out-of-band
  • CI (this PR) — new Lint (ruff) step on test.yml runs green
  • After merge: trigger main.yml manually with minor bump → expect clean v1.3.0 release end-to-end

🤖 Generated with Claude Code

…eanup

Fixes the issues exposed when the v1.3/v1.4 dispatches blew up:
- 10 E501 line-too-long violations in src/unstract/clone/ (caused the
  lint failure in release run 26506031574)
- Release workflow did commit-bump + push-to-main + tag + GH release
  BEFORE running lint/tests/build, so a lint failure left main with a
  phantom version bump and an orphan release. Lint/tests/build now run
  against the bumped __init__.py in-place, and only on success does the
  workflow commit, tag, release, and PyPI-publish.
- Add ruff to the PR gate (test.yml) so lint regressions block at PR
  time instead of release time.
- Revert __version__ from 1.4.0 to 1.2.1 so the next manual trigger
  produces the intended v1.3.0 cleanly. Orphan v1.4.0 tag + GitHub
  release have been deleted out-of-band.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Comment thread .github/workflows/main.yml
Comment thread .github/workflows/main.yml Outdated
… guards

Address greptile P1 + P2:
- P1: uv publish now runs before commit/tag/release. PyPI is the only
  irreversible step, so if a later git/release call fails the artifact
  is the source of truth and the metadata can be retried.
- P2: workflow only triggers on workflow_dispatch (see top-level `on:`),
  so the per-step `if: github.event_name == 'workflow_dispatch'` guards
  were redundant and inconsistent (only on bookends, not lint/test/build).
  Removed them — any future trigger addition should be a deliberate
  per-step decision.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@chandrasekharan-zipstack
chandrasekharan-zipstack merged commit 35f985d into main May 27, 2026
3 checks passed
@chandrasekharan-zipstack
chandrasekharan-zipstack deleted the fix/release-workflow-lint-and-ordering branch May 27, 2026 10:55
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