jira-auto-tool 0.1.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.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +291 -0
  4. data/CHANGELOG.md +5 -0
  5. data/CODE_OF_CONDUCT.md +132 -0
  6. data/Guardfile +105 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +159 -0
  9. data/Rakefile +20 -0
  10. data/bin/jira-auto-tool +57 -0
  11. data/bin/jira-auto-tool.bat +2 -0
  12. data/bin/setup +8 -0
  13. data/bin/setup-dev-win.bat +3 -0
  14. data/cucumber.yml +7 -0
  15. data/features/align_sprint_time_in_dates.feature +33 -0
  16. data/features/assign_tickets_to_team_sprints.feature +73 -0
  17. data/features/cache_boards.feature +24 -0
  18. data/features/control_http_request_rate_limit.feature +17 -0
  19. data/features/create_sprints_using_existing_ones_as_reference.feature +79 -0
  20. data/features/list_boards.feature +12 -0
  21. data/features/list_project_fields.feature +89 -0
  22. data/features/list_sprint_prefixes.feature +77 -0
  23. data/features/quarterly_add_sprints_using_existing_ones_as_a_reference.feature +71 -0
  24. data/features/quarterly_create_sprints_until_specific_date.feature +75 -0
  25. data/features/quarterly_rename_sprints.feature +179 -0
  26. data/features/rename_sprints.feature +203 -0
  27. data/features/self_documented_command_line.feature +15 -0
  28. data/features/sprint_filtering.feature +111 -0
  29. data/features/step_definitions/execution_context_steps.rb +33 -0
  30. data/features/step_definitions/jira_board_steps.rb +102 -0
  31. data/features/step_definitions/jira_ticket_steps.rb +63 -0
  32. data/features/support/10.setup_cucumber.rb +10 -0
  33. data/features/support/env.rb +25 -0
  34. data/features/support/hooks.rb +25 -0
  35. data/features/support/setup_rspec.rb +14 -0
  36. data/features/support/setup_simplecov.rb +5 -0
  37. data/features/update_sprint_end_date_and_shift_following_ones.feature +52 -0
  38. data/lib/jira/auto/tool/board/cache.rb +67 -0
  39. data/lib/jira/auto/tool/board/unavailable_board.rb +36 -0
  40. data/lib/jira/auto/tool/board.rb +105 -0
  41. data/lib/jira/auto/tool/board_controller/options.rb +32 -0
  42. data/lib/jira/auto/tool/board_controller.rb +88 -0
  43. data/lib/jira/auto/tool/common_options.rb +37 -0
  44. data/lib/jira/auto/tool/config/options.rb +19 -0
  45. data/lib/jira/auto/tool/config.rb +64 -0
  46. data/lib/jira/auto/tool/fetch_custom_field_options.rb +47 -0
  47. data/lib/jira/auto/tool/field.rb +59 -0
  48. data/lib/jira/auto/tool/field_controller.rb +50 -0
  49. data/lib/jira/auto/tool/field_option.rb +35 -0
  50. data/lib/jira/auto/tool/get_createmeta_for_project.rb +24 -0
  51. data/lib/jira/auto/tool/helpers/environment_based_value.rb +96 -0
  52. data/lib/jira/auto/tool/helpers/option_parser.rb +16 -0
  53. data/lib/jira/auto/tool/helpers/overridable_time.rb +18 -0
  54. data/lib/jira/auto/tool/helpers/pagination.rb +50 -0
  55. data/lib/jira/auto/tool/jira_http_options.rb +20 -0
  56. data/lib/jira/auto/tool/next_sprint_creator.rb +60 -0
  57. data/lib/jira/auto/tool/performer/options.rb +76 -0
  58. data/lib/jira/auto/tool/performer/planning_increment_sprint_creator.rb +42 -0
  59. data/lib/jira/auto/tool/performer/prefix_sprint_updater.rb +42 -0
  60. data/lib/jira/auto/tool/performer/quarterly_sprint_renamer/next_name_generator.rb +60 -0
  61. data/lib/jira/auto/tool/performer/quarterly_sprint_renamer.rb +19 -0
  62. data/lib/jira/auto/tool/performer/sprint_end_date_updater.rb +55 -0
  63. data/lib/jira/auto/tool/performer/sprint_renamer/keep_same_name_generator.rb +19 -0
  64. data/lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb +47 -0
  65. data/lib/jira/auto/tool/performer/sprint_renamer.rb +55 -0
  66. data/lib/jira/auto/tool/performer/sprint_time_in_dates_aligner.rb +52 -0
  67. data/lib/jira/auto/tool/project/options.rb +22 -0
  68. data/lib/jira/auto/tool/project/ticket_fields.rb +70 -0
  69. data/lib/jira/auto/tool/project.rb +40 -0
  70. data/lib/jira/auto/tool/rate_limited_jira_client.rb +50 -0
  71. data/lib/jira/auto/tool/request_builder/field_context_fetcher.rb +78 -0
  72. data/lib/jira/auto/tool/request_builder/field_option_fetcher.rb +54 -0
  73. data/lib/jira/auto/tool/request_builder/get.rb +29 -0
  74. data/lib/jira/auto/tool/request_builder/sprint_creator.rb +112 -0
  75. data/lib/jira/auto/tool/request_builder/sprint_state_updater.rb +60 -0
  76. data/lib/jira/auto/tool/request_builder.rb +89 -0
  77. data/lib/jira/auto/tool/setup_logging.rb +35 -0
  78. data/lib/jira/auto/tool/sprint/name.rb +105 -0
  79. data/lib/jira/auto/tool/sprint/prefix.rb +66 -0
  80. data/lib/jira/auto/tool/sprint.rb +183 -0
  81. data/lib/jira/auto/tool/sprint_controller/options.rb +61 -0
  82. data/lib/jira/auto/tool/sprint_controller.rb +152 -0
  83. data/lib/jira/auto/tool/sprint_state_controller.rb +58 -0
  84. data/lib/jira/auto/tool/team.rb +23 -0
  85. data/lib/jira/auto/tool/team_sprint_prefix_mapper/options.rb +27 -0
  86. data/lib/jira/auto/tool/team_sprint_prefix_mapper.rb +62 -0
  87. data/lib/jira/auto/tool/team_sprint_ticket_dispatcher.rb +76 -0
  88. data/lib/jira/auto/tool/ticket.rb +110 -0
  89. data/lib/jira/auto/tool/until_date.rb +68 -0
  90. data/lib/jira/auto/tool/version.rb +9 -0
  91. data/lib/jira/auto/tool.rb +216 -0
  92. data/sig/jira/sprint/tool.rbs +8 -0
  93. data/spec/jira/auto/tool/board/cache_spec.rb +179 -0
  94. data/spec/jira/auto/tool/board/unavailable_board_spec.rb +34 -0
  95. data/spec/jira/auto/tool/board_controller/options_spec.rb +52 -0
  96. data/spec/jira/auto/tool/board_controller_spec.rb +154 -0
  97. data/spec/jira/auto/tool/board_spec.rb +163 -0
  98. data/spec/jira/auto/tool/common_options_spec.rb +49 -0
  99. data/spec/jira/auto/tool/config_spec.rb +108 -0
  100. data/spec/jira/auto/tool/field_controller_spec.rb +121 -0
  101. data/spec/jira/auto/tool/field_option_spec.rb +42 -0
  102. data/spec/jira/auto/tool/field_spec.rb +99 -0
  103. data/spec/jira/auto/tool/helpers/environment_based_value_spec.rb +21 -0
  104. data/spec/jira/auto/tool/helpers/option_parser_spec.rb +21 -0
  105. data/spec/jira/auto/tool/helpers/overridable_time_spec.rb +43 -0
  106. data/spec/jira/auto/tool/helpers/pagination_spec.rb +72 -0
  107. data/spec/jira/auto/tool/jira_http_options_spec.rb +32 -0
  108. data/spec/jira/auto/tool/next_sprint_creator_spec.rb +85 -0
  109. data/spec/jira/auto/tool/performer/option_spec.rb +55 -0
  110. data/spec/jira/auto/tool/performer/planning_increment_sprint_creator_spec.rb +62 -0
  111. data/spec/jira/auto/tool/performer/prefix_sprint_updater_spec.rb +35 -0
  112. data/spec/jira/auto/tool/performer/quarterly_sprint_renamer/next_name_generator_spec.rb +175 -0
  113. data/spec/jira/auto/tool/performer/quarterly_sprint_renamer_spec.rb +239 -0
  114. data/spec/jira/auto/tool/performer/sprint_end_date_updater_spec.rb +90 -0
  115. data/spec/jira/auto/tool/performer/sprint_renamer/keep_same_name_generator_spec.rb +12 -0
  116. data/spec/jira/auto/tool/performer/sprint_renamer/next_name_generator_spec.rb +129 -0
  117. data/spec/jira/auto/tool/performer/sprint_renamer_spec.rb +240 -0
  118. data/spec/jira/auto/tool/performer/sprint_time_in_dates_aligner_spec.rb +132 -0
  119. data/spec/jira/auto/tool/project/ticket_fields_spec.rb +390 -0
  120. data/spec/jira/auto/tool/project_spec.rb +31 -0
  121. data/spec/jira/auto/tool/rate_limited_jira_client_spec.rb +82 -0
  122. data/spec/jira/auto/tool/request_builder/field_context_fetcher_spec.rb +54 -0
  123. data/spec/jira/auto/tool/request_builder/field_option_fetcher_spec.rb +64 -0
  124. data/spec/jira/auto/tool/request_builder/get_spec.rb +40 -0
  125. data/spec/jira/auto/tool/request_builder/sprint_creator_spec.rb +179 -0
  126. data/spec/jira/auto/tool/request_builder/sprint_state_updater_spec.rb +31 -0
  127. data/spec/jira/auto/tool/request_builder_spec.rb +73 -0
  128. data/spec/jira/auto/tool/sprint/name_spec.rb +101 -0
  129. data/spec/jira/auto/tool/sprint/prefix_spec.rb +207 -0
  130. data/spec/jira/auto/tool/sprint_controller_spec.rb +406 -0
  131. data/spec/jira/auto/tool/sprint_spec.rb +309 -0
  132. data/spec/jira/auto/tool/team_spec.rb +21 -0
  133. data/spec/jira/auto/tool/team_sprint_prefix_mapper_spec.rb +97 -0
  134. data/spec/jira/auto/tool/team_sprint_ticket_dispatcher_spec.rb +232 -0
  135. data/spec/jira/auto/tool/ticket_spec.rb +116 -0
  136. data/spec/jira/auto/tool/until_date_spec.rb +80 -0
  137. data/spec/jira/auto/tool_spec.rb +458 -0
  138. data/spec/spec_helper.rb +42 -0
  139. metadata +368 -0
