-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add find-first-release command for discovering release tags #22
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
Open
mbiuki
wants to merge
6
commits into
main
Choose a base branch
from
issue-21-find-first-release-skill
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7259900
feat: add find-first-release command for discovering release tags
mbiuki e051087
docs: add Gemini Gem availability for broader team access
mbiuki 091b197
refactor: remove redundant Smart Features section
mbiuki 9c8afa3
Update CHANGELOG.md
mbiuki 94d5385
test: add comprehensive test suite with 7 test cases
mbiuki ffa8eb6
test: add dotCMS/core cross-repository test results
mbiuki 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,96 @@ | ||
| # Find First Release | ||
|
|
||
| Find the first release (git tag) that contains a given issue, pull request, or commit. | ||
|
|
||
| ## Usage | ||
|
|
||
| ``` | ||
| /find-first-release <issue|pr|commit> | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| - `issue`: Issue number (e.g., `21`, `#21`, or full URL) | ||
| - `pr`: Pull request number or URL | ||
| - `commit`: Commit SHA (short or long form) | ||
|
|
||
| ## Examples | ||
|
|
||
| ``` | ||
| /find-first-release 21 | ||
| /find-first-release #19 | ||
| /find-first-release https://github.com/dotCMS/ai-workflows/issues/18 | ||
| /find-first-release https://github.com/dotCMS/ai-workflows/pull/17 | ||
| /find-first-release 9e1db62 | ||
| /find-first-release 9e1db62a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e | ||
| ``` | ||
|
|
||
| ## Implementation | ||
|
|
||
| Find the first release (git tag) that contains the specified issue, pull request, or commit: $ARGUMENTS. | ||
|
|
||
| **Logic:** | ||
|
|
||
| 1. **Parse Input**: Determine if the input is an issue number, PR URL/number, or commit SHA | ||
| 2. **Get Commit SHA**: | ||
| - **For Issues**: Use `gh issue view <number> --json closedAt,timelineItems` to find linked PRs, then get merge commit | ||
| - **For PRs**: Use `gh pr view <number> --json mergeCommit` to get the merge commit SHA | ||
| - **For Commits**: Use the SHA directly | ||
| 3. **Find First Tag**: Use `git tag --contains <commit> | sort -V | head -1` to find the first release | ||
| 4. **Handle Edge Cases**: | ||
| - Commit not found: "Commit SHA not found in repository" | ||
| - No tags found: "This commit is not part of any release yet (possibly in an unreleased branch)" | ||
| - Issue/PR not merged: "Issue/PR is not merged yet or has no associated commits" | ||
|
|
||
| **Output Format:** | ||
|
|
||
| ``` | ||
| π Finding first release for: <input> | ||
| π Commit SHA: <sha> | ||
| π·οΈ First Release: <tag> (released on <date>) | ||
|
|
||
| π Release Details: | ||
| - Tag: <tag> | ||
| - Date: <release-date> | ||
| - Commits: <number> commits since previous release | ||
| - View release: https://github.com/<owner>/<repo>/releases/tag/<tag> | ||
| ``` | ||
|
|
||
| **Error Handling:** | ||
|
|
||
| - If input cannot be parsed: "Invalid input format. Expected issue number, PR URL, or commit SHA" | ||
| - If commit is not in any release: "Commit <sha> is not included in any release yet" | ||
| - If API calls fail: Provide helpful error messages with suggestions | ||
|
|
||
| **Key Commands:** | ||
|
|
||
| ```bash | ||
| # Get merge commit from PR | ||
| gh pr view <number> --json mergeCommit --jq '.mergeCommit.oid' | ||
|
|
||
| # Get linked PRs from issue | ||
| gh issue view <number> --json timelineItems --jq '.timelineItems[] | select(.source.pullRequest) | .source.pullRequest.number' | ||
|
|
||
| # Find first tag containing commit | ||
| git tag --contains <commit> | sort -V | head -1 | ||
|
|
||
| # Get tag creation date | ||
| git log -1 --format=%ai <tag> | ||
|
|
||
| # Count commits between tags | ||
| git rev-list <previous-tag>..<tag> --count | ||
| ``` | ||
|
|
||
| **Repository Detection:** | ||
|
|
||
| - Auto-detect current repository using `gh repo view --json nameWithOwner` | ||
| - Support cross-repository queries if full URLs are provided | ||
| - Default to current repository for issue/PR numbers | ||
|
|
||
| **Smart Features:** | ||
|
|
||
| - β Support multiple input formats (issue numbers, URLs, commit SHAs) | ||
| - β Handle both short and long commit SHAs | ||
| - β Provide rich context (release date, commit count, release URL) | ||
| - β Clear error messages for edge cases | ||
| - β Works without full git clone (uses `gh` API when possible) | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these adding value or just artifacts of the ai generated
find-first-release.mdfile?