-
Notifications
You must be signed in to change notification settings - Fork 2
Agent skill for release #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,200 @@ | ||
| --- | ||
| name: go-featuremanagement-release | ||
| description: "Release the Go FeatureManagement package and its feature flag provider. Use when: releasing a new version, bumping version, tagging a release, publishing to Go proxy, updating provider dependency, creating release PRs." | ||
| argument-hint: "Target version number, e.g. 1.2.0" | ||
| --- | ||
|
|
||
| # Go FeatureManagement Release | ||
|
|
||
| ## When to Use | ||
|
|
||
| - Release a new version of the Go FeatureManagement package (`featuremanagement`) and its feature flag provider (`featuremanagement/providers/azappconfig`) | ||
| - Bump the module version and publish to the Go module proxy | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - GitHub CLI (`gh`) ≥ 2.86.0 | ||
| - Authenticated via `gh auth login` with `repo` and `read:org` scopes | ||
| - GitHub Copilot agent enabled for the repository | ||
| - Write access to `microsoft/FeatureManagement-Go` | ||
|
|
||
| ## Cycle: Create → Monitor Task → Monitor PR | ||
|
|
||
| Every PR in this release follows the same three-phase cycle. The steps below reference this cycle. | ||
|
|
||
| ### A. Create the agent task | ||
|
|
||
| Create one agent task for the next PR in the sequence. Each command returns a URL in the format: | ||
|
|
||
| `https://github.com/microsoft/FeatureManagement-Go/pull/<pr-id>/agent-sessions/<agent-session-id>` | ||
|
|
||
| ### B. Monitor the agent task | ||
|
|
||
| Extract the `agent-session-id` from the URL returned in step A, then poll: | ||
|
|
||
| ```bash | ||
| gh agent-task view <agent-session-id> | ||
| ``` | ||
|
|
||
| Keep polling until the session state is `Ready for review`. Print the PR URL for reference. | ||
|
|
||
| ### C. Monitor the PR until merged | ||
|
|
||
| Poll the PR every 10 minutes. Stop monitoring if: | ||
|
|
||
| - PR state is `MERGED` → proceed to the next step (or finish if this was the last PR). | ||
| - PR state is `CLOSED` or `Abandoned` → report and **stop the release**. | ||
| - 24 hours elapsed → report current status and **stop the release**. | ||
|
|
||
| ```bash | ||
| gh pr view <pr-id> --repo microsoft/FeatureManagement-Go --json state --jq '.state' | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Procedure | ||
|
|
||
| Follow these steps **in order**. Each step depends on the previous one completing successfully. | ||
|
|
||
| ### Step 1 — Create Version Bump PR | ||
|
|
||
| Use the **Create → Monitor Task → Monitor PR** cycle: | ||
|
|
||
| **A. Create the agent task:** | ||
|
|
||
| ```bash | ||
| gh agent-task create \ | ||
| "Please create a version bump PR for version <version>. \ | ||
| Checkout a new branch from release/v<version> (e.g. version-bump/v<version>), \ | ||
| update the moduleVersion in featuremanagement/version.go to <version>, \ | ||
| and open a PR targeting the release/v<version> branch with title 'Version bump v<version>'." \ | ||
| --repo microsoft/FeatureManagement-Go \ | ||
| --base release/v<version> | ||
| ``` | ||
|
|
||
| **B. Monitor the agent task** until session state is `Ready for review`. | ||
|
|
||
| **C. Monitor the PR** until it is merged. Do not proceed until the PR state is `MERGED`. | ||
|
|
||
| ### Step 2 — Tag the Release | ||
|
|
||
| After the version bump PR is merged, fetch the release branch and create a git tag at the HEAD: | ||
|
|
||
| ```bash | ||
| git fetch origin release/v<version> | ||
| git tag featuremanagement/v<version> origin/release/v<version> | ||
| ``` | ||
|
|
||
| ### Step 3 — Push the Tag | ||
|
|
||
| Push the tag to the remote: | ||
|
|
||
| ```bash | ||
| git push origin featuremanagement/v<version> | ||
| ``` | ||
|
|
||
| ### Step 4 — Publish FeatureManagement to Go Module Proxy | ||
|
|
||
| **Before executing the publish command**, generate a summary report table for human review: | ||
|
|
||
| | Item | Detail | | ||
| |---------------------|---------------------------------------------------------------------| | ||
| | **Version** | `v<version>` | | ||
| | **Version file** | `featuremanagement/version.go` updated to `<version>` | | ||
| | **Tag pushed** | `featuremanagement/v<version>` | | ||
| | **Publish command** | `GOPROXY=proxy.golang.org go list -m github.com/microsoft/Featuremanagement-Go/featuremanagement@v<version>` | | ||
| | **Next step** | After publish, create feature flag provider dependency update PR | | ||
|
|
||
| > **Pause here.** Present the table and wait for the user to confirm before proceeding. | ||
|
|
||
| After user confirmation, run: | ||
|
|
||
| ```bash | ||
| GOPROXY=proxy.golang.org go list -m github.com/microsoft/Featuremanagement-Go/featuremanagement@v<version> | ||
| ``` | ||
|
|
||
| ### Step 5 — Create Feature Flag Provider Dependency Update PR | ||
|
|
||
| Use the **Create → Monitor Task → Monitor PR** cycle: | ||
|
|
||
| **A. Create the agent task:** | ||
|
|
||
| ```bash | ||
| gh agent-task create \ | ||
| "Please create a PR to update the feature flag provider dependency. \ | ||
| Checkout a new branch from release/v<version> (e.g. update-provider-dep/v<version>). \ | ||
| In featuremanagement/providers/azappconfig/go.mod, update the featuremanagement dependency version: \ | ||
| change 'require github.com/microsoft/Featuremanagement-Go/featuremanagement v<old-version>' \ | ||
| to 'require github.com/microsoft/Featuremanagement-Go/featuremanagement v<version>'. \ | ||
| Then run 'cd featuremanagement/providers/azappconfig && go mod tidy' to update go.sum. \ | ||
| Open a PR targeting the release/v<version> branch with title 'Feature flag provider: update dependency v<version>'." \ | ||
| --repo microsoft/FeatureManagement-Go \ | ||
| --base release/v<version> | ||
| ``` | ||
|
|
||
| **B. Monitor the agent task** until session state is `Ready for review`. | ||
|
|
||
| **C. Monitor the PR** until it is merged. Do not proceed until the PR state is `MERGED`. | ||
|
|
||
| ### Step 6 — Tag the Feature Flag Provider Release | ||
|
|
||
| After the dependency update PR is merged, fetch the release branch and create a git tag for the provider at the HEAD: | ||
|
|
||
| ```bash | ||
| git fetch origin release/v<version> | ||
| git tag featuremanagement/providers/azappconfig/v<version> origin/release/v<version> | ||
| ``` | ||
|
|
||
| ### Step 7 — Push the Provider Tag | ||
|
|
||
| Push the provider tag to the remote: | ||
|
|
||
| ```bash | ||
| git push origin featuremanagement/providers/azappconfig/v<version> | ||
| ``` | ||
|
|
||
| ### Step 8 — Publish Feature Flag Provider to Go Module Proxy | ||
|
|
||
| **Before executing the publish command**, generate a summary report table for human review: | ||
|
|
||
| | Item | Detail | | ||
| |---------------------|---------------------------------------------------------------------| | ||
| | **Version** | `v<version>` | | ||
| | **Provider module** | `featuremanagement/providers/azappconfig` | | ||
| | **Dependency** | `featuremanagement v<version>` | | ||
| | **Tag pushed** | `featuremanagement/providers/azappconfig/v<version>` | | ||
| | **Publish command** | `GOPROXY=proxy.golang.org go list -m github.com/microsoft/Featuremanagement-Go/featuremanagement/providers/azappconfig@v<version>` | | ||
| | **Next step** | After publish, create merge-back PR (release branch → main) | | ||
|
|
||
| > **Pause here.** Present the table and wait for the user to confirm before proceeding. | ||
|
|
||
| After user confirmation, run: | ||
|
|
||
| ```bash | ||
| GOPROXY=proxy.golang.org go list -m github.com/microsoft/Featuremanagement-Go/featuremanagement/providers/azappconfig@v<version> | ||
| ``` | ||
|
|
||
| ### Step 9 — Create Merge-Back PR | ||
|
|
||
| Use the **Create → Monitor Task → Monitor PR** cycle: | ||
|
|
||
| **A. Create the agent task:** | ||
|
|
||
| ```bash | ||
| gh agent-task create \ | ||
| "Please create a PR to merge release/v<version> back to main with title 'Merge release/v<version> to main'." \ | ||
| --repo microsoft/FeatureManagement-Go \ | ||
| --base main | ||
| ``` | ||
|
|
||
| **B. Monitor the agent task** until session state is `Ready for review`. | ||
|
|
||
| **C. Monitor the PR** until it is merged. The release is complete once this PR is merged. | ||
|
|
||
| ## Notes | ||
|
|
||
| - The version in `featuremanagement/version.go` uses the format `X.Y.Z` (no `v` prefix) in the `moduleVersion` constant. | ||
| - The featuremanagement module tag uses the format `featuremanagement/vX.Y.Z` (with `v` prefix and module path prefix). | ||
| - The feature flag provider tag uses the format `featuremanagement/providers/azappconfig/vX.Y.Z`. | ||
| - The publish commands only change the version portion: `@vX.Y.Z`. | ||
| - The feature flag provider dependency update PR modifies `featuremanagement/providers/azappconfig/go.mod` and `go.sum` (via `go mod tidy`). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.