Merge pull request #218 from nix-community/retries

fix retries beeing zero
This commit is contained in:
Jörg Thalheim 2024-07-12 07:55:48 +02:00 committed by GitHub
commit d6ae979a91
Failed to generate hash of commit
2 changed files with 2 additions and 17 deletions

View file

@ -252,7 +252,7 @@ class NixBuildCommand(buildstep.ShellMixin, steps.BuildStep):
yield self.runCommand(cmd) yield self.runCommand(cmd)
res = cmd.results() res = cmd.results()
if res == util.FAILURE: if res == util.FAILURE and self.retries > 0:
retries = RETRY_COUNTER.retry_build(self.getProperty("build_uuid")) retries = RETRY_COUNTER.retry_build(self.getProperty("build_uuid"))
if retries > self.retries - 1: if retries > self.retries - 1:
return util.RETRY return util.RETRY

View file

@ -650,22 +650,7 @@ class GithubBackend(GitBackend):
} }
def create_avatar_method(self) -> AvatarBase | None: def create_avatar_method(self) -> AvatarBase | None:
avatar = AvatarGitHub(token=self.auth_backend.get_general_token().get()) return AvatarGitHub()
# TODO: not a proper fix, the /users/{username} endpoint is per installation, but I'm not sure
# how to tell which installation token to use, unless there is a way to build a huge map of
# username -> token, or we just try each one in order
def _get_avatar_by_username(self: Any, username: Any) -> Any:
return f"https://github.com/{username}.png"
import types
avatar._get_avatar_by_username = types.MethodType( # noqa: SLF001
_get_avatar_by_username,
avatar,
)
return avatar
def create_auth(self) -> AuthBase: def create_auth(self) -> AuthBase:
assert self.config.oauth_id is not None, "GitHub OAuth ID is required" assert self.config.oauth_id is not None, "GitHub OAuth ID is required"