Skip to content

Commit

Permalink
fix: circleci pipleine not found error (#36)
Browse files Browse the repository at this point in the history
close #30
  • Loading branch information
hamakou108 authored Mar 11, 2023
1 parent 2e187cb commit a78360c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
11 changes: 11 additions & 0 deletions depwatch/deployment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
from datetime import datetime
from pycircleci.api import Api
from requests import HTTPError
from requests.models import Response
from typing import cast

from depwatch.history import DeploymentHistory

Expand All @@ -20,6 +23,14 @@ def get_deployment_history(name: str, base: str, limit: int) -> list[DeploymentH
if len(p.get("errors")) != 0:
continue

try:
workflows = ci.get_pipeline_workflow(p.get("id"))
except HTTPError as e:
if cast(Response, e.response).status_code == 404:
continue
else:
raise e

workflows = ci.get_pipeline_workflow(p.get("id"))

stopped_at_list = [w.get("stopped_at") for w in workflows]
Expand Down
23 changes: 22 additions & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies = [
"PyGithub>=1.58.0",
"python-dotenv>=0.21.1",
"pycircleci>=0.6.1",
"requests>=2.28.2",
"types-requests>=2.28.11.15",
]
requires-python = ">=3.11"
readme = "README.md"
Expand Down

0 comments on commit a78360c

Please sign in to comment.