air_test 0.1.6.2 → 0.1.6.3
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 +19 -1
- data/lib/air_test/cli.rb +11 -1
- data/lib/air_test/configuration.rb +2 -1
- data/lib/air_test/notion_ticket_parser.rb +17 -3
- data/lib/air_test/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeac542af7a36bf55e55009d83c49f62c5d671879cb15656e4ba2101c758f163
|
4
|
+
data.tar.gz: 6b5a2971a1a08b6857228941fc31c40e07c5f77465346ea1e2bed71435eb17d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dbbb43370bb38d8927b647e3b3157d3ea57249b56480132fd7ad992675516f8befff20bf8a34d395150700c137cece8d66553a79895a53473c6613eb51ded1c
|
7
|
+
data.tar.gz: 6b364dd429c62999dabf9cabe99e934da775ae74958720328d31a463c48d3cacdf446ac1aa332249bc890754534921ea08914bb70efb58c23769052b7014ddb9
|
data/README.md
CHANGED
@@ -106,6 +106,7 @@ tool: notion # Your ticketing tool (notion/jira/monday)
|
|
106
106
|
auto_pr: 'yes' # Enable auto PR creation
|
107
107
|
dev_assignee: 'your-name' # Default dev assignee
|
108
108
|
interactive_mode: 'yes' # Enable interactive mode by default
|
109
|
+
status_filter: 'Not started' # Status filter for tickets to fetch
|
109
110
|
notion:
|
110
111
|
token: ENV["NOTION_TOKEN"]
|
111
112
|
database_id: ENV["NOTION_DATABASE_ID"]
|
@@ -123,6 +124,20 @@ github:
|
|
123
124
|
repo: 'your-org/your-repo'
|
124
125
|
```
|
125
126
|
|
127
|
+
### Status Filtering
|
128
|
+
|
129
|
+
AirTest can filter tickets by their status to only process tickets in specific states:
|
130
|
+
|
131
|
+
- **Notion**: Filter by status like "Not started", "In progress", "Done", "attente de confirmation", etc.
|
132
|
+
- **Jira**: Filter by status like "To Do", "In Progress", "Done", etc.
|
133
|
+
- **Monday.com**: Filter by status like "Working on it", "Done", "Stuck", etc.
|
134
|
+
|
135
|
+
You can configure the status filter in three ways:
|
136
|
+
|
137
|
+
1. **During setup**: When running `air_test init`, you'll be prompted for the default status filter
|
138
|
+
2. **Environment variable**: Set `AIRTEST_STATUS_FILTER=your_status` in your `.env` file
|
139
|
+
3. **Configuration file**: Edit the `status_filter` field in `.airtest.yml`
|
140
|
+
|
126
141
|
### Rails Initializer (Optional)
|
127
142
|
|
128
143
|
For Rails projects, you can also create an initializer:
|
@@ -234,6 +249,7 @@ Show help information and usage examples.
|
|
234
249
|
NOTION_TOKEN=secret_xxx
|
235
250
|
NOTION_DATABASE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
236
251
|
GITHUB_BOT_TOKEN=ghp_xxx
|
252
|
+
AIRTEST_STATUS_FILTER=Not started # Optional: Override status filter
|
237
253
|
```
|
238
254
|
|
239
255
|
#### For Jira:
|
@@ -243,6 +259,7 @@ JIRA_PROJECT_ID=your_project_id
|
|
243
259
|
JIRA_DOMAIN=your_domain.atlassian.net
|
244
260
|
JIRA_EMAIL=your_email@example.com
|
245
261
|
GITHUB_BOT_TOKEN=ghp_xxx
|
262
|
+
AIRTEST_STATUS_FILTER=To Do # Optional: Override status filter
|
246
263
|
```
|
247
264
|
|
248
265
|
#### For Monday.com:
|
@@ -251,6 +268,7 @@ MONDAY_TOKEN=your_monday_token
|
|
251
268
|
MONDAY_BOARD_ID=your_board_id
|
252
269
|
MONDAY_DOMAIN=your_domain.monday.com
|
253
270
|
GITHUB_BOT_TOKEN=ghp_xxx
|
271
|
+
AIRTEST_STATUS_FILTER=Working on it # Optional: Override status filter
|
254
272
|
```
|
255
273
|
|
256
274
|
### System Requirements
|
@@ -266,7 +284,7 @@ GITHUB_BOT_TOKEN=ghp_xxx
|
|
266
284
|
|
267
285
|
- **Configuration not found**: Run `air_test init` to set up configuration
|
268
286
|
- **Authentication error**: Check your API tokens in environment variables
|
269
|
-
- **No tickets found**: Verify your ticketing tool configuration and permissions
|
287
|
+
- **No tickets found**: Verify your ticketing tool configuration and permissions, or check if your status filter matches existing ticket statuses
|
270
288
|
- **PR not created**: Make sure the branch contains commits different from `main`
|
271
289
|
- **Permission issues**: Ensure the GitHub bot has access to the repo
|
272
290
|
|
data/lib/air_test/cli.rb
CHANGED
@@ -173,6 +173,7 @@ module AirTest
|
|
173
173
|
airtest_config.github[:token] = config['github']['token']
|
174
174
|
airtest_config.repo = config['github']['repo']
|
175
175
|
airtest_config.tool = config['tool']
|
176
|
+
airtest_config.status_filter = config['status_filter']
|
176
177
|
end
|
177
178
|
end
|
178
179
|
|
@@ -187,12 +188,15 @@ module AirTest
|
|
187
188
|
# Fetch all tickets (we'll filter them later)
|
188
189
|
all_tickets = parser.fetch_tickets(limit: 100)
|
189
190
|
|
191
|
+
puts "#{YELLOW}🔍 Found #{all_tickets.length} total tickets#{RESET}"
|
192
|
+
|
190
193
|
# Filter by search if specified
|
191
194
|
if options[:search]
|
192
195
|
all_tickets = all_tickets.select { |ticket|
|
193
196
|
title = parser.extract_ticket_title(ticket)
|
194
197
|
title.downcase.include?(options[:search].downcase)
|
195
198
|
}
|
199
|
+
puts "#{YELLOW}🔍 After search filter: #{all_tickets.length} tickets#{RESET}"
|
196
200
|
end
|
197
201
|
|
198
202
|
# Filter by status (only "Ready" or "Not started" tickets)
|
@@ -364,12 +368,14 @@ module AirTest
|
|
364
368
|
auto_pr = @prompt.select("Enable auto PR creation by default?", %w[yes no], default: 'no')
|
365
369
|
dev_assignee = @prompt.ask("Default dev assignee name?", default: 'default_assignee')
|
366
370
|
interactive_mode = @prompt.select("Enable interactive mode by default?", %w[yes no], default: 'no')
|
371
|
+
status_filter = @prompt.ask("Default status filter for tickets?", default: 'Not started')
|
367
372
|
|
368
373
|
{
|
369
374
|
tool: tool,
|
370
375
|
auto_pr: auto_pr,
|
371
376
|
dev_assignee: dev_assignee,
|
372
|
-
interactive_mode: interactive_mode
|
377
|
+
interactive_mode: interactive_mode,
|
378
|
+
status_filter: status_filter
|
373
379
|
}
|
374
380
|
end
|
375
381
|
|
@@ -386,6 +392,7 @@ module AirTest
|
|
386
392
|
'auto_pr' => config[:auto_pr],
|
387
393
|
'dev_assignee' => config[:dev_assignee],
|
388
394
|
'interactive_mode' => config[:interactive_mode],
|
395
|
+
'status_filter' => config[:status_filter],
|
389
396
|
'notion' => {
|
390
397
|
'token' => ENV['NOTION_TOKEN'] || 'your_notion_token',
|
391
398
|
'database_id' => ENV['NOTION_DATABASE_ID'] || 'your_notion_database_id'
|
@@ -445,6 +452,7 @@ module AirTest
|
|
445
452
|
NOTION_TOKEN=your_notion_token
|
446
453
|
NOTION_DATABASE_ID=your_notion_database_id
|
447
454
|
GITHUB_BOT_TOKEN=your_github_token
|
455
|
+
AIRTEST_STATUS_FILTER=Not started
|
448
456
|
ENV
|
449
457
|
when 'jira'
|
450
458
|
<<~ENV
|
@@ -453,6 +461,7 @@ module AirTest
|
|
453
461
|
JIRA_DOMAIN=your_jira_domain
|
454
462
|
JIRA_EMAIL=your_jira_email
|
455
463
|
GITHUB_BOT_TOKEN=your_github_token
|
464
|
+
AIRTEST_STATUS_FILTER=To Do
|
456
465
|
ENV
|
457
466
|
when 'monday'
|
458
467
|
<<~ENV
|
@@ -460,6 +469,7 @@ module AirTest
|
|
460
469
|
MONDAY_BOARD_ID=your_monday_board_id
|
461
470
|
MONDAY_DOMAIN=your_monday_domain
|
462
471
|
GITHUB_BOT_TOKEN=your_github_token
|
472
|
+
AIRTEST_STATUS_FILTER=Working on it
|
463
473
|
ENV
|
464
474
|
end
|
465
475
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
module AirTest
|
5
5
|
# Handles configuration for AirTest, including API tokens and environment variables.
|
6
6
|
class Configuration
|
7
|
-
attr_accessor :tool, :notion, :jira, :monday, :github, :repo
|
7
|
+
attr_accessor :tool, :notion, :jira, :monday, :github, :repo, :status_filter
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@tool = ENV.fetch("AIRTEST_TOOL", "notion")
|
@@ -27,6 +27,7 @@ module AirTest
|
|
27
27
|
token: ENV["GITHUB_BOT_TOKEN"] || ENV.fetch("GITHUB_TOKEN", nil)
|
28
28
|
}
|
29
29
|
@repo = ENV.fetch("REPO", nil)
|
30
|
+
@status_filter = ENV.fetch("AIRTEST_STATUS_FILTER", "Not started")
|
30
31
|
end
|
31
32
|
|
32
33
|
def validate!
|
@@ -12,6 +12,7 @@ module AirTest
|
|
12
12
|
def initialize(config = AirTest.configuration)
|
13
13
|
@database_id = config.notion[:database_id]
|
14
14
|
@notion_token = config.notion[:token]
|
15
|
+
@status_filter = config.status_filter || "Not started"
|
15
16
|
@base_url = "https://api.notion.com/v1"
|
16
17
|
end
|
17
18
|
|
@@ -22,16 +23,29 @@ module AirTest
|
|
22
23
|
page_size: 100,
|
23
24
|
filter: {
|
24
25
|
property: "Status",
|
25
|
-
|
26
|
-
equals:
|
26
|
+
status: {
|
27
|
+
equals: @status_filter
|
27
28
|
}
|
28
29
|
}
|
29
30
|
}
|
31
|
+
|
30
32
|
response = make_api_request(uri, request_body)
|
33
|
+
|
31
34
|
return [] unless response.code == "200"
|
32
35
|
|
33
36
|
data = JSON.parse(response.body)
|
34
|
-
data["results"].first(limit)
|
37
|
+
results = data["results"].first(limit)
|
38
|
+
|
39
|
+
# Debug: Show the first ticket's properties to understand the structure
|
40
|
+
if ENV['AIRTEST_DEBUG'] && results.any?
|
41
|
+
first_ticket = results.first
|
42
|
+
puts "🔍 Debug: First ticket properties:"
|
43
|
+
first_ticket["properties"].each do |prop_name, prop_value|
|
44
|
+
puts " - #{prop_name}: #{prop_value['type']}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
results
|
35
49
|
end
|
36
50
|
|
37
51
|
def parse_ticket_content(page_id)
|
data/lib/air_test/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: air_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.6.
|
4
|
+
version: 0.1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- julien bouland
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-07-
|
10
|
+
date: 2025-07-30 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|