data/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # Jira::Sprint::Tool
2
+
3
+ ![Main Workflow - main branch](https://github.com/cbroult/jira-auto-tool/actions/workflows/main.yml/badge.svg?branch=main&label=Ruby%20-%20main%20branch)
4
+ ![Main Workflow - all branches](https://github.com/cbroult/jira-auto-tool/actions/workflows/main.yml/badge.svg?label=Ruby%20-%20all%20branches)
5
+
6
+ ****
7
+ The purpose of this tool it support managing the sprints of multiple teams so it is easier to adjust to changes.
8
+ See the [feature files](./features) for some behavior examples.
9
+
10
+ ## Warning
11
+
12
+ 1. You should familiarize yourself with this tool in a Jira sandbox project **before applying it to your context**.
13
+ That can be done easily by [creating a free Atlassian account](https://www.atlassian.com/software)
14
+ like it has been done to document [this tool features](./features) using executable specifications.
15
+
16
+ 1. Remember that you are **not allowed** to use confidential/sensitive information when familiarizing with this tool
17
+ in such a cloud sandbox. Though, if the sandbox belongs to the target context
18
+ (e.g., sandbox project on the client Jira instance) you can experiment with the parameters you intend to use later.
19
+
20
+ ## Installation
21
+
22
+ 1. Install [Ruby](https://www.ruby-lang.org/en/downloads/).
23
+ 1. Install the gem...
24
+ * ... and add to the application's Gemfile by executing:
25
+
26
+ ```bash
27
+ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
28
+ ```
29
+
30
+ * ... if bundler is not being used to manage dependencies, by executing:
31
+
32
+ ```bash
33
+ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
34
+ ```
35
+
36
+ ## Setup
37
+
38
+ While we strive to use convention over configuration as a principle, the following environment variables have to be set
39
+ in order to use this tool:
40
+
41
+ Required environment variables:
42
+
43
+ - `JIRA_USERNAME` - Your Jira account username (e.g., "user@company.com").
44
+ - `JIRA_API_TOKEN` - Your Jira API authentication token.
45
+ - `JIRA_SITE_URL` - Base URL of your Jira instance (e.g., "https://your-domain.atlassian.net").
46
+ - `JIRA_BOARD_NAME` - Name of the Jira board to work with (e.g., "Team Board").
47
+ - `JIRA_BOARD_NAME_REGEX` - Regular expression pattern to match board names (e.g., "ART 16|unconventional board name").
48
+ - `JIRA_PROJECT_KEY` - Key of the Jira project (e.g., "PROJ").
49
+ - `JAT_TICKETS_FOR_TEAM_SPRINT_TICKET_DISPATCHER_JQL` - Query to identify tickets requiring sprint dispatching
50
+ (e.g., "project = PROJ AND Sprint IS EMPTY").
51
+ See [Team Ticket Dispatching](./features/assign_tickets_to_team_sprints.feature).
52
+ - `JIRA_SPRINT_FIELD_NAME` - Custom field name for Sprint (e.g., "Sprint").
53
+ - `IMPLEMENTATION_TEAM_FIELD_NAME` - Custom field name for storing team assignments (e.g., "Implementation Team").
54
+
55
+ Optional environment variables:
56
+
57
+ - `ART_SPRINT_REGEX` - Can be used to limit the sprints that are going to be manipulated (e.g., "ART-16|(4\.1)").
58
+ See [sprint filtering](./features/sprint_filtering.feature).
59
+ - `JIRA_CONTEXT_PATH` - Context path for Jira instance (if needed typically "/jira").
60
+ - `JIRA_HTTP_DEBUG` - Enable HTTP debug logging (set to "true" or "false").
61
+ - `JAT_RATE_LIMIT` - Rate limit for Jira API calls (e.g., "1").
62
+ - `JAT_RATE_INTERVAL` - Interval for rate limiting in seconds (e.g., "1").
63
+
64
+ ## Usage
65
+
66
+ * Leverage the [specification by examples](./features)
67
+ * Use the tool integrated help:
68
+ ```bash
69
+ jira-auto-tool --help
70
+ ```
71
+ * Usually the long option names have a short version equivalent to reduce typing.
72
+
73
+ Below are a few examples.
74
+
75
+ ### Add Sprints
76
+
77
+ The following is going to create sprints `sprint_prefix_25.4.3` until `sprint_prefix_25.4.6`
78
+ for the teams respective sprint prefixes.
79
+ ```bash
80
+ jira-auto-tool --sprint-add=25.4.3,4
81
+ ```
82
+
83
+ ### Align Time In Sprint Dates
84
+
85
+ ````bash
86
+ jira-auto-tool --sprint-align-time-in-dates="14:15 UTC"
87
+ ````
88
+
89
+ ### List Sprints
90
+
91
+ ```bash
92
+ jira-auto-tool --sprint-list
93
+ ```
94
+
95
+ ### List Sprint Prefixes (Teams)
96
+
97
+ ```bash
98
+ jira-auto-tool --sprint-prefix-list
99
+ ```
100
+
101
+ ### Rename Sprints
102
+
103
+ ```bash
104
+ jira-auto-tool --sprint-rename=25.3.5,25.4.1
105
+ ```
106
+
107
+ ### Team Sprint Mapping
108
+
109
+ ```bash
110
+ jira-auto-tool --team-sprint-mapping-list
111
+ ```
112
+
113
+ ### Team Ticket Sprint Dispatching
114
+
115
+ ```bash
116
+ jira-auto-tool --team-sprint-mapping-dispatch-tickets
117
+ ```
118
+
119
+ ## Development
120
+
121
+ After checking out this repository.
122
+
123
+ ### Install Dependencies
124
+
125
+ ```bash
126
+ bundle install
127
+ ```
128
+
129
+ ### Continuous Testing While Making Changes
130
+
131
+ ```bash
132
+ bundle exec guard
133
+ ```
134
+
135
+ ### Experiment Using An Interactive Prompt
136
+
137
+ ```bash
138
+ bin/console
139
+ ```
140
+
141
+ ### Install Locally
142
+
143
+ To install this gem onto your local machine, run `bundle exec rake install`.
144
+
145
+ ### Release
146
+
147
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
148
+
149
+ ## Contributing
150
+
151
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cbroult/jira-auto-tool. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/jira-auto-tool/blob/master/CODE_OF_CONDUCT.md).
152
+
153
+ ## License
154
+
155
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
156
+
157
+ ## Code of Conduct
158
+
159
+ Everyone interacting in the Jira::Sprint::Tool project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jira-auto-tool/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+ require "cucumber"
6
+ require "cucumber/rake/task"
7
+
8
+ RSpec::Core::RakeTask.new(:spec)
9
+
10
+ require "rubocop/rake_task"
11
+
12
+ RuboCop::RakeTask.new(:rubocop) do |task|
13
+ task.options = ["--autocorrect"]
14
+ end
15
+
16
+ Cucumber::Rake::Task.new do |t|
17
+ t.profile = "rake"
18
+ end
19
+
20
+ task default: %i[rubocop spec cucumber]
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ GEM_ROOT = File.expand_path("..", __dir__)
5
+ LIBRARY_PATH = File.join(GEM_ROOT, "lib")
6
+ $LOAD_PATH.unshift(LIBRARY_PATH)
7
+
8
+ DEBUG = false
9
+
10
+ if DEBUG
11
+ puts "GEM_ROOT: #{GEM_ROOT}"
12
+ puts "LIBRARY_PATH: #{LIBRARY_PATH}"
13
+ puts "$LOAD_PATH: #{$LOAD_PATH}"
14
+ end
15
+
16
+ require "bundler/setup"
17
+
18
+ require "active_support/core_ext/object/blank"
19
+ require "jira/auto/tool"
20
+ require "jira/auto/tool/board_controller/options"
21
+ require "jira/auto/tool/common_options"
22
+ require "jira/auto/tool/config/options"
23
+ require "jira/auto/tool/jira_http_options"
24
+ require "jira/auto/tool/performer/options"
25
+ require "jira/auto/tool/project/options"
26
+ require "jira/auto/tool/sprint_controller/options"
27
+ require "jira/auto/tool/team_sprint_prefix_mapper/options"
28
+
29
+ require "optparse"
30
+ require "optparse/date"
31
+
32
+ tool = Jira::Auto::Tool.new
33
+
34
+ option_parser = OptionParser.new do |parser|
35
+ Jira::Auto::Tool::CommonOptions.add(tool, parser)
36
+ Jira::Auto::Tool::JiraHttpOptions.add(tool, parser)
37
+ Jira::Auto::Tool::BoardController::Options.add(tool, parser)
38
+ Jira::Auto::Tool::Config::Options.add(tool, parser)
39
+ Jira::Auto::Tool::Project::Options.add(tool, parser)
40
+ Jira::Auto::Tool::Performer::Options.add(tool, parser)
41
+ Jira::Auto::Tool::SprintController::Options.add(tool, parser)
42
+ Jira::Auto::Tool::TeamSprintPrefixMapper::Options.add(tool, parser)
43
+ end
44
+
45
+ begin
46
+ option_parser.parse!
47
+ rescue StandardError => e
48
+ error_message = <<~EOERROR_MESSAGE
49
+ #{e.class}: #{e.message}
50
+ #{e.backtrace.join("\n")}
51
+ EOERROR_MESSAGE
52
+
53
+ log.error { error_message }
54
+ warn error_message
55
+
56
+ exit 1
57
+ end
@@ -0,0 +1,2 @@
1
+ @ECHO OFF
2
+ ruby.exe "%~dpn0" %*
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+
2
+
3
+ choco install act-cli
data/cucumber.yml ADDED
@@ -0,0 +1,7 @@
1
+ <%
2
+ default_tags = 'not @in-specification'
3
+ shared_args = "--publish-quiet --expand"
4
+ %>
5
+ default: <%= shared_args %> --format pretty --tags ' <%= default_tags %>'
6
+ guard: <%= shared_args %> --format rerun --out rerun_failures.txt --format progress --tags ' <%= default_tags %>'
7
+ rake: <%= shared_args %> --format progress --tags 'not @wip'
@@ -0,0 +1,33 @@
1
+ Feature: Align sprint time in dates
2
+
3
+ Scenario: Align time in sprints having start and end dates
4
+ Given the board only has the following sprints:
5
+ | comment | name | length | start_date | state |
6
+ | should be unchanged because closed | Food_Supply_25.1.5 | 2-week | 2024-12-01 01:00:00 UTC | closed |
7
+ | | Food_Delivery_25.1.2 | 2-week | 2024-12-14 18:00:00 UTC | future |
8
+ | | Food_Delivery_25.1.3 | 2-week | 2024-12-28 18:00:00 UTC | future |
9
+ | | Food_Restaurant_24.4.1 | 4-day | 2024-12-05 23:00:00 UTC | future |
10
+ | | Food_Restaurant_25.1.5 | 4-day | 2024-12-09 23:00:00 UTC | future |
11
+ | | Food_Market_25.3.2 | 4-day | 2024-12-05 14:00:00 UTC | future |
12
+ When I successfully run `jira-auto-tool --sprint-align-time-in-dates="11:30 UTC"`
13
+ Then afterwards the board only has the following sprints:
14
+ | name | start_date | end_date | state |
15
+ | Food_Supply_25.1.5 | 2024-12-01 01:00:00 UTC | 2024-12-15 01:00:00 UTC | closed |
16
+ | Food_Delivery_25.1.2 | 2024-12-14 11:30:00 UTC | 2024-12-28 11:30:00 UTC | future |
17
+ | Food_Delivery_25.1.3 | 2024-12-28 11:30:00 UTC | 2025-01-11 11:30:00 UTC | future |
18
+ | Food_Restaurant_24.4.1 | 2024-12-05 11:30:00 UTC | 2024-12-09 11:30:00 UTC | future |
19
+ | Food_Restaurant_25.1.5 | 2024-12-09 11:30:00 UTC | 2024-12-13 11:30:00 UTC | future |
20
+ | Food_Market_25.3.2 | 2024-12-05 11:30:00 UTC | 2024-12-09 11:30:00 UTC | future |
21
+
22
+ Scenario: Align time in sprints not having start and/or end dates
23
+ Given the board only has the following sprints:
24
+ | name | start_date | end_date | state |
25
+ | Food_Supply_25.1.5 | | | future |
26
+ | Food_Delivery_25.1.2 | 2024-12-01 18:00:00 UTC | | future |
27
+ | Food_Delivery_25.1.3 | | 2024-12-01 18:00:00 UTC | future |
28
+ When I successfully run `jira-auto-tool --satid="14:15 UTC"`
29
+ Then afterwards the board only has the following sprints:
30
+ | name | start_date | end_date | state |
31
+ | Food_Supply_25.1.5 | | | future |
32
+ | Food_Delivery_25.1.2 | 2024-12-01 14:15:00 UTC | | future |
33
+ | Food_Delivery_25.1.3 | | 2024-12-01 14:15:00 UTC | future |
@@ -0,0 +1,73 @@
1
+ Feature: Assign tickets to team sprints as per an expected start date
2
+ In order to get some activities started by a team on a given date
3
+ As a product owner
4
+ I need the ability to automatically add those tickets to the corresponding sprints
5
+
6
+ Background:
7
+ Given a Jira Scrum board
8
+ And tickets on the board have an expected date field named "Expected Start"
9
+ And tickets on the board have a team field named "Implementation Team" with exactly those values:
10
+ | values |
11
+ | A16 CRM |
12
+ | A16 E2E-Test |
13
+ | A16 Logistic |
14
+ | A16 Platform |
15
+ | A16 Sys-Team |
16
+ And the board only has the following sprints:
17
+ | name | length | start_date | state |
18
+ | ART-16_CRM_24.4.1 | 2-week | 2024-12-01 11:00:00 UTC | closed |
19
+ | ART-16_CRM_24.4.2 | 2-week | 2024-12-15 11:00:00 UTC | active |
20
+ | ART-16_E2E-Test_24.4.1 | 4-day | 2024-12-01 11:00:00 UTC | future |
21
+ | ART-16_E2E-Test_24.4.2 | 4-day | 2024-12-05 11:00:00 UTC | future |
22
+ | ART-16_Platform_24.4.6 | 3-week | 2024-10-07 11:00:00 UTC | active |
23
+ | ART-16_Platform_24.4.7 | 3-week | 2024-10-07 11:00:00 UTC | future |
24
+ | ART-16_Sys-Team_24.4.12 | 1-week | 2024-12-24 11:00:00 UTC | future |
25
+ | ART-16_Sys-Team_24.4.13 | 1-week | 2024-12-31 11:00:00 UTC | future |
26
+ | ART-16_Sys-Team_25.1.1 | 1-week | 2025-01-07 11:00:00 UTC | future |
27
+ And the following environment variables are set:
28
+ | name | value |
29
+ | IMPLEMENTATION_TEAM_FIELD_NAME | Implementation Team |
30
+ | EXPECTED_START_DATE_FIELD_NAME | Expected Start |
31
+ | JIRA_SPRINT_FIELD_NAME | Sprint |
32
+ And JAT_TICKETS_FOR_TEAM_SPRINT_TICKET_DISPATCHER_JQL has been defined as an environment variable
33
+ And the following tickets exist:
34
+ | summary | description | implementation_team | expected_start_date |
35
+ | ASX-1 - Prepare repository for CI/CD | start date is overdue => earliest sprint | A16 Sys-Team | 2024-12-05 |
36
+ | ASX-2 - Implement stage deployment | | A16 Sys-Team | 2024-12-26 |
37
+ | ASX-3 - Prepare L&P deployment | start expected on sprint last day => next one | A16 Sys-Team | 2024-12-31 |
38
+ | ASX-4 - Implement prod deployment | starts mid sprint | A16 Sys-Team | 2025-01-01 |
39
+ | ASX-5 - Setup monitoring dashboard | | A16 Sys-Team | 2025-01-07 |
40
+ | ASX-6 - Establish a solution wide holistic testing vision | | A16 E2E-Test | 2024-12-04 |
41
+ | ASX-7 - Prepare an E2E Smoke Test in CI | no sprint available at that time, so going to stay sprint-less | A16 E2E-Test | 2024-12-12 |
42
+
43
+ Scenario: List team to sprint prefix mappings
44
+ When I successfully run `jira-auto-tool --team-sprint-mapping-list`
45
+ Then the stdout should contain exactly:
46
+ """
47
+ +--------------------------------+
48
+ | Team Sprint Mappings |
49
+ +--------------+-----------------+
50
+ | Team | Sprint Prefix |
51
+ +--------------+-----------------+
52
+ | A16 E2E-Test | ART-16_E2E-Test |
53
+ | A16 Sys-Team | ART-16_Sys-Team |
54
+ +--------------+-----------------+
55
+ """
56
+
57
+ # TODO: fixme
58
+ @wip @failing-test
59
+ Scenario: Assign tickets to the relevant implementation team sprints as per the expected starts
60
+ When I successfully run `jira-auto-tool --team-sprint-mapping-dispatch-tickets`
61
+ Then the tickets should have been assigned to sprints as follows:
62
+ | summary | sprint |
63
+ | ASX-1 - Prepare repository for CI/CD | ART-16_Sys-Team_24.4.12 |
64
+ | ASX-2 - Implement stage deployment | ART-16_Sys-Team_24.4.12 |
65
+ | ASX-3 - Prepare L&P deployment | ART-16_Sys-Team_24.4.13 |
66
+ | ASX-4 - Implement prod deployment | ART-16_Sys-Team_24.4.13 |
67
+ | ASX-5 - Setup monitoring dashboard | ART-16_Sys-Team_25.1.1 |
68
+ | ASX-6 - Establish a solution wide holistic testing vision | ART-16_E2E-Test_24.4.1 |
69
+ | ASX-7 - Prepare an E2E Smoke Test in CI | |
70
+
71
+ Scenario: Error Messages for tickets where no team sprint exists
72
+
73
+ Scenario: Error Messages for tickets where no team sprint exists
@@ -0,0 +1,24 @@
1
+ Feature: Cache boards
2
+ In order to quickly manipulate sprints in a Jira instance having hundreds of boards
3
+ As a user
4
+ I need the boards I am interested in to be cached
5
+
6
+ Background:
7
+ Given the following environment variables are set:
8
+ | name | value |
9
+ | JIRA_BOARD_NAME_REGEX | Delivery |
10
+ And I successfully run `jira-auto-tool --board-list`
11
+
12
+ Scenario: After being found the boards are no longer searched for
13
+ When I successfully run `jira-auto-tool --jira-http-debug --board-list`
14
+ Then the output contains no requests that enumerate the list of boards
15
+
16
+ Scenario: The cache is invalidated after one hour
17
+ Given I wait for over a day
18
+ When I successfully run `jira-auto-tool --jira-http-debug --board-list`
19
+ Then the output contains requests that enumerate the list of boards
20
+
21
+ Scenario: Explicitly clear the cache
22
+ When I successfully run `jira-auto-tool --jira-http-debug --board-cache-clear --board-list`
23
+ Then the output contains requests that enumerate the list of boards
24
+
@@ -0,0 +1,17 @@
1
+ Feature: Control the HTTP request rate limit
2
+ In order to work against a JIRA instance imposing API rate limits
3
+ As a user
4
+ I need the ability to control the HTTP request limit
5
+
6
+ Scenario Outline: Limiting the request rate
7
+ Given the following environment variables are set:
8
+ | name | value |
9
+ | JAT_RATE_LIMIT_IN_SECONDS | <rate_limit> |
10
+ | JAT_RATE_INTERVAL_IN_SECONDS | <rate_interval> |
11
+ Then successfully running `jira-auto-tool --board-list --sprint-prefix` takes between <minimal_time> and <maximal_time> seconds
12
+
13
+ Examples:
14
+ | rate_limit | rate_interval | minimal_time | maximal_time |
15
+ | 0 | 0 | 0 | 5 |
16
+ | 1 | 2 | 1 | 20 |
17
+ | 1 | 10 | 18 | 120 |
@@ -0,0 +1,79 @@
1
+ Feature: Add sprints using existing ones as reference
2
+ In order to prepare for multi-team sprints in the future
3
+ As an RTE
4
+ I need the ability to add sprints according to sprint/team prefixes
5
+
6
+ Background:
7
+ Given a Jira Scrum board
8
+ And the board only has the following sprints:
9
+ | comment | name | length | start_date | state |
10
+ | none added since closed | Food_Supply_25.1.3 | 2-week | 2025-02-01 11:00:00 UTC | closed |
11
+ | "sprints | Food_Delivery_25.1.4 | 4-day | 2025-02-01 11:00:00 UTC | future |
12
+ | expected to be | Food_Market_25.2.1 | 3-week | 2025-02-01 11:00:00 UTC | active |
13
+ | added" | Food_Restaurant_25.2.1 | 4-week | 2025-02-21 11:00:00 UTC | future |
14
+
15
+ Scenario: Add several sprints using existing sprint prefixes
16
+ When I successfully run `jira-auto-tool --sprint-add=25.3.1,4`
17
+ Then afterwards the board only has the following sprints:
18
+ | name | start_date | state |
19
+ | Food_Supply_25.1.3 | 2025-02-01 11:00:00 UTC | closed |
20
+ | Food_Delivery_25.1.4 | 2025-02-01 11:00:00 UTC | future |
21
+ | Food_Delivery_25.3.1 | 2025-02-05 11:00:00 UTC | future |
22
+ | Food_Delivery_25.3.2 | 2025-02-09 11:00:00 UTC | future |
23
+ | Food_Delivery_25.3.3 | 2025-02-13 11:00:00 UTC | future |
24
+ | Food_Delivery_25.3.4 | 2025-02-17 11:00:00 UTC | future |
25
+ | Food_Market_25.2.1 | 2025-02-01 11:00:00 UTC | active |
26
+ | Food_Market_25.3.1 | 2025-02-22 11:00:00 UTC | future |
27
+ | Food_Market_25.3.2 | 2025-03-15 11:00:00 UTC | future |
28
+ | Food_Market_25.3.3 | 2025-04-05 11:00:00 UTC | future |
29
+ | Food_Market_25.3.4 | 2025-04-26 11:00:00 UTC | future |
30
+ | Food_Restaurant_25.2.1 | 2025-02-21 11:00:00 UTC | future |
31
+ | Food_Restaurant_25.3.1 | 2025-03-21 11:00:00 UTC | future |
32
+ | Food_Restaurant_25.3.2 | 2025-04-18 11:00:00 UTC | future |
33
+ | Food_Restaurant_25.3.3 | 2025-05-16 11:00:00 UTC | future |
34
+ | Food_Restaurant_25.3.4 | 2025-06-13 11:00:00 UTC | future |
35
+
36
+ Scenario: Add several planning interval sprints
37
+ When I successfully run `jira-auto-tool --sprint-add=25.2.2,3 --sprint-add=25.3.1,4 --sprint-add=25.4.1,5`
38
+ Then afterwards the board only has the following sprints:
39
+ | name | start_date | state |
40
+ | Food_Supply_25.1.3 | 2025-02-01 11:00:00 UTC | closed |
41
+ | Food_Delivery_25.1.4 | 2025-02-01 11:00:00 UTC | future |
42
+ | Food_Delivery_25.2.2 | 2025-02-05 11:00:00 UTC | future |
43
+ | Food_Delivery_25.2.3 | 2025-02-09 11:00:00 UTC | future |
44
+ | Food_Delivery_25.2.4 | 2025-02-13 11:00:00 UTC | future |
45
+ | Food_Delivery_25.3.1 | 2025-02-17 11:00:00 UTC | future |
46
+ | Food_Delivery_25.3.2 | 2025-02-21 11:00:00 UTC | future |
47
+ | Food_Delivery_25.3.3 | 2025-02-25 11:00:00 UTC | future |
48
+ | Food_Delivery_25.3.4 | 2025-03-01 11:00:00 UTC | future |
49
+ | Food_Delivery_25.4.1 | 2025-03-05 11:00:00 UTC | future |
50
+ | Food_Delivery_25.4.2 | 2025-03-09 11:00:00 UTC | future |
51
+ | Food_Delivery_25.4.3 | 2025-03-13 11:00:00 UTC | future |
52
+ | Food_Delivery_25.4.4 | 2025-03-17 11:00:00 UTC | future |
53
+ | Food_Delivery_25.4.5 | 2025-03-21 11:00:00 UTC | future |
54
+ | Food_Market_25.2.1 | 2025-02-01 11:00:00 UTC | active |
55
+ | Food_Market_25.2.2 | 2025-02-22 11:00:00 UTC | future |
56
+ | Food_Market_25.2.3 | 2025-03-15 11:00:00 UTC | future |
57
+ | Food_Market_25.2.4 | 2025-04-05 11:00:00 UTC | future |
58
+ | Food_Market_25.3.1 | 2025-04-26 11:00:00 UTC | future |
59
+ | Food_Market_25.3.2 | 2025-05-17 11:00:00 UTC | future |
60
+ | Food_Market_25.3.3 | 2025-06-07 11:00:00 UTC | future |
61
+ | Food_Market_25.3.4 | 2025-06-28 11:00:00 UTC | future |
62
+ | Food_Market_25.4.1 | 2025-07-19 11:00:00 UTC | future |
63
+ | Food_Market_25.4.2 | 2025-08-09 11:00:00 UTC | future |
64
+ | Food_Market_25.4.3 | 2025-08-30 11:00:00 UTC | future |
65
+ | Food_Market_25.4.4 | 2025-09-20 11:00:00 UTC | future |
66
+ | Food_Market_25.4.5 | 2025-10-11 11:00:00 UTC | future |
67
+ | Food_Restaurant_25.2.1 | 2025-02-21 11:00:00 UTC | future |
68
+ | Food_Restaurant_25.2.2 | 2025-03-21 11:00:00 UTC | future |
69
+ | Food_Restaurant_25.2.3 | 2025-04-18 11:00:00 UTC | future |
70
+ | Food_Restaurant_25.2.4 | 2025-05-16 11:00:00 UTC | future |
71
+ | Food_Restaurant_25.3.1 | 2025-06-13 11:00:00 UTC | future |
72
+ | Food_Restaurant_25.3.2 | 2025-07-11 11:00:00 UTC | future |
73
+ | Food_Restaurant_25.3.3 | 2025-08-08 11:00:00 UTC | future |
74
+ | Food_Restaurant_25.3.4 | 2025-09-05 11:00:00 UTC | future |
75
+ | Food_Restaurant_25.4.1 | 2025-10-03 11:00:00 UTC | future |
76
+ | Food_Restaurant_25.4.2 | 2025-10-31 11:00:00 UTC | future |
77
+ | Food_Restaurant_25.4.3 | 2025-11-28 11:00:00 UTC | future |
78
+ | Food_Restaurant_25.4.4 | 2025-12-26 11:00:00 UTC | future |
79
+ | Food_Restaurant_25.4.5 | 2026-01-23 11:00:00 UTC | future |
@@ -0,0 +1,12 @@
1
+ Feature: List Boards
2
+ # TODO: add Supply and Delivery boards so they are listed and checked
3
+ Scenario: List Boards
4
+ When I successfully run `jira-auto-tool --board-list`
5
+ Then the output should match:
6
+ """
7
+ \+------------------------------+----\+
8
+ \|\s+Boards\s+\|
9
+ \+----+-\+-----+-\+-------------+----\+
10
+ \| Project Key\s+\| Name \s+\| Board UI URL\s+\|
11
+ \+----+-\+-----+-\+-------------+----\+
12
+ """
@@ -0,0 +1,89 @@
1
+ Feature: List Project Ticket Fields
2
+ In order to understand the project ticket expectations
3
+ As a Jira user
4
+ I need to list the project ticket fields
5
+
6
+ Scenario: List Project Ticket Fields
7
+ Given a Jira project
8
+ When I successfully run `jira-auto-tool --project-field-list`
9
+ Then the output should contain:
10
+ """
11
+ +-------------+-------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------+
12
+ | Ticket Type | Field Key | Field Name | Field Type | Allowed Values |
13
+ +-------------+-------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------+
14
+ | Bug | assignee | Assignee | user | n/a |
15
+ | Bug | attachment | Attachment | array | n/a |
16
+ | Bug | components | Components | array | [] |
17
+ | Bug | customfield_10001 | Team | team | n/a |
18
+ | Bug | customfield_10020 | Sprint | array | n/a |
19
+ | Bug | customfield_10081 | Expected Start | date | n/a |
20
+ | Bug | customfield_10082 | Implementation Team | option | ["A16 CRM (10044)", "A16 E2E-Test (10045)", "A16 Logistic (10048)", "A16 Platform (10046)", "A16 Sys-Team (10047)"] |
21
+ | Bug | description | Description | string | n/a |
22
+ """
23
+ Then the output should contain:
24
+ """
25
+ | Epic | assignee | Assignee | user | n/a |
26
+ | Epic | attachment | Attachment | array | n/a |
27
+ | Epic | components | Components | array | [] |
28
+ | Epic | customfield_10001 | Team | team | n/a |
29
+ | Epic | customfield_10020 | Sprint | array | n/a |
30
+ | Epic | customfield_10081 | Expected Start | date | n/a |
31
+ | Epic | customfield_10082 | Implementation Team | option | ["A16 CRM (10044)", "A16 E2E-Test (10045)", "A16 Logistic (10048)", "A16 Platform (10046)", "A16 Sys-Team (10047)"] |
32
+ | Epic | description | Description | string | n/a |
33
+ | Epic | fixVersions | Fix versions | array | [] |
34
+ | Epic | issuelinks | Linked Issues | array | n/a |
35
+ | Epic | issuetype | Issue Type | issuetype | ["Epic (10000)"] |
36
+ | Epic | labels | Labels | array | n/a |
37
+ | Epic | priority | Priority | priority | ["Highest (1)", "High (2)", "Medium (3)", "Low (4)", "Lowest (5)"] |
38
+ """
39
+ Then the output should contain:
40
+ """
41
+ | Story | assignee | Assignee | user | n/a |
42
+ | Story | attachment | Attachment | array | n/a |
43
+ | Story | components | Components | array | [] |
44
+ | Story | customfield_10001 | Team | team | n/a |
45
+ | Story | customfield_10020 | Sprint | array | n/a |
46
+ | Story | customfield_10081 | Expected Start | date | n/a |
47
+ | Story | customfield_10082 | Implementation Team | option | ["A16 CRM (10044)", "A16 E2E-Test (10045)", "A16 Logistic (10048)", "A16 Platform (10046)", "A16 Sys-Team (10047)"] |
48
+ | Story | description | Description | string | n/a |
49
+ | Story | fixVersions | Fix versions | array | [] |
50
+ | Story | issuelinks | Linked Issues | array | n/a |
51
+ | Story | issuetype | Issue Type | issuetype | ["Story (10003)"] |
52
+ | Story | labels | Labels | array | n/a |
53
+ | Story | parent | Parent | issuelink | n/a |
54
+ | Story | priority | Priority | priority | ["Highest (1)", "High (2)", "Medium (3)", "Low (4)", "Lowest (5)"] |
55
+ """
56
+ Then the output should contain:
57
+ """
58
+ | Sub-task | assignee | Assignee | user | n/a |
59
+ | Sub-task | attachment | Attachment | array | n/a |
60
+ | Sub-task | components | Components | array | [] |
61
+ | Sub-task | customfield_10001 | Team | team | n/a |
62
+ | Sub-task | customfield_10020 | Sprint | array | n/a |
63
+ | Sub-task | customfield_10081 | Expected Start | date | n/a |
64
+ | Sub-task | customfield_10082 | Implementation Team | option | ["A16 CRM (10044)", "A16 E2E-Test (10045)", "A16 Logistic (10048)", "A16 Platform (10046)", "A16 Sys-Team (10047)"] |
65
+ | Sub-task | description | Description | string | n/a |
66
+ | Sub-task | fixVersions | Fix versions | array | [] |
67
+ | Sub-task | issuelinks | Linked Issues | array | n/a |
68
+ | Sub-task | issuetype | Issue Type | issuetype | ["Sub-task (10006)"] |
69
+ | Sub-task | labels | Labels | array | n/a |
70
+ | Sub-task | parent | Parent | issuelink | n/a |
71
+ | Sub-task | priority | Priority | priority | ["Highest (1)", "High (2)", "Medium (3)", "Low (4)", "Lowest (5)"] |
72
+ """
73
+ Then the output should contain:
74
+ """
75
+ | Task | assignee | Assignee | user | n/a |
76
+ | Task | attachment | Attachment | array | n/a |
77
+ | Task | components | Components | array | [] |
78
+ | Task | customfield_10001 | Team | team | n/a |
79
+ | Task | customfield_10020 | Sprint | array | n/a |
80
+ | Task | customfield_10081 | Expected Start | date | n/a |
81
+ | Task | customfield_10082 | Implementation Team | option | ["A16 CRM (10044)", "A16 E2E-Test (10045)", "A16 Logistic (10048)", "A16 Platform (10046)", "A16 Sys-Team (10047)"] |
82
+ | Task | description | Description | string | n/a |
83
+ | Task | fixVersions | Fix versions | array | [] |
84
+ | Task | issuelinks | Linked Issues | array | n/a |
85
+ | Task | issuetype | Issue Type | issuetype | ["Task (10005)"] |
86
+ | Task | labels | Labels | array | n/a |
87
+ | Task | parent | Parent | issuelink | n/a |
88
+ | Task | priority | Priority | priority | ["Highest (1)", "High (2)", "Medium (3)", "Low (4)", "Lowest (5)"] |
89
+ """