Skip to content
Closed
Show file tree
Hide file tree
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
46 changes: 34 additions & 12 deletions .github/skills/http-client-python-bump-and-release/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,30 @@ npm install -g npm-check-updates

## Workflow

Before starting or resuming, inspect the working tree, current branch, remotes, and existing release commits. Preserve existing task work. If the branch already contains the prepared release, continue from the first incomplete step instead of repeating dependency updates or incrementing the version again.

1. Navigate to the package directory:

```bash
cd {REPO}/packages/http-client-python
```

2. Reset and sync with main:
2. For a new release, fetch `main` from the remote whose URL points to `microsoft/typespec`:

```bash
git reset HEAD && git checkout . && git checkout origin/main && git pull origin main
git fetch <microsoft-remote> main
```

3. Create release branch (use current date in MM-DD format):
Do not reset or discard existing changes to prepare a release.

3. Create release branch (use current date in MM-DD format), unless the environment already supplied the task branch:

```bash
git checkout -b publish/python-release-{MM-DD}
git switch --create publish/python-release-{MM-DD} <microsoft-remote>/main
```

If the name belongs to unrelated work, choose an unused suffix; never overwrite it. Record the actual task branch with `git branch --show-current` for publishing and PR verification.

4. Update dependencies:

```bash
Expand Down Expand Up @@ -70,7 +76,7 @@ npm install -g npm-check-updates
npm run change:version
```

Verify that the script updated both the emitter version in `package.json` and `CHANGELOG.md`. If neither file was updated:
Check the command's exit status and investigate partial changes on failure. Verify that the script updated both the emitter version in `package.json` and `CHANGELOG.md`. If neither file was updated:
- Increment the third component of the emitter version in `package.json` (for example, `a.b.c` to `a.b.(c+1)`).
- Add this entry near the top of `CHANGELOG.md`, immediately after the changelog title:

Expand All @@ -87,17 +93,33 @@ npm install -g npm-check-updates
8. Build and commit:

```bash
npm install && npm run build && git add -u && git commit -m "bump version"
npm install && npm run build
```

9. Push and create PR:
Complete the repository's applicable validation before committing. Stage only the release files and any explicitly requested skill update; do not stage unrelated work. Use a conventional commit message and the required co-author trailer. Preserve existing release commits when resuming.

9. Publish the actual task branch:
- Identify the push remote by URL, following the repository's personal-fork rules; do not assume it is `origin`.
- Prefer authenticated Git and `gh`. If GitHub CLI is unavailable or unauthenticated, discover and try an available authenticated GitHub/VS Code publishing integration before asking the user to log in.
- Git authentication is independent of `gh`: check it with `git push --dry-run <fork-remote> HEAD`. Public fetch access and read-only API access do not establish push permission.
- Publish with Git, or let a publishing-capable PR integration publish the branch:

```bash
cd {REPO}
git push origin HEAD
git push --set-upstream <fork-remote> HEAD
```

10. Create PR with title `[python] release new version` and no description.
10. Create and verify the PR:
- Target `microsoft/typespec`, base `main`, from the actual published branch, with the exact title `[python] release new version` and an empty body. Reuse an existing matching open PR rather than creating a duplicate.
- Use an available authenticated integration; GitHub CLI is optional. With authenticated CLI access:

```bash
gh pr create --repo microsoft/typespec --base main --head <fork-owner>:<actual-branch> --title "[python] release new version" --body ""
```

- Verify the created PR's repository, base and head branches, head commit, exact title, empty body, and release files. If the user requested skill changes in this PR, verify they are included too.
- Inspect publishing errors before retrying. For example, `Callback URL is required` indicates the VS Code integration is unavailable; fall back to another authorized publishing route, not another identical tool call.
- If Git and all available publishing integrations are blocked, report the errors and request authentication, such as `gh auth login` and `gh auth setup-git`, or integration repair. Never ask for a token in chat. Resume at publishing once access is restored.
- A local commit or branch push is not completion: return a verified PR URL, or explicitly report that PR creation is blocked. Do not publish to npm or merge the PR.

## Post-Process Review

Expand All @@ -108,6 +130,6 @@ npm install -g npm-check-updates
- A step was ambiguous enough to create a real risk or delay.
- A command was unnecessary or could be replaced by a demonstrably safer or more reliable command.
3. Do not change the skill based on preference, speculation, or an unobserved edge case. For every update, record the observed evidence and explain why the edit improves future releases.
4. Keep any skill update minimal, validate its formatting and frontmatter, and keep it separate from the completed release PR unless the user explicitly asks to include it there.
4. Keep any skill update focused and validate its formatting and frontmatter. Keep it separate from the release PR unless the user explicitly asks to include it there; in that case commit it on the release branch, publish it, and verify the PR contains it.
5. If the review finds no evidence-backed improvement, leave the skill unchanged and state that no update was warranted.
6. Return the branch name, released package version, `@typespec/http-client-python` version, commit hash, pull request URL, review findings, and any skill update to the user.
6. Return the actual branch, prepared `@typespec/http-client-python` version, commit hash, verified PR URL, validation results and limitations, review findings, and any skill update. Distinguish a prepared release PR from an npm publication.
6 changes: 6 additions & 0 deletions packages/http-client-python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log - @typespec/http-client-python

## 0.39.1

### Bump dependencies

- Bump dependencies of `@typespec/*` and `@azure-tools/*` to latest versions

## 0.39.0

### Features
Expand Down
42 changes: 21 additions & 21 deletions packages/http-client-python/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/http-client-python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typespec/http-client-python",
"version": "0.39.0",
"version": "0.39.1",
"author": "Microsoft Corporation",
"description": "TypeSpec emitter for Python SDKs",
"homepage": "https://typespec.io",
Expand Down Expand Up @@ -66,7 +66,7 @@
"emitter"
],
"peerDependencies": {
"@azure-tools/typespec-autorest": ">=0.73.0 <1.0.0",
"@azure-tools/typespec-autorest": ">=0.73.1 <1.0.0",
"@azure-tools/typespec-azure-core": ">=0.73.0 <1.0.0",
"@azure-tools/typespec-azure-resource-manager": ">=0.73.0 <1.0.0",
"@azure-tools/typespec-azure-rulesets": ">=0.73.0 <1.0.0",
Expand Down Expand Up @@ -104,7 +104,7 @@
"tsx": "^4.23.13"
},
"devDependencies": {
"@azure-tools/typespec-autorest": "~0.73.0",
"@azure-tools/typespec-autorest": "~0.73.1",
"@azure-tools/typespec-azure-core": "~0.73.0",
"@azure-tools/typespec-azure-resource-manager": "~0.73.0",
"@azure-tools/typespec-azure-rulesets": "~0.73.0",
Expand Down
Loading