Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions release_scope/_gitlab.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dataclasses
import datetime
import datetime as dt
import math
import typing
from urllib.parse import quote, unquote
Expand Down Expand Up @@ -54,7 +54,7 @@ class Commit(pydantic.BaseModel):
title: str
message: str = ""
author_name: str | None = None
committed_date: datetime.datetime
committed_date: dt.datetime
web_url: str | None = None


Expand Down Expand Up @@ -228,7 +228,7 @@ def list_first_parent_commits(
)

def list_merged_merge_requests(
self, project_id: int, *, target_branch: str, updated_after: datetime.datetime
self, project_id: int, *, target_branch: str, updated_after: dt.datetime
) -> list[MergeRequest]:
merge_requests, _ = self._pages(
f"{_API}/projects/{project_id}/merge_requests",
Expand All @@ -252,7 +252,7 @@ def commit_merge_requests(self, project_id: int, sha: str) -> list[MergeRequest]
)
return merge_requests

def list_push_pipelines(self, project_id: int, *, ref: str, updated_after: datetime.datetime) -> list[Pipeline]:
def list_push_pipelines(self, project_id: int, *, ref: str, updated_after: dt.datetime) -> list[Pipeline]:
pipelines, _ = self._pages(
f"{_API}/projects/{project_id}/pipelines",
{"ref": ref, "source": "push", "updated_after": updated_after.isoformat()},
Expand Down
6 changes: 3 additions & 3 deletions release_scope/_report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import datetime
import datetime as dt
import typing

import pydantic
Expand Down Expand Up @@ -45,7 +45,7 @@ class CommitRef(pydantic.BaseModel):
title: str
url: str | None
author: str | None
committed_at: datetime.datetime
committed_at: dt.datetime


class JiraKeyRef(pydantic.BaseModel):
Expand Down Expand Up @@ -127,7 +127,7 @@ class JiraState(pydantic.BaseModel):

class Report(pydantic.BaseModel):
schema_version: typing.Literal[3] = SCHEMA_VERSION
collected_at: datetime.datetime
collected_at: dt.datetime
production_environment: str
services: list[Service]
jira: JiraState | None = None
Expand Down
8 changes: 4 additions & 4 deletions release_scope/_use_case.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections.abc
import dataclasses
import datetime
import datetime as dt
import http
import typing
from urllib.parse import quote
Expand Down Expand Up @@ -122,7 +122,7 @@ def __call__(
for project in self._resolve_projects(groups=groups, projects=projects, include_subgroups=include_subgroups)
]
return Report(
collected_at=datetime.datetime.now(datetime.UTC),
collected_at=dt.datetime.now(dt.UTC),
production_environment=self.settings.production_environment,
services=services,
jira=self._read_issues(self.jira, _row_keys(services)) if self.jira else None,
Expand All @@ -148,7 +148,7 @@ def for_issues(self, *, keys: collections.abc.Sequence[str], cache: Cache) -> Re
state.missing.extend(row_state.missing)
state.error = row_state.error
return Report(
collected_at=datetime.datetime.now(datetime.UTC),
collected_at=dt.datetime.now(dt.UTC),
production_environment=self.settings.production_environment,
services=services,
jira=state,
Expand Down Expand Up @@ -380,7 +380,7 @@ def _release(self, project: Project, target: _LinkTarget, walk: _Walk, index: in
)

def _commit_merge_requests(
self, project: Project, default_branch: str, commits: list[Commit], since: datetime.datetime, cache: Cache
self, project: Project, default_branch: str, commits: list[Commit], since: dt.datetime, cache: Cache
) -> dict[str, list[MergeRequest]]:
merged: typing.Final = self.api.list_merged_merge_requests(
project.id, target_branch=default_branch, updated_after=since
Expand Down
Loading