Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch AzureDevops Builds by finishTimeDescending #7068

Merged
merged 2 commits into from
Feb 29, 2024
Merged
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
4 changes: 3 additions & 1 deletion backend/python/plugins/azuredevops/azuredevops/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def commits(self, org: str, project: str, repo_id: str):
return self.get(org, project, '_apis/git/repositories', repo_id, 'commits')

def builds(self, org: str, project: str, repository_id: str, provider: str):
return self.get(org, project, '_apis/build/builds', repositoryId=repository_id, repositoryType=provider, deletedFilter='excludeDeleted')
return self.get(org, project, '_apis/build/builds', repositoryId=repository_id, repositoryType=provider,
deletedFilter='excludeDeleted',
queryOrder="finishTimeDescending")

def jobs(self, org: str, project: str, build_id: int):
return self.get(org, project, '_apis/build/builds', build_id, 'timeline')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def convert(self, b: Build, ctx: Context):
environment = devops.CICDEnvironment.PRODUCTION
if ctx.scope_config.production_pattern is not None and ctx.scope_config.production_pattern.search(
b.name) is None:
environment = devops.CICDEnvironment.EMPTY
environment = None

if b.finish_time:
duration_sec = abs(b.finish_time.timestamp() - b.start_time.timestamp())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def convert(self, j: Job, ctx: Context) -> Iterable[devops.CICDPipeline]:
environment = devops.CICDEnvironment.PRODUCTION
if ctx.scope_config.production_pattern is not None and ctx.scope_config.production_pattern.search(
j.name) is None:
environment = devops.CICDEnvironment.EMPTY
environment = None

if j.finish_time:
duration_sec = abs(j.finish_time.timestamp() - j.start_time.timestamp())
Expand Down
Loading