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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d512a4b43acc8a3adac6fe3fd60d05605abef697b36e0beb2e896371c6ae94c0
4
- data.tar.gz: 140274359582046b03b89521d143e7efc498c07ee85c6cd200de821191b0b0db
3
+ metadata.gz: 0cad0de8d212180547279e2d92365d37ec44abeb716d6984a6770edc3067f963
4
+ data.tar.gz: 0d23a5f0841c06357175234129814ec2bb36b87d3106fd0e845a3d76fc37e559
5
5
  SHA512:
6
- metadata.gz: '0184eb2ae93e21a1a389f7445c5e1d3532f645f5164df29ba7acc77ce67e163b8a273767aadc7a3b1ccab8483ae62d7e75b691331cb9145f4075a5a3aa3777ae'
7
- data.tar.gz: d12e12c75dc2e6b161fb9f169de0a2dd7a8760bdcdf49b915c217407937516cffca31fb5649c5b65e33b81f7c02d688c7695c9c7cf4f5c638d837756c3ce97e5
6
+ metadata.gz: e348c724af4d838d64e86fbd78fa291a6bf10e585d501df061c5c88dae2e20bf7180bef645011057e458bd0226725ba51de230e7bb21b21927726b85f42453c3
7
+ data.tar.gz: 005d855b32744aa5b74694c4d2978c4bf2b21478d4a502e627b7cb0edb4abcb474bb18a50ab791c5b7155d040c59196f01fdb0ad1a7e3cabff5d7c88158bc168
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/n2b.svg)](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 smart ticket integration.
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.5.0**
119
+ ## ๐Ÿ†• **What's New in v0.7.1**
83
120
 
84
- - **๐ŸŽฏ Full Jira Integration**: Real API integration with ticket fetching and automated updates
85
- - **๐Ÿ“ Structured Comments**: Beautifully formatted Jira comments with collapsible sections
86
- - **๐Ÿ” Smart Requirements Extraction**: AI identifies requirements from tickets and comments
87
- - **๐Ÿงช Connection Testing**: Built-in `n2b-test-jira` utility for troubleshooting
88
- - **๐Ÿ“‹ Permission Validation**: Verifies all required Jira API permissions
89
- - **โšก Enhanced Analysis**: Improved code review with better context and insights
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
- ## Quick Start
141
+ ### **Global Installation with rbenv**
98
142
 
99
- ### ๐ŸŽฏ **For Jira Users** (Most Popular)
143
+ For users with rbenv (Ruby version manager), install globally to make n2b available across all Ruby versions:
100
144
 
101
145
  ```bash
102
- # Set up Jira integration
103
- n2b --advanced-config
146
+ # Option 1: Install in system Ruby (Recommended)
147
+ rbenv global system
148
+ gem install n2b
149
+ rbenv rehash
104
150
 
105
- # Analyze code changes against ticket
106
- n2b --diff --jira PROJ-123 --jira-update
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
- ### ๐Ÿ” **For Code Review**
162
+ ### **Fix rbenv Shim Issues**
163
+
164
+ If `n2b-diff` command is not found after installation:
110
165
 
111
166
  ```bash
112
- # AI-powered diff analysis
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 Permissions
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
- Your API token needs these permissions:
448
- - **Browse Projects** - Access project list
449
- - **Browse Issues** - Read ticket details
450
- - **View Comments** - Read ticket comments
451
- - **Add Comments** - Post analysis results
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
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'n2b'
4
+
5
+ N2B::MergeCLI.run(ARGV)
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 (Browse Projects permission)
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 " โœ… Browse Projects: Can access #{response.length} projects"
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 " โœ… Browse Issues: Can access issues in #{test_project['key']}"
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 " โœ… View Comments: Can access comments on #{test_issue['key']}"
150
+ puts " โœ… Comment Access (read:comment:jira): Can access comments on #{test_issue['key']}"
151
151
  rescue => e
152
- puts " โŒ View Comments: Cannot access comments (#{e.message})"
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 " โ„น๏ธ Add Comments: Will be tested when actually posting comments"
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 " โŒ Browse Issues: Cannot search issues (#{e.message})"
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 " โŒ Browse Projects: No projects accessible"
167
- puts " Your API token needs 'Browse Projects' permission"
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 Permissions for N2B:"
177
- puts " โ€ข Browse Projects - to access project list"
178
- puts " โ€ข Browse Issues - to read ticket details"
179
- puts " โ€ข View Comments - to read ticket comments"
180
- puts " โ€ข Add Comments - to post analysis results"
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