Skip to content

Commit ecaadcb

Browse files
committed
bump API_VERSION to 2.0 for all services
1 parent d459e7a commit ecaadcb

31 files changed

Lines changed: 56 additions & 35 deletions

bugwarrior/config/schema.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ class ServiceConfig(_ServiceConfig):
203203
service: str
204204
target: str
205205

206-
@property
207-
def keyring_service(self) -> str:
208-
return self.KEYRING_SERVICE.format(**self.model_dump())
209-
210206
# Added during validation (computed field)
211207
templates: dict[str, str] = {}
212208

@@ -217,6 +213,18 @@ def keyring_service(self) -> str:
217213
add_tags: ConfigList = []
218214
static_fields: ConfigList = []
219215

216+
@property
217+
def keyring_service(self) -> str:
218+
# FIXME change this import and move it outside method after rebase
219+
from bugwarrior.collect import get_service
220+
221+
service = get_service(self.service)
222+
if service.API_VERSION < 2:
223+
assert hasattr(service, "get_keyring_service")
224+
return service.get_keyring_service(self) # ty: ignore
225+
226+
return self.KEYRING_SERVICE.format(**self.model_dump())
227+
220228
@model_validator(mode="before")
221229
@classmethod
222230
def compute_templates(cls, values: dict[str, Any]) -> dict[str, Any]:

bugwarrior/docs/other-services/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Python API v1.0
1+
Python API v2.0
22
===============
33

44
The interfaces documented here are considered stable. All other interfaces

bugwarrior/docs/other-services/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Now for the main service class which bugwarrior will invoke to fetch issues.
190190
.. code:: python
191191
192192
class GitBugService(Service):
193-
API_VERSION = 1.0
193+
API_VERSION = 2.0
194194
ISSUE_CLASS = GitBugIssue
195195
CONFIG_SCHEMA = GitBugConfig
196196

bugwarrior/services/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# spec will cause breakages with older bugwarrior releases.
3838
# MINOR versions signal extensions of the spec which enhance future releases of
3939
# bugwarrior without breaking past releases.
40-
LATEST_API_VERSION = 1.0
40+
LATEST_API_VERSION = 2.0
4141

4242

4343
class URLShortener:

bugwarrior/services/azuredevops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def get_default_description(self) -> str:
184184

185185

186186
class AzureDevopsService(Service[AzureDevopsIssue]):
187-
API_VERSION = 1.0
187+
API_VERSION = 2.0
188188
ISSUE_CLASS = AzureDevopsIssue
189189
CONFIG_SCHEMA = AzureDevopsConfig
190190

bugwarrior/services/bitbucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def get_default_description(self) -> str:
8181

8282

8383
class BitbucketService(Service[BitbucketIssue]):
84-
API_VERSION = 1.0
84+
API_VERSION = 2.0
8585
ISSUE_CLASS = BitbucketIssue
8686
CONFIG_SCHEMA = BitbucketConfig
8787

bugwarrior/services/bts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_priority(self) -> config.Priority:
104104

105105

106106
class BTSService(Service[BTSIssue]):
107-
API_VERSION = 1.0
107+
API_VERSION = 2.0
108108
ISSUE_CLASS = BTSIssue
109109
CONFIG_SCHEMA = BTSConfig
110110

bugwarrior/services/bz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def get_default_description(self) -> str:
119119

120120

121121
class BugzillaService(Service[BugzillaIssue]):
122-
API_VERSION = 1.0
122+
API_VERSION = 2.0
123123
ISSUE_CLASS = BugzillaIssue
124124
CONFIG_SCHEMA = BugzillaConfig
125125

bugwarrior/services/clickup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def parse_timestamp(
121121

122122

123123
class ClickupService(Service[ClickupIssue]):
124-
API_VERSION = 1.0
124+
API_VERSION = 2.0
125125
ISSUE_CLASS = ClickupIssue
126126
CONFIG_SCHEMA = ClickupConfig
127127

bugwarrior/services/deck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_default_description(self) -> str:
127127

128128

129129
class NextcloudDeckService(Service[NextcloudDeckIssue]):
130-
API_VERSION = 1.0
130+
API_VERSION = 2.0
131131
ISSUE_CLASS = NextcloudDeckIssue
132132
CONFIG_SCHEMA = NextcloudDeckConfig
133133

0 commit comments

Comments
 (0)