Skip to content
Open
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
11 changes: 9 additions & 2 deletions plugins/jira/commands/solve.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ Analyze a JIRA issue and create a pull request to solve it.

## Process Flow:

0. **Pre-flight Validation**:
- Validate that required tools are available (curl, jq, git, make)
- Check if current directory is a valid git repository
- Ensure working directory is clean or warn user about uncommitted changes
- Validate upstream remote is properly configured
- Fetch latest changes from upstream repository: `git fetch upstream`
Copy link
Contributor

@enxebre enxebre Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this assumes there's a remote that's named upstream. That conflicts with

- Always create the PR against the remote origin
which assumes is named origin.
May be the remote to create the PR against should be a new argument $2 that defaults to origin. If you agree, please make sure to add the argument-hints section in the metadata

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think so. It intends to keep the code up-to-date before starting to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I'm saying is that your change is not mergeable as it is. The assumptions about "upstream" and "origin" here are not always fair, hence my suggestion on arguments with defaults.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I understand and will take a look. Thanks!

- Create feature branch using the jira-key $1 as the branch name. Use main branch from upstream as base. For example: "git checkout -b fix-{jira-key} upstream/main"

1. **Issue Analysis**: Parse JIRA URL and fetch issue details:
- Use curl to fetch JIRA issue data: curl -s "https://issues.redhat.com/rest/api/2/issue/{$1}"
- Parse JSON response to extract:
Expand All @@ -34,7 +42,7 @@ Analyze a JIRA issue and create a pull request to solve it.
- Optional
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Ask the user for further issue grooming if the requried sections are missing
- Ask the user for further issue grooming if the required sections are missing

2. **Codebase Analysis**: Search and analyze relevant code:
- Find related files and functions
Expand Down Expand Up @@ -65,7 +73,6 @@ Analyze a JIRA issue and create a pull request to solve it.
- You absolutely must run `make pre-commit` and get it passing before going to the "Commit Creation"

4. **Commit Creation**:
- Create feature branch using the jira-key $1 as the branch name. For example: "git checkout -b fix-{jira-key}"
- Break commits into logical components based on the nature of the changes
- Each commit should honor https://www.conventionalcommits.org/en/v1.0.0/ and always include a commit message body articulating the "why"
- Use your judgment to organize commits in a way that makes them easy to review and understand
Expand Down