diff --git a/web/api/v1/builds.py b/web/api/v1/builds.py index d0f0ab91..107269bb 100644 --- a/web/api/v1/builds.py +++ b/web/api/v1/builds.py @@ -207,7 +207,7 @@ async def download_artifact( Raises: 404: Build not found - 404: Artifact not available (build not completed successfully) + 404: Artifact not available (build not completed) """ artifact_path = service.get_artifact_path(build_id) if not artifact_path: @@ -215,7 +215,7 @@ async def download_artifact( status_code=404, detail=( f"Artifact not available for build '{build_id}'. " - "Build may not be completed or successful." + "Build may not be completed." ) ) return FileResponse( diff --git a/web/services/builds.py b/web/services/builds.py index ede6d915..619d7733 100644 --- a/web/services/builds.py +++ b/web/services/builds.py @@ -278,8 +278,11 @@ def get_artifact_path(self, build_id: str) -> Optional[str]: if build_info is None: return None - # Only return artifact if build was successful - if build_info.progress.state.name != "SUCCESS": + # Return early if build is still ongoing + if build_info.progress.state in [ + build_manager.BuildState.PENDING, + build_manager.BuildState.RUNNING, + ]: return None artifact_path = self.manager.get_build_archive_path(build_id)