n2b 0.5.0 โ 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +374 -23
- data/bin/n2b-diff +5 -0
- data/bin/n2b-test-jira +17 -14
- data/lib/n2b/cli.rb +137 -72
- data/lib/n2b/jira_client.rb +430 -70
- data/lib/n2b/llm/claude.rb +6 -19
- data/lib/n2b/llm/gemini.rb +8 -7
- data/lib/n2b/llm/ollama.rb +1 -1
- data/lib/n2b/llm/open_ai.rb +26 -20
- data/lib/n2b/merge_cli.rb +694 -0
- data/lib/n2b/merge_conflict_parser.rb +70 -0
- data/lib/n2b/template_engine.rb +105 -0
- data/lib/n2b/templates/diff_json_instruction.txt +27 -0
- data/lib/n2b/templates/diff_system_prompt.txt +23 -0
- data/lib/n2b/templates/jira_comment.txt +67 -0
- data/lib/n2b/templates/merge_conflict_prompt.txt +20 -0
- data/lib/n2b/version.rb +1 -1
- data/lib/n2b.rb +3 -0
- metadata +34 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cad0de8d212180547279e2d92365d37ec44abeb716d6984a6770edc3067f963
|
4
|
+
data.tar.gz: 0d23a5f0841c06357175234129814ec2bb36b87d3106fd0e845a3d76fc37e559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e348c724af4d838d64e86fbd78fa291a6bf10e585d501df061c5c88dae2e20bf7180bef645011057e458bd0226725ba51de230e7bb21b21927726b85f42453c3
|
7
|
+
data.tar.gz: 005d855b32744aa5b74694c4d2978c4bf2b21478d4a502e627b7cb0edb4abcb474bb18a50ab791c5b7155d040c59196f01fdb0ad1a7e3cabff5d7c88158bc168
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/n2b)
|
4
4
|
|
5
|
-
**Transform your development workflow with intelligent code analysis and seamless Jira integration.** N2B is an AI-powered development tool that revolutionizes code review, requirements compliance, and project management through automated analysis and
|
5
|
+
**Transform your development workflow with intelligent code analysis and seamless Jira integration.** N2B is an AI-powered development tool that revolutionizes code review, requirements compliance, and project management through automated diff analysis, smart merge conflict resolution, and intelligent ticket integration.
|
6
6
|
|
7
7
|
## ๐ **Key Features**
|
8
8
|
|
@@ -27,8 +27,45 @@
|
|
27
27
|
- **Natural Language Commands**: Convert descriptions to executable bash commands
|
28
28
|
- **Ruby Code Generation**: Generate Ruby code from natural language instructions
|
29
29
|
- **VCS Integration**: Full Git and Mercurial support with branch comparison
|
30
|
+
- **AI Merge Conflict Resolution**: Interactive merge conflict resolver with intelligent suggestions
|
30
31
|
- **Errbit Integration**: Analyze errors and generate actionable reports
|
31
32
|
|
33
|
+
## ๐ **AI-Powered Diff Analysis** โก *Beta Feature*
|
34
|
+
|
35
|
+
**Get instant, intelligent code review for every change you make.** Our AI-powered diff analysis provides comprehensive insights into your code changes, helping you catch issues early and maintain high code quality.
|
36
|
+
|
37
|
+
### โจ **What Makes It Special**
|
38
|
+
|
39
|
+
- **๐ง Context-Aware Analysis**: Understands your codebase patterns and architectural decisions
|
40
|
+
- **๐ฏ Requirements Compliance**: Automatically checks if changes meet specified requirements
|
41
|
+
- **๐ Deep Code Review**: Identifies potential bugs, security issues, and performance problems
|
42
|
+
- **๐ก Smart Suggestions**: Provides actionable improvement recommendations with file/line references
|
43
|
+
- **๐ Test Coverage**: Evaluates test completeness and suggests missing test scenarios
|
44
|
+
- **๐ Lightning Fast**: Get comprehensive analysis in seconds, not hours
|
45
|
+
|
46
|
+
### ๐ **Quick Start**
|
47
|
+
|
48
|
+
```bash
|
49
|
+
# Analyze your current changes
|
50
|
+
n2b --diff
|
51
|
+
|
52
|
+
# Compare against main branch with requirements checking
|
53
|
+
n2b --diff --branch main --requirements requirements.md
|
54
|
+
|
55
|
+
# Full workflow with Jira integration
|
56
|
+
n2b --diff --jira PROJ-123 --jira-update
|
57
|
+
```
|
58
|
+
|
59
|
+
### ๐ฌ **We Want Your Feedback!**
|
60
|
+
|
61
|
+
This is a **beta feature** and we're actively improving it based on real-world usage. Your feedback is invaluable! Please share your experience:
|
62
|
+
|
63
|
+
- ๐ **Found a bug?** [Report it here](https://github.com/stefan-kp/n2b/issues)
|
64
|
+
- ๐ก **Have suggestions?** [Share your ideas](https://github.com/stefan-kp/n2b/discussions)
|
65
|
+
- โญ **Love it?** [Star the repo](https://github.com/stefan-kp/n2b) and spread the word!
|
66
|
+
|
67
|
+
---
|
68
|
+
|
32
69
|
## ๐ฏ **Jira Integration - Get Started in 2 Minutes**
|
33
70
|
|
34
71
|
Transform your development workflow with intelligent Jira integration:
|
@@ -79,41 +116,132 @@ n2b --diff --branch main --requirements requirements.md
|
|
79
116
|
n2b --diff --jira PROJ-123 --requirements specs.md
|
80
117
|
```
|
81
118
|
|
82
|
-
## ๐ **What's New in v0.
|
119
|
+
## ๐ **What's New in v0.7.1**
|
83
120
|
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
121
|
+
- **๐ Enhanced AI Diff Analysis**: Comprehensive code review with context-aware insights (Beta)
|
122
|
+
- **โ Interactive Jira Checklists**: Native checkboxes for team collaboration and progress tracking
|
123
|
+
- **๐ฏ Full Template Engine**: Variables, loops, conditionals for maximum customization
|
124
|
+
- **๐จ Smart Error Classification**: Automatic severity detection (Critical/Important/Low)
|
125
|
+
- **๐ Editor Integration**: Open conflicted files in your preferred editor with change detection
|
126
|
+
- **๐ก๏ธ JSON Auto-Repair**: Automatically fixes malformed LLM responses
|
127
|
+
- **โ
VCS Auto-Resolution**: Automatically marks resolved conflicts in Git/Mercurial
|
128
|
+
- **๐จ Collapsible Sections**: Organized Jira comments with expand/collapse functionality
|
129
|
+
- **๐งช Comprehensive Tests**: 103+ tests ensuring bulletproof reliability
|
130
|
+
- **โก Enhanced Context**: Full file content sent to AI for better merge decisions
|
131
|
+
- **๐ Robust Error Handling**: Multiple recovery options when AI responses fail
|
90
132
|
|
91
133
|
## Installation
|
92
134
|
|
135
|
+
### **Basic Installation**
|
136
|
+
|
93
137
|
```bash
|
94
138
|
gem install n2b
|
95
139
|
```
|
96
140
|
|
97
|
-
|
141
|
+
### **Global Installation with rbenv**
|
98
142
|
|
99
|
-
|
143
|
+
For users with rbenv (Ruby version manager), install globally to make n2b available across all Ruby versions:
|
100
144
|
|
101
145
|
```bash
|
102
|
-
#
|
103
|
-
|
146
|
+
# Option 1: Install in system Ruby (Recommended)
|
147
|
+
rbenv global system
|
148
|
+
gem install n2b
|
149
|
+
rbenv rehash
|
104
150
|
|
105
|
-
#
|
106
|
-
|
151
|
+
# Option 2: Install in a dedicated Ruby version
|
152
|
+
rbenv install 3.3.0
|
153
|
+
rbenv global 3.3.0
|
154
|
+
gem install n2b
|
155
|
+
rbenv rehash
|
156
|
+
|
157
|
+
# Verify installation works across Ruby versions
|
158
|
+
rbenv shell 3.1.0 && n2b --version
|
159
|
+
rbenv shell 3.2.0 && n2b --version
|
107
160
|
```
|
108
161
|
|
109
|
-
###
|
162
|
+
### **Fix rbenv Shim Issues**
|
163
|
+
|
164
|
+
If `n2b-diff` command is not found after installation:
|
110
165
|
|
111
166
|
```bash
|
112
|
-
#
|
167
|
+
# Remove corrupted shim and regenerate
|
168
|
+
rm ~/.rbenv/shims/.rbenv-shim
|
169
|
+
rm -rf ~/.rbenv/shims/*
|
170
|
+
rbenv rehash
|
171
|
+
|
172
|
+
# Verify both commands are available
|
173
|
+
which n2b
|
174
|
+
which n2b-diff
|
175
|
+
```
|
176
|
+
|
177
|
+
### **Configure as Default Merge Tool**
|
178
|
+
|
179
|
+
#### **Git Integration**
|
180
|
+
|
181
|
+
Add to your `~/.gitconfig`:
|
182
|
+
|
183
|
+
```ini
|
184
|
+
[merge]
|
185
|
+
tool = n2b-diff
|
186
|
+
|
187
|
+
[mergetool "n2b-diff"]
|
188
|
+
cmd = n2b-diff "$MERGED"
|
189
|
+
trustExitCode = true
|
190
|
+
keepBackup = false
|
191
|
+
```
|
192
|
+
|
193
|
+
Usage:
|
194
|
+
```bash
|
195
|
+
git merge feature-branch
|
196
|
+
# CONFLICT (content): Merge conflict in file.rb
|
197
|
+
git mergetool # Uses n2b-diff automatically
|
198
|
+
```
|
199
|
+
|
200
|
+
#### **Mercurial (hg) Integration**
|
201
|
+
|
202
|
+
Add to your `~/.hgrc`:
|
203
|
+
|
204
|
+
```ini
|
205
|
+
[ui]
|
206
|
+
merge = n2b-diff
|
207
|
+
|
208
|
+
[merge-tools]
|
209
|
+
n2b-diff.executable = n2b-diff
|
210
|
+
n2b-diff.args = $output
|
211
|
+
n2b-diff.premerge = keep
|
212
|
+
n2b-diff.priority = 100
|
213
|
+
```
|
214
|
+
|
215
|
+
Usage:
|
216
|
+
```bash
|
217
|
+
hg merge
|
218
|
+
# conflict in file.rb
|
219
|
+
# n2b-diff launches automatically
|
220
|
+
```
|
221
|
+
|
222
|
+
## Quick Start
|
223
|
+
|
224
|
+
### ๐ **AI-Powered Code Review** (โก Beta - Try It Now!)
|
225
|
+
|
226
|
+
```bash
|
227
|
+
# Get instant AI analysis of your changes
|
113
228
|
n2b --diff
|
114
229
|
|
115
|
-
# Compare against main branch with requirements
|
230
|
+
# Compare against main branch with requirements checking
|
116
231
|
n2b --diff --branch main --requirements specs.md
|
232
|
+
|
233
|
+
# Full workflow with Jira integration
|
234
|
+
n2b --diff --jira PROJ-123 --jira-update
|
235
|
+
```
|
236
|
+
|
237
|
+
### ๐ฏ **For Jira Users** (Most Popular)
|
238
|
+
|
239
|
+
```bash
|
240
|
+
# Set up Jira integration
|
241
|
+
n2b --advanced-config
|
242
|
+
|
243
|
+
# Analyze code changes against ticket
|
244
|
+
n2b --diff --jira PROJ-123 --jira-update
|
117
245
|
```
|
118
246
|
|
119
247
|
### ๐ป **For Command Generation**
|
@@ -235,6 +363,24 @@ You can also set the history file location using the `N2B_HISTORY_FILE` environm
|
|
235
363
|
export N2B_HISTORY_FILE=/path/to/your/history
|
236
364
|
```
|
237
365
|
|
366
|
+
### Custom Prompt Templates
|
367
|
+
|
368
|
+
N2B uses text templates for AI prompts. To override them, specify paths in your configuration:
|
369
|
+
|
370
|
+
```yaml
|
371
|
+
templates:
|
372
|
+
diff_system_prompt: /path/to/my_system_prompt.txt
|
373
|
+
diff_json_instruction: /path/to/my_json_instruction.txt
|
374
|
+
merge_conflict_prompt: /path/to/my_merge_prompt.txt
|
375
|
+
```
|
376
|
+
|
377
|
+
When these paths are not provided, the built-in templates located in `lib/n2b/templates/` are used.
|
378
|
+
|
379
|
+
**Available Templates:**
|
380
|
+
- `diff_system_prompt.txt` - Main diff analysis prompt
|
381
|
+
- `diff_json_instruction.txt` - JSON formatting instructions for diff analysis
|
382
|
+
- `merge_conflict_prompt.txt` - Merge conflict resolution prompt
|
383
|
+
|
238
384
|
## Quick Example N2B
|
239
385
|
|
240
386
|
```
|
@@ -332,8 +478,13 @@ Options:
|
|
332
478
|
- `--jira-no-update`: Skip Jira ticket update (analyze only)
|
333
479
|
- `-c` or `--config`: Reconfigure the tool
|
334
480
|
- `--advanced-config`: Advanced configuration including Jira setup
|
481
|
+
- `-v` or `--version`: Show version information
|
335
482
|
- `-h` or `--help`: Display help information
|
336
483
|
|
484
|
+
**Additional Commands:**
|
485
|
+
- `n2b-diff FILE`: AI-powered merge conflict resolution
|
486
|
+
- `n2b-test-jira`: Test Jira API connection and permissions
|
487
|
+
|
337
488
|
Examples:
|
338
489
|
|
339
490
|
1. Generate commands without executing:
|
@@ -442,13 +593,22 @@ You'll need:
|
|
442
593
|
- **Email**: Your Jira account email
|
443
594
|
- **API Token**: Generate from [Atlassian Account Settings](https://id.atlassian.com/manage-profile/security/api-tokens)
|
444
595
|
|
445
|
-
### Required Jira
|
596
|
+
### Required Jira API Scopes
|
597
|
+
|
598
|
+
Your API token needs these specific scopes:
|
599
|
+
|
600
|
+
**Essential Scopes:**
|
601
|
+
- `read:project:jira` - View projects (access project list)
|
602
|
+
- `read:issue:jira` - View issues (fetch ticket details)
|
603
|
+
- `read:comment:jira` - View comments (fetch ticket comments for context)
|
604
|
+
- `write:comment:jira` - Create and update comments (post analysis results)
|
446
605
|
|
447
|
-
|
448
|
-
-
|
449
|
-
-
|
450
|
-
|
451
|
-
|
606
|
+
**Optional but Recommended:**
|
607
|
+
- `read:issue-details:jira` - View detailed issue information
|
608
|
+
- `read:issue.property:jira` - View issue properties (comprehensive ticket data)
|
609
|
+
|
610
|
+
**Legacy Permission Names (for older Jira versions):**
|
611
|
+
- Browse Projects, Browse Issues, View Comments, Add Comments
|
452
612
|
|
453
613
|
### Usage
|
454
614
|
|
@@ -534,6 +694,190 @@ This will verify:
|
|
534
694
|
- Required permissions
|
535
695
|
- Specific ticket access (if provided)
|
536
696
|
|
697
|
+
## ๐ง **AI-Powered Merge Conflict Resolution (n2b-diff)**
|
698
|
+
|
699
|
+
Resolve Git and Mercurial merge conflicts with intelligent AI assistance.
|
700
|
+
|
701
|
+
### Quick Start
|
702
|
+
|
703
|
+
```bash
|
704
|
+
# Resolve conflicts in a file
|
705
|
+
n2b-diff conflicted_file.rb
|
706
|
+
|
707
|
+
# With more context lines
|
708
|
+
n2b-diff conflicted_file.rb --context 20
|
709
|
+
|
710
|
+
# Get help
|
711
|
+
n2b-diff --help
|
712
|
+
```
|
713
|
+
|
714
|
+
### How It Works
|
715
|
+
|
716
|
+
1. **๐ Detects Conflicts**: Automatically finds `<<<<<<<`, `=======`, `>>>>>>>` markers
|
717
|
+
2. **๐ Extracts Context**: Shows surrounding code for better understanding
|
718
|
+
3. **๐ค AI Analysis**: LLM analyzes both sides and suggests optimal merge
|
719
|
+
4. **๐จ Interactive Review**: Colorized display with Accept/Skip/Comment/Abort options
|
720
|
+
5. **โ
Applies Changes**: Updates file with accepted merges
|
721
|
+
|
722
|
+
### Interactive Workflow
|
723
|
+
|
724
|
+
For each conflict, you can:
|
725
|
+
- **[y] Accept** - Apply the AI suggestion
|
726
|
+
- **[n] Skip** - Keep the conflict as-is
|
727
|
+
- **[c] Comment** - Add context to improve AI suggestions
|
728
|
+
- **[a] Abort** - Stop processing and keep file unchanged
|
729
|
+
|
730
|
+
### Features
|
731
|
+
|
732
|
+
#### **๐จ Colorized Display**
|
733
|
+
- ๐ด **Red**: Base/HEAD content (`<<<<<<< HEAD`)
|
734
|
+
- ๐ข **Green**: Incoming content (`>>>>>>> feature`)
|
735
|
+
- ๐ก **Yellow**: Conflict markers (`=======`)
|
736
|
+
- ๐ต **Blue**: AI suggestions
|
737
|
+
- โช **Gray**: Reasoning explanations
|
738
|
+
|
739
|
+
#### **๐ค Smart AI Analysis**
|
740
|
+
- **Context Awareness**: Understands surrounding code patterns
|
741
|
+
- **Quality Decisions**: Chooses enhanced implementations over simple ones
|
742
|
+
- **Consistency**: Maintains coding patterns and architectural decisions
|
743
|
+
- **User Feedback**: Incorporates comments to improve suggestions
|
744
|
+
|
745
|
+
#### **โ๏ธ Configurable Options**
|
746
|
+
- **Context Lines**: `--context N` (default: 10)
|
747
|
+
- **Merge Logging**: Optional JSON logs in `.n2b_merge_log/`
|
748
|
+
- **Custom Templates**: Configurable merge prompts
|
749
|
+
|
750
|
+
### Example Session
|
751
|
+
|
752
|
+
```bash
|
753
|
+
$ n2b-diff user_service.rb
|
754
|
+
|
755
|
+
<<<<<<< HEAD
|
756
|
+
def create_user(name, email)
|
757
|
+
# Basic validation
|
758
|
+
raise "Invalid" if name.empty?
|
759
|
+
User.create(name: name, email: email)
|
760
|
+
end
|
761
|
+
=======
|
762
|
+
def create_user(name, email, age = nil)
|
763
|
+
# Enhanced validation
|
764
|
+
validate_name(name)
|
765
|
+
validate_email(email)
|
766
|
+
User.create(name: name.titleize, email: email.downcase, age: age)
|
767
|
+
end
|
768
|
+
>>>>>>> feature/enhanced-validation
|
769
|
+
|
770
|
+
--- Suggestion ---
|
771
|
+
def create_user(name, email, age = nil)
|
772
|
+
# Enhanced validation with fallback
|
773
|
+
validate_name(name) if respond_to?(:validate_name)
|
774
|
+
validate_email(email) if respond_to?(:validate_email)
|
775
|
+
User.create(name: name.titleize, email: email.downcase, age: age)
|
776
|
+
end
|
777
|
+
|
778
|
+
Reason: Combined enhanced validation from feature branch with safety checks
|
779
|
+
for method existence, maintaining backward compatibility while adding new features.
|
780
|
+
|
781
|
+
Accept [y], Skip [n], Comment [c], Abort [a]: y
|
782
|
+
```
|
783
|
+
|
784
|
+
### Custom Templates
|
785
|
+
|
786
|
+
Customize merge prompts by adding to your config:
|
787
|
+
|
788
|
+
```yaml
|
789
|
+
templates:
|
790
|
+
merge_conflict_prompt: /path/to/my_merge_prompt.txt
|
791
|
+
```
|
792
|
+
|
793
|
+
Template variables available:
|
794
|
+
- `{full_file_content}` - Complete file content for full context understanding
|
795
|
+
- `{context_before}` - Code before the conflict
|
796
|
+
- `{context_after}` - Code after the conflict
|
797
|
+
- `{base_label}` - Base branch label (e.g., "HEAD")
|
798
|
+
- `{base_content}` - Base branch content
|
799
|
+
- `{incoming_label}` - Incoming branch label (e.g., "feature/auth")
|
800
|
+
- `{incoming_content}` - Incoming branch content
|
801
|
+
- `{user_comment}` - User-provided comment (if any)
|
802
|
+
|
803
|
+
### Use Cases
|
804
|
+
|
805
|
+
- **Feature Branch Merges**: Resolve conflicts when merging feature branches
|
806
|
+
- **Code Reviews**: Get AI assistance for complex merge decisions
|
807
|
+
- **Refactoring**: Handle conflicts during large refactoring efforts
|
808
|
+
- **Team Collaboration**: Standardize merge conflict resolution approaches
|
809
|
+
- **Learning Tool**: Understand best practices for conflict resolution
|
810
|
+
|
811
|
+
### **Daily Workflow Integration**
|
812
|
+
|
813
|
+
#### **Git Workflow**
|
814
|
+
```bash
|
815
|
+
# During merge conflicts
|
816
|
+
git merge feature-branch
|
817
|
+
# CONFLICT (content): Merge conflict in file.rb
|
818
|
+
|
819
|
+
# Use configured merge tool
|
820
|
+
git mergetool
|
821
|
+
|
822
|
+
# Or call directly
|
823
|
+
n2b-diff file.rb
|
824
|
+
|
825
|
+
# Continue merge
|
826
|
+
git add file.rb
|
827
|
+
git commit -m "Resolve merge conflicts"
|
828
|
+
```
|
829
|
+
|
830
|
+
#### **Mercurial Workflow**
|
831
|
+
```bash
|
832
|
+
# During hg merge conflicts
|
833
|
+
hg merge
|
834
|
+
# conflict in file.rb
|
835
|
+
|
836
|
+
# Resolve with n2b-diff (auto-launches if configured)
|
837
|
+
n2b-diff file.rb
|
838
|
+
|
839
|
+
# Mark as resolved and commit
|
840
|
+
hg resolve --mark file.rb
|
841
|
+
hg commit -m "Resolve merge conflicts"
|
842
|
+
```
|
843
|
+
|
844
|
+
#### **Rebase Conflicts**
|
845
|
+
```bash
|
846
|
+
# Git rebase conflicts
|
847
|
+
git rebase -i main
|
848
|
+
# CONFLICT: Merge conflict in user_service.rb
|
849
|
+
|
850
|
+
n2b-diff user_service.rb
|
851
|
+
git add user_service.rb
|
852
|
+
git rebase --continue
|
853
|
+
```
|
854
|
+
|
855
|
+
#### **Batch Conflict Resolution**
|
856
|
+
```bash
|
857
|
+
# Find and resolve all conflicts
|
858
|
+
find . -name "*.rb" -exec grep -l "<<<<<<< HEAD" {} \; | while read file; do
|
859
|
+
echo "Resolving conflicts in $file"
|
860
|
+
n2b-diff "$file"
|
861
|
+
done
|
862
|
+
```
|
863
|
+
|
864
|
+
#### **Shell Aliases for Convenience**
|
865
|
+
Add to your `.zshrc` or `.bashrc`:
|
866
|
+
```bash
|
867
|
+
# Quick aliases for n2b tools
|
868
|
+
alias resolve-conflicts='n2b-diff'
|
869
|
+
alias test-jira='n2b-test-jira'
|
870
|
+
alias ai-diff='n2b --diff'
|
871
|
+
|
872
|
+
# Function to resolve all conflict files
|
873
|
+
resolve-all-conflicts() {
|
874
|
+
find . -name "*.rb" -exec grep -l "<<<<<<< HEAD" {} \; | while read file; do
|
875
|
+
echo "Resolving conflicts in $file"
|
876
|
+
n2b-diff "$file"
|
877
|
+
done
|
878
|
+
}
|
879
|
+
```
|
880
|
+
|
537
881
|
n2r in ruby or rails console
|
538
882
|
n2r "your question", files:['file1.rb', 'file2.rb'], exception: AnError
|
539
883
|
only question is mandatory
|
@@ -595,6 +939,13 @@ This project is licensed under the MIT License.
|
|
595
939
|
|
596
940
|
## Version History
|
597
941
|
|
942
|
+
### ๐ง **v0.5.4 - AI-Powered Merge Conflict Resolver**
|
943
|
+
- **NEW: n2b-diff command** - Interactive AI-powered merge conflict resolution
|
944
|
+
- Colorized conflict display with Accept/Skip/Comment/Abort workflow
|
945
|
+
- Smart AI suggestions with detailed reasoning and user feedback integration
|
946
|
+
- Custom templates for merge prompts and configurable context lines
|
947
|
+
- Merge logging and Git/Mercurial support
|
948
|
+
|
598
949
|
### ๐ **v0.5.0 - Jira Integration & Enhanced Analysis**
|
599
950
|
- Full Jira API integration with real ticket fetching and comment posting
|
600
951
|
- Structured Jira comments using ADF with collapsible sections
|
data/bin/n2b-diff
ADDED
data/bin/n2b-test-jira
CHANGED
@@ -124,11 +124,11 @@ class JiraConnectionTester
|
|
124
124
|
puts "3๏ธโฃ Testing required permissions..."
|
125
125
|
|
126
126
|
begin
|
127
|
-
# Test 1: Project access (
|
127
|
+
# Test 1: Project access (read:project:jira scope)
|
128
128
|
response = make_api_request('GET', '/project')
|
129
129
|
|
130
130
|
if response.is_a?(Array) && response.length > 0
|
131
|
-
puts " โ
|
131
|
+
puts " โ
Project Access (read:project:jira): Can access #{response.length} projects"
|
132
132
|
response.first(3).each do |project|
|
133
133
|
puts " - #{project['key']}: #{project['name']}"
|
134
134
|
end
|
@@ -141,30 +141,30 @@ class JiraConnectionTester
|
|
141
141
|
begin
|
142
142
|
issues_response = make_api_request('GET', "/search?jql=project=#{test_project['key']}&maxResults=1")
|
143
143
|
if issues_response['issues'] && issues_response['issues'].length > 0
|
144
|
-
puts " โ
|
144
|
+
puts " โ
Issue Access (read:issue:jira): Can access issues in #{test_project['key']}"
|
145
145
|
|
146
146
|
# Test 3: Comment access (if we found an issue)
|
147
147
|
test_issue = issues_response['issues'].first
|
148
148
|
begin
|
149
149
|
comments_response = make_api_request('GET', "/issue/#{test_issue['key']}/comment")
|
150
|
-
puts " โ
|
150
|
+
puts " โ
Comment Access (read:comment:jira): Can access comments on #{test_issue['key']}"
|
151
151
|
rescue => e
|
152
|
-
puts " โ
|
152
|
+
puts " โ Comment Access (read:comment:jira): Cannot access comments (#{e.message})"
|
153
153
|
end
|
154
154
|
|
155
155
|
# Test 4: Add comment permission (we won't actually add, just check the endpoint)
|
156
|
-
puts " โน๏ธ
|
156
|
+
puts " โน๏ธ Comment Creation (write:comment:jira): Will be tested when actually posting comments"
|
157
157
|
else
|
158
158
|
puts " โ ๏ธ No issues found in #{test_project['key']} to test comment permissions"
|
159
159
|
end
|
160
160
|
rescue => e
|
161
|
-
puts " โ
|
161
|
+
puts " โ Issue Access (read:issue:jira): Cannot search issues (#{e.message})"
|
162
162
|
end
|
163
163
|
|
164
164
|
puts
|
165
165
|
else
|
166
|
-
puts " โ
|
167
|
-
puts " Your API token needs '
|
166
|
+
puts " โ Project Access: No projects accessible"
|
167
|
+
puts " Your API token needs 'read:project:jira' scope"
|
168
168
|
puts
|
169
169
|
end
|
170
170
|
rescue => e
|
@@ -173,11 +173,14 @@ class JiraConnectionTester
|
|
173
173
|
puts
|
174
174
|
end
|
175
175
|
|
176
|
-
puts " ๐ Required Jira
|
177
|
-
puts " โข
|
178
|
-
puts " โข
|
179
|
-
puts " โข
|
180
|
-
puts " โข
|
176
|
+
puts " ๐ Required Jira API Scopes for N2B:"
|
177
|
+
puts " โข read:project:jira - to access project list"
|
178
|
+
puts " โข read:issue:jira - to read ticket details"
|
179
|
+
puts " โข read:comment:jira - to read ticket comments"
|
180
|
+
puts " โข write:comment:jira - to post analysis results"
|
181
|
+
puts
|
182
|
+
puts " ๐ Legacy Permission Names (older Jira versions):"
|
183
|
+
puts " โข Browse Projects, Browse Issues, View Comments, Add Comments"
|
181
184
|
puts
|
182
185
|
end
|
183
186
|
|