Skip to content

Commit

Permalink
fix(pipelines): handle error code RemoteRepositoryUnavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Mar 6, 2021
1 parent 022a179 commit 1130bb8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/common/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const ReleaseReason = new Enum({
RemoteBranchNotFound: 805,
// Invalid version
InvalidVersion: 806,
// Could not read from remote repository
RemoteRepositoryUnavailable: 807,
// Connection timeout
ConnectionTime: 900,
// Connection timeout
Expand Down
2 changes: 2 additions & 0 deletions app/jobs/buildRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ const getReasonFromBuildLogText = function(text) {
return ReleaseReason.HeapOutOfMemroy;
else if (text.includes("Invalid version"))
return ReleaseReason.InvalidVersion;
else if (text.includes("Could not read from remote repository"))
return ReleaseReason.RemoteRepositoryUnavailable;
return ReleaseReason.None;
};

Expand Down
1 change: 1 addition & 0 deletions docs/.vuepress/locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ release-reason-package-name-not-match: the name of package.json isn't matched
release-reason-package-not-found: error path package.json
release-reason-private: the package is explicitly private
release-reason-remote-branch-not-found: error remote branch name
release-reason-remote-repository-unavailable: remote repository unavailable (check submodules)
release-reason-service-unavailable: server unavailable
release-reason-unauthorized: server unauthorized
release-reason-version-conflict: the version already exists (check package.json version)
Expand Down
1 change: 1 addition & 0 deletions docs/.vuepress/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ release-reason-package-name-not-match: 该软件包名称与package.json不匹
release-reason-package-not-found: 未能找到package.json的路径
release-reason-private: 该软件包是私有的
release-reason-remote-branch-not-found: 未能找到远程分支名称
release-reason-remote-repository-unavailable: 无法读取代码仓库 (请检查submodules)
release-reason-service-unavailable: 服务器暂时无响应
release-reason-unauthorized: 服务器未授权
release-reason-version-conflict: 该版本已存在(请检查package.json的版本)
Expand Down
5 changes: 5 additions & 0 deletions test/app-jobs-buildRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,10 @@ fatal: Remote branch 4.7.1a not found in upstream origin`).should.equal(
ReleaseReason.InvalidVersion
);
});
it("RemoteRepositoryUnavailable", function() {
getReasonFromBuildLogText(
"fatal: Could not read from remote repository."
).should.equal(ReleaseReason.RemoteRepositoryUnavailable);
});
});
});

0 comments on commit 1130bb8

Please sign in to comment.