nixbot

builds
1tribuchet: building on mac022....FF...........FFFF.F [100%]3=================================== FAILURES ===================================4___________________ TestFlakeService.test_update_flake_input ___________________56self = <update_flake_inputs.flake_service.FlakeService object at 0x10a112650>7input_name = 'flake-utils', flake_file = 'flake.nix'8work_dir = '/private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse'910 def update_flake_input(11 self,12 input_name: str,13 flake_file: str,14 work_dir: str | None = None,15 ) -> None:16 """Update a specific flake input.17 18 Args:19 input_name: Name of the input to update20 flake_file: Path to the flake file21 work_dir: Optional working directory to resolve flake file path from22 23 """24 try:25 logger.info("Updating flake input: %s in %s", input_name, flake_file)26 27 # If work_dir is provided, resolve the flake file relative to it28 absolute_flake_path = Path(work_dir) / flake_file if work_dir else Path(flake_file)29 30 flake_dir = absolute_flake_path.parent or Path()31 absolute_flake_dir = flake_dir.resolve()32 33 # Use a shallow URL because worktrees may not have the full history.34 # For subflakes, nix needs the URL to point to the git root35 # with a dir= parameter rather than the subdirectory directly.36 if work_dir:37 git_root = Path(work_dir).resolve()38 relative_dir = absolute_flake_dir.relative_to(git_root)39 flake_url = f"git+file://{git_root}?shallow=1"40 if str(relative_dir) != ".":41 flake_url += f"&dir={relative_dir}"42 else:43 flake_url = f"git+file://{absolute_flake_dir}?shallow=1"44 45> result = subprocess.run(46 [47 "nix",48 "flake",49 "update",50 "--flake",51 flake_url,52 input_name,53 ],54 cwd=str(flake_dir),55 capture_output=True,56 text=True,57 check=True,58 )5960src/update_flake_inputs/flake_service.py:191: 61_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 6263input = None, capture_output = True, timeout = None, check = True64popenargs = (['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse?shallow=1', 'flake-utils'],)65kwargs = {'cwd': '/private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse', 'stderr': -1, 'stdout': -1, 'text': True}66process = <Popen: returncode: 1 args: ['nix', 'flake', 'update', '--flake', 'git+file:...>67stdout = ''68stderr = "warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostna...b.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com\n"69retcode = 17071 def run(*popenargs,72 input=None, capture_output=False, timeout=None, check=False, **kwargs):73 """Run command with arguments and return a CompletedProcess instance.74 75 The returned instance will have attributes args, returncode, stdout and76 stderr. By default, stdout and stderr are not captured, and those attributes77 will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,78 or pass capture_output=True to capture both.79 80 If check is True and the exit code was non-zero, it raises a81 CalledProcessError. The CalledProcessError object will have the return code82 in the returncode attribute, and output & stderr attributes if those streams83 were captured.84 85 If timeout (seconds) is given and the process takes too long,86 a TimeoutExpired exception will be raised.87 88 There is an optional argument "input", allowing you to89 pass bytes or a string to the subprocess's stdin. If you use this argument90 you may not also use the Popen constructor's "stdin" argument, as91 it will be used internally.92 93 By default, all communication is in bytes, and therefore any "input" should94 be bytes, and the stdout and stderr will be bytes. If in text mode, any95 "input" should be a string, and stdout and stderr will be strings decoded96 according to locale encoding, or by "encoding" if set. Text mode is97 triggered by setting any of text, encoding, errors or universal_newlines.98 99 The other arguments are the same as for the Popen constructor.100 """101 if input is not None:102 if kwargs.get('stdin') is not None:103 raise ValueError('stdin and input arguments may not both be used.')104 kwargs['stdin'] = PIPE105 106 if capture_output:107 if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:108 raise ValueError('stdout and stderr arguments may not be used '109 'with capture_output.')110 kwargs['stdout'] = PIPE111 kwargs['stderr'] = PIPE112 113 with Popen(*popenargs, **kwargs) as process:114 try:115 stdout, stderr = process.communicate(input, timeout=timeout)116 except TimeoutExpired as exc:117 process.kill()118 if _mswindows:119 # Windows accumulates the output in a single blocking120 # read() call run on child threads, with the timeout121 # being done in a join() on those threads. communicate()122 # _after_ kill() is required to collect that and add it123 # to the exception.124 exc.stdout, exc.stderr = process.communicate()125 else:126 # POSIX _communicate already populated the output so127 # far into the TimeoutExpired exception.128 process.wait()129 raise130 except: # Including KeyboardInterrupt, communicate handled that.131 process.kill()132 # We don't call process.wait() as .__exit__ does that for us.133 raise134 retcode = process.poll()135 if check and retcode:136> raise CalledProcessError(retcode, process.args,137 output=stdout, stderr=stderr)138E subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse?shallow=1', 'flake-utils']' returned non-zero exit status 1.139140/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py:577: CalledProcessError141142The above exception was the direct cause of the following exception:143144self = <tests.test_flake_service.TestFlakeService object at 0x10a15e9f0>145flake_service = <update_flake_inputs.flake_service.FlakeService object at 0x10a112650>146fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')147148 @pytest.mark.impure149 def test_update_flake_input(150 self,151 flake_service: FlakeService,152 fixtures_path: Path,153 ) -> None:154 """Test updating a flake input and modifying the lock file."""155 # Create a temporary directory for the test156 with tempfile.TemporaryDirectory() as temp_dir:157 temp_path = Path(temp_dir)158 159 # Copy minimal flake to temp directory160 shutil.copy(161 fixtures_path / "minimal" / "flake.nix",162 temp_path / "flake.nix",163 )164 shutil.copy(165 fixtures_path / "minimal" / "flake.lock",166 temp_path / "flake.lock",167 )168 169 # Initialize git repo in temp directory170 subprocess.run(["git", "init"], cwd=temp_path, check=True)171 subprocess.run(["git", "add", "."], cwd=temp_path, check=True)172 subprocess.run(173 ["git", "commit", "-m", "Initial commit"],174 cwd=temp_path,175 check=True,176 env={177 **os.environ,178 "GIT_AUTHOR_NAME": "Test User",179 "GIT_AUTHOR_EMAIL": "test@example.com",180 "GIT_COMMITTER_NAME": "Test User",181 "GIT_COMMITTER_EMAIL": "test@example.com",182 },183 )184 185 # Get the original lock file content186 original_lock_content = (temp_path / "flake.lock").read_text()187 original_lock = json.loads(original_lock_content)188 original_flake_utils_rev = original_lock["nodes"]["flake-utils"]["locked"]["rev"]189 190 # Update flake-utils input191> flake_service.update_flake_input("flake-utils", "flake.nix", str(temp_path))192193tests/test_flake_service.py:198: 194_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195196self = <update_flake_inputs.flake_service.FlakeService object at 0x10a112650>197input_name = 'flake-utils', flake_file = 'flake.nix'198work_dir = '/private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse'199200 def update_flake_input(201 self,202 input_name: str,203 flake_file: str,204 work_dir: str | None = None,205 ) -> None:206 """Update a specific flake input.207 208 Args:209 input_name: Name of the input to update210 flake_file: Path to the flake file211 work_dir: Optional working directory to resolve flake file path from212 213 """214 try:215 logger.info("Updating flake input: %s in %s", input_name, flake_file)216 217 # If work_dir is provided, resolve the flake file relative to it218 absolute_flake_path = Path(work_dir) / flake_file if work_dir else Path(flake_file)219 220 flake_dir = absolute_flake_path.parent or Path()221 absolute_flake_dir = flake_dir.resolve()222 223 # Use a shallow URL because worktrees may not have the full history.224 # For subflakes, nix needs the URL to point to the git root225 # with a dir= parameter rather than the subdirectory directly.226 if work_dir:227 git_root = Path(work_dir).resolve()228 relative_dir = absolute_flake_dir.relative_to(git_root)229 flake_url = f"git+file://{git_root}?shallow=1"230 if str(relative_dir) != ".":231 flake_url += f"&dir={relative_dir}"232 else:233 flake_url = f"git+file://{absolute_flake_dir}?shallow=1"234 235 result = subprocess.run(236 [237 "nix",238 "flake",239 "update",240 "--flake",241 flake_url,242 input_name,243 ],244 cwd=str(flake_dir),245 capture_output=True,246 text=True,247 check=True,248 )249 250 # Check if there was a warning about non-existent input251 if result.stderr and "does not match any input" in result.stderr:252 logger.warning(253 "Failed to update input %s in %s: %s",254 input_name,255 flake_file,256 result.stderr.strip(),257 )258 259 logger.info(260 "Successfully updated flake input: %s in %s",261 input_name,262 flake_file,263 )264 except subprocess.CalledProcessError as e:265 stderr_output = e.stderr.strip() if e.stderr else "No stderr output"266 stdout_output = e.stdout.strip() if e.stdout else "No stdout output"267 logger.exception(268 "Failed to update flake input %s in %s. Exit code: %d\nStdout: %s\nStderr: %s",269 input_name,270 flake_file,271 e.returncode,272 stdout_output,273 stderr_output,274 )275 msg = (276 f"Failed to update flake input {input_name} in {flake_file}: {e}\n"277 f"Stderr: {stderr_output}"278 )279> raise FlakeServiceError(msg) from e280E update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse?shallow=1', 'flake-utils']' returned non-zero exit status 1.281E Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 346 ms (attempt 1/5)282E warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 576 ms (attempt 2/5)283E warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1213 ms (attempt 3/5)284E warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2435 ms (attempt 4/5)285E error:286E … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse?ref=refs/heads/master&rev=4eb2b1ff5c61e155b940fa95aeca9b596401fa64&shallow=1'287E 288E … while updating the flake input 'flake-utils'289E 290E … while fetching the input 'github:numtide/flake-utils'291E 292E error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com293294src/update_flake_inputs/flake_service.py:235: FlakeServiceError295----------------------------- Captured stdout call -----------------------------296Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse/.git/297[master (root-commit) 4eb2b1f] Initial commit298 2 files changed, 55 insertions(+)299 create mode 100644 flake.lock300 create mode 100644 flake.nix301----------------------------- Captured stderr call -----------------------------302hint: Using 'master' as the name for the initial branch. This default branch name303hint: will change to "main" in Git 3.0. To configure the initial branch name304hint: to use in all of your new repositories, which will suppress this warning,305hint: call:306hint:307hint: git config --global init.defaultBranch <name>308hint:309hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and310hint: 'development'. The just-created branch can be renamed via this command:311hint:312hint: git branch -m <name>313hint:314hint: Disable this message with "git config set advice.defaultBranchName false"315------------------------------ Captured log call -------------------------------316ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 1317Stdout: No stdout output318Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 346 ms (attempt 1/5)319warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 576 ms (attempt 2/5)320warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1213 ms (attempt 3/5)321warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2435 ms (attempt 4/5)322error:323 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse?ref=refs/heads/master&rev=4eb2b1ff5c61e155b940fa95aeca9b596401fa64&shallow=1'324325 … while updating the flake input 'flake-utils'326327 … while fetching the input 'github:numtide/flake-utils'328329 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com330Traceback (most recent call last):331 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input332 result = subprocess.run(333 [334 ...<10 lines>...335 check=True,336 )337 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run338 raise CalledProcessError(retcode, process.args,339 output=stdout, stderr=stderr)340subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmpw34vbfse?shallow=1', 'flake-utils']' returned non-zero exit status 1.341_________________ TestFlakeService.test_update_subflake_input __________________342343self = <update_flake_inputs.flake_service.FlakeService object at 0x10a4c2b10>344input_name = 'flake-utils', flake_file = 'flake.nix'345work_dir = '/private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li'346347 def update_flake_input(348 self,349 input_name: str,350 flake_file: str,351 work_dir: str | None = None,352 ) -> None:353 """Update a specific flake input.354 355 Args:356 input_name: Name of the input to update357 flake_file: Path to the flake file358 work_dir: Optional working directory to resolve flake file path from359 360 """361 try:362 logger.info("Updating flake input: %s in %s", input_name, flake_file)363 364 # If work_dir is provided, resolve the flake file relative to it365 absolute_flake_path = Path(work_dir) / flake_file if work_dir else Path(flake_file)366 367 flake_dir = absolute_flake_path.parent or Path()368 absolute_flake_dir = flake_dir.resolve()369 370 # Use a shallow URL because worktrees may not have the full history.371 # For subflakes, nix needs the URL to point to the git root372 # with a dir= parameter rather than the subdirectory directly.373 if work_dir:374 git_root = Path(work_dir).resolve()375 relative_dir = absolute_flake_dir.relative_to(git_root)376 flake_url = f"git+file://{git_root}?shallow=1"377 if str(relative_dir) != ".":378 flake_url += f"&dir={relative_dir}"379 else:380 flake_url = f"git+file://{absolute_flake_dir}?shallow=1"381 382> result = subprocess.run(383 [384 "nix",385 "flake",386 "update",387 "--flake",388 flake_url,389 input_name,390 ],391 cwd=str(flake_dir),392 capture_output=True,393 text=True,394 check=True,395 )396397src/update_flake_inputs/flake_service.py:191: 398_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 399400input = None, capture_output = True, timeout = None, check = True401popenargs = (['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li?shallow=1', 'flake-utils'],)402kwargs = {'cwd': '/private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li', 'stderr': -1, 'stdout': -1, 'text': True}403process = <Popen: returncode: 1 args: ['nix', 'flake', 'update', '--flake', 'git+file:...>404stdout = ''405stderr = "warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostna...b.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com\n"406retcode = 1407408 def run(*popenargs,409 input=None, capture_output=False, timeout=None, check=False, **kwargs):410 """Run command with arguments and return a CompletedProcess instance.411 412 The returned instance will have attributes args, returncode, stdout and413 stderr. By default, stdout and stderr are not captured, and those attributes414 will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,415 or pass capture_output=True to capture both.416 417 If check is True and the exit code was non-zero, it raises a418 CalledProcessError. The CalledProcessError object will have the return code419 in the returncode attribute, and output & stderr attributes if those streams420 were captured.421 422 If timeout (seconds) is given and the process takes too long,423 a TimeoutExpired exception will be raised.424 425 There is an optional argument "input", allowing you to426 pass bytes or a string to the subprocess's stdin. If you use this argument427 you may not also use the Popen constructor's "stdin" argument, as428 it will be used internally.429 430 By default, all communication is in bytes, and therefore any "input" should431 be bytes, and the stdout and stderr will be bytes. If in text mode, any432 "input" should be a string, and stdout and stderr will be strings decoded433 according to locale encoding, or by "encoding" if set. Text mode is434 triggered by setting any of text, encoding, errors or universal_newlines.435 436 The other arguments are the same as for the Popen constructor.437 """438 if input is not None:439 if kwargs.get('stdin') is not None:440 raise ValueError('stdin and input arguments may not both be used.')441 kwargs['stdin'] = PIPE442 443 if capture_output:444 if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:445 raise ValueError('stdout and stderr arguments may not be used '446 'with capture_output.')447 kwargs['stdout'] = PIPE448 kwargs['stderr'] = PIPE449 450 with Popen(*popenargs, **kwargs) as process:451 try:452 stdout, stderr = process.communicate(input, timeout=timeout)453 except TimeoutExpired as exc:454 process.kill()455 if _mswindows:456 # Windows accumulates the output in a single blocking457 # read() call run on child threads, with the timeout458 # being done in a join() on those threads. communicate()459 # _after_ kill() is required to collect that and add it460 # to the exception.461 exc.stdout, exc.stderr = process.communicate()462 else:463 # POSIX _communicate already populated the output so464 # far into the TimeoutExpired exception.465 process.wait()466 raise467 except: # Including KeyboardInterrupt, communicate handled that.468 process.kill()469 # We don't call process.wait() as .__exit__ does that for us.470 raise471 retcode = process.poll()472 if check and retcode:473> raise CalledProcessError(retcode, process.args,474 output=stdout, stderr=stderr)475E subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li?shallow=1', 'flake-utils']' returned non-zero exit status 1.476477/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py:577: CalledProcessError478479The above exception was the direct cause of the following exception:480481self = <tests.test_flake_service.TestFlakeService object at 0x10a172140>482flake_service = <update_flake_inputs.flake_service.FlakeService object at 0x10a4c2b10>483fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')484485 @pytest.mark.impure486 def test_update_subflake_input(487 self,488 flake_service: FlakeService,489 fixtures_path: Path,490 ) -> None:491 """Test updating a flake input in a subdirectory (subflake)."""492 with tempfile.TemporaryDirectory() as temp_dir:493 temp_path = Path(temp_dir)494 495 # Copy minimal flake to a subdirectory496 sub_dir = temp_path / "sub"497 sub_dir.mkdir()498 shutil.copy(499 fixtures_path / "minimal" / "flake.nix",500 sub_dir / "flake.nix",501 )502 shutil.copy(503 fixtures_path / "minimal" / "flake.lock",504 sub_dir / "flake.lock",505 )506 507 # Copy minimal flake to root508 shutil.copy(509 fixtures_path / "minimal" / "flake.nix",510 temp_path / "flake.nix",511 )512 shutil.copy(513 fixtures_path / "minimal" / "flake.lock",514 temp_path / "flake.lock",515 )516 517 # Initialize git repo in temp directory518 subprocess.run(["git", "init"], cwd=temp_path, check=True)519 subprocess.run(["git", "add", "."], cwd=temp_path, check=True)520 subprocess.run(521 ["git", "commit", "-m", "Initial commit"],522 cwd=temp_path,523 check=True,524 env={525 **os.environ,526 "GIT_AUTHOR_NAME": "Test User",527 "GIT_AUTHOR_EMAIL": "test@example.com",528 "GIT_COMMITTER_NAME": "Test User",529 "GIT_COMMITTER_EMAIL": "test@example.com",530 },531 )532 533 original_root_lock = json.loads((temp_path / "flake.lock").read_text())534 original_root_rev = original_root_lock["nodes"]["flake-utils"]["locked"]["rev"]535 536 original_sub_lock = json.loads((sub_dir / "flake.lock").read_text())537 original_sub_rev = original_sub_lock["nodes"]["flake-utils"]["locked"]["rev"]538 539 # Update flake-utils in the root flake540> flake_service.update_flake_input("flake-utils", "flake.nix", str(temp_path))541542tests/test_flake_service.py:272: 543_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 544545self = <update_flake_inputs.flake_service.FlakeService object at 0x10a4c2b10>546input_name = 'flake-utils', flake_file = 'flake.nix'547work_dir = '/private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li'548549 def update_flake_input(550 self,551 input_name: str,552 flake_file: str,553 work_dir: str | None = None,554 ) -> None:555 """Update a specific flake input.556 557 Args:558 input_name: Name of the input to update559 flake_file: Path to the flake file560 work_dir: Optional working directory to resolve flake file path from561 562 """563 try:564 logger.info("Updating flake input: %s in %s", input_name, flake_file)565 566 # If work_dir is provided, resolve the flake file relative to it567 absolute_flake_path = Path(work_dir) / flake_file if work_dir else Path(flake_file)568 569 flake_dir = absolute_flake_path.parent or Path()570 absolute_flake_dir = flake_dir.resolve()571 572 # Use a shallow URL because worktrees may not have the full history.573 # For subflakes, nix needs the URL to point to the git root574 # with a dir= parameter rather than the subdirectory directly.575 if work_dir:576 git_root = Path(work_dir).resolve()577 relative_dir = absolute_flake_dir.relative_to(git_root)578 flake_url = f"git+file://{git_root}?shallow=1"579 if str(relative_dir) != ".":580 flake_url += f"&dir={relative_dir}"581 else:582 flake_url = f"git+file://{absolute_flake_dir}?shallow=1"583 584 result = subprocess.run(585 [586 "nix",587 "flake",588 "update",589 "--flake",590 flake_url,591 input_name,592 ],593 cwd=str(flake_dir),594 capture_output=True,595 text=True,596 check=True,597 )598 599 # Check if there was a warning about non-existent input600 if result.stderr and "does not match any input" in result.stderr:601 logger.warning(602 "Failed to update input %s in %s: %s",603 input_name,604 flake_file,605 result.stderr.strip(),606 )607 608 logger.info(609 "Successfully updated flake input: %s in %s",610 input_name,611 flake_file,612 )613 except subprocess.CalledProcessError as e:614 stderr_output = e.stderr.strip() if e.stderr else "No stderr output"615 stdout_output = e.stdout.strip() if e.stdout else "No stdout output"616 logger.exception(617 "Failed to update flake input %s in %s. Exit code: %d\nStdout: %s\nStderr: %s",618 input_name,619 flake_file,620 e.returncode,621 stdout_output,622 stderr_output,623 )624 msg = (625 f"Failed to update flake input {input_name} in {flake_file}: {e}\n"626 f"Stderr: {stderr_output}"627 )628> raise FlakeServiceError(msg) from e629E update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li?shallow=1', 'flake-utils']' returned non-zero exit status 1.630E Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 342 ms (attempt 1/5)631E warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 653 ms (attempt 2/5)632E warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1400 ms (attempt 3/5)633E warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2072 ms (attempt 4/5)634E error:635E … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li?ref=refs/heads/master&rev=c469561c6ba84dc4687ffb187e455b336be09299&shallow=1'636E 637E … while updating the flake input 'flake-utils'638E 639E … while fetching the input 'github:numtide/flake-utils'640E 641E error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com642643src/update_flake_inputs/flake_service.py:235: FlakeServiceError644----------------------------- Captured stdout call -----------------------------645Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li/.git/646[master (root-commit) c469561] Initial commit647 4 files changed, 110 insertions(+)648 create mode 100644 flake.lock649 create mode 100644 flake.nix650 create mode 100644 sub/flake.lock651 create mode 100644 sub/flake.nix652----------------------------- Captured stderr call -----------------------------653hint: Using 'master' as the name for the initial branch. This default branch name654hint: will change to "main" in Git 3.0. To configure the initial branch name655hint: to use in all of your new repositories, which will suppress this warning,656hint: call:657hint:658hint: git config --global init.defaultBranch <name>659hint:660hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and661hint: 'development'. The just-created branch can be renamed via this command:662hint:663hint: git branch -m <name>664hint:665hint: Disable this message with "git config set advice.defaultBranchName false"666------------------------------ Captured log call -------------------------------667ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 1668Stdout: No stdout output669Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 342 ms (attempt 1/5)670warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 653 ms (attempt 2/5)671warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1400 ms (attempt 3/5)672warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2072 ms (attempt 4/5)673error:674 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li?ref=refs/heads/master&rev=c469561c6ba84dc4687ffb187e455b336be09299&shallow=1'675676 … while updating the flake input 'flake-utils'677678 … while fetching the input 'github:numtide/flake-utils'679680 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com681Traceback (most recent call last):682 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input683 result = subprocess.run(684 [685 ...<10 lines>...686 check=True,687 )688 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run689 raise CalledProcessError(retcode, process.args,690 output=stdout, stderr=stderr)691subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/tmptt1gx6li?shallow=1', 'flake-utils']' returned non-zero exit status 1.692___________ TestProcessFlakeUpdates.test_with_updatable_flake_input ____________693694self = <tests.test_process_flake_updates.TestProcessFlakeUpdates object at 0x10a55cb90>695tmp_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_with_updatable_flake_inpu0')696fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')697698 @pytest.mark.impure699 def test_with_updatable_flake_input(700 self,701 tmp_path: Path,702 fixtures_path: Path,703 ) -> None:704 """Test PR creation when flake input has available updates."""705 # Create a flake with flake-utils that can be updated706 flake_content = """{707 inputs = {708 flake-utils.url = "github:numtide/flake-utils";709 };710 711 outputs = { self, flake-utils }: {712 # Test flake with updatable input713 };714 }"""715 716 (tmp_path / "flake.nix").write_text(flake_content)717 718 # Copy old lock file from minimal fixture719 shutil.copy(720 fixtures_path / "minimal" / "flake.lock",721 tmp_path / "flake.lock",722 )723 724 _setup_git_repo(tmp_path)725 726 # Change to test directory727 original_cwd = Path.cwd()728 os.chdir(tmp_path)729 730 try:731 # Create test services732 flake_service = FlakeService()733 test_gitea_service = MockGiteaService()734 735 # Process updates736> process_flake_updates(737 flake_service,738 test_gitea_service,739 "",740 "main",741 "",742 auto_merge=False,743 )744745tests/test_process_flake_updates.py:222: 746_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 747748flake_service = <update_flake_inputs.flake_service.FlakeService object at 0x10a555650>749gitea_service = MockGiteaService(api_url='https://gitea.example.com', token='test-token', owner='test-owner', repo='test-repo', git_au...tions[bot]', git_committer_email='gitea-actions[bot]@noreply.gitea.io', merge_style='default', pr_creation_attempts=[])750exclude_patterns = '', base_branch = 'main', branch_suffix = ''751752 def process_flake_updates( # noqa: PLR0913753 flake_service: FlakeService,754 gitea_service: GiteaService,755 exclude_patterns: str,756 base_branch: str,757 branch_suffix: str,758 *,759 auto_merge: bool,760 ) -> None:761 """Process all flake updates.762 763 Args:764 flake_service: Flake service instance765 gitea_service: Gitea service instance766 exclude_patterns: Patterns to exclude767 base_branch: Base branch for PRs768 branch_suffix: Optional suffix to append to branch names769 auto_merge: Whether to automatically merge PRs770 771 """772 # Discover flake files773 flakes = flake_service.discover_flake_files(exclude_patterns)774 if not flakes:775 logger.info("No flake files found")776 return777 778 logger.info("Found %d flake files to process", len(flakes))779 780 failed_inputs: list[str] = []781 782 # Process each flake783 for flake in flakes:784 logger.info("Processing flake: %s", flake.file_path)785 logger.info("Inputs to update: %s", ", ".join(flake.inputs))786 787 # Don't include '.' for root directory788 parent_path = Path(flake.file_path).parent789 parent_suffix = "" if parent_path == Path() else f" in {parent_path}"790 parent_branch = "" if parent_path == Path() else f"-{parent_path}"791 suffix = branch_suffix.strip().replace("/", "-").strip("-")792 793 # Update each input794 for input_name in flake.inputs:795 try:796 branch_name = f"update{parent_branch}-{input_name}"797 branch_name = branch_name.replace("/", "-").strip("-")798 if suffix:799 branch_name = f"{branch_name}-{suffix}"800 801 logger.info(802 "Updating input %s in %s (branch: %s)",803 input_name,804 flake.file_path,805 branch_name,806 )807 808 # Create worktree and update input809 with gitea_service.worktree(branch_name, base_branch) as worktree_path:810 # Update the input811 flake_service.update_flake_input(812 input_name,813 flake.file_path,814 str(worktree_path),815 )816 817 # Commit changes818 commit_message = f"Update {input_name}{parent_suffix}"819 if gitea_service.commit_changes(820 branch_name,821 commit_message,822 worktree_path,823 ):824 # Create pull request825 pr_title = commit_message826 pr_body = (827 f"This PR updates the `{input_name}` input "828 f"in `{flake.file_path}`.\n\n"829 "Generated by update-flake-inputs action."830 )831 gitea_service.create_pull_request(832 branch_name,833 base_branch,834 pr_title,835 pr_body,836 auto_merge=auto_merge,837 )838 else:839 logger.info(840 "No changes for input %s in %s",841 input_name,842 flake.file_path,843 )844 gitea_service.delete_branch(branch_name)845 846 except Exception:847 logger.exception(848 "Failed to update input %s in %s",849 input_name,850 flake.file_path,851 )852 failed_inputs.append(f"{input_name} in {flake.file_path}")853 854 if failed_inputs:855 msg = f"Failed to process {len(failed_inputs)} input(s): {', '.join(failed_inputs)}"856> raise UpdateFlakeInputsError(msg)857E update_flake_inputs.exceptions.UpdateFlakeInputsError: Failed to process 1 input(s): flake-utils in flake.nix858859src/update_flake_inputs/cli.py:268: UpdateFlakeInputsError860----------------------------- Captured stdout call -----------------------------861Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_with_updatable_flake_inpu0/.git/862[main (root-commit) 4c508dc] Initial commit863 2 files changed, 53 insertions(+)864 create mode 100644 flake.lock865 create mode 100644 flake.nix866Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_with_updatable_flake_inpu0.git/867branch 'main' set up to track 'origin/main'.868branch 'update-flake-utils' set up to track 'origin/main'.869HEAD is now at 4c508dc Initial commit870----------------------------- Captured stderr call -----------------------------871hint: Using 'master' as the name for the initial branch. This default branch name872hint: will change to "main" in Git 3.0. To configure the initial branch name873hint: to use in all of your new repositories, which will suppress this warning,874hint: call:875hint:876hint: git config --global init.defaultBranch <name>877hint:878hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and879hint: 'development'. The just-created branch can be renamed via this command:880hint:881hint: git branch -m <name>882hint:883hint: Disable this message with "git config set advice.defaultBranchName false"884To /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_with_updatable_flake_inpu0.git885 * [new branch] main -> main886From /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_with_updatable_flake_inpu0887 * branch main -> FETCH_HEAD888Preparing worktree (new branch 'update-flake-utils')889------------------------------ Captured log call -------------------------------890ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 1891Stdout: No stdout output892Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 292 ms (attempt 1/5)893warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 531 ms (attempt 2/5)894warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1071 ms (attempt 3/5)895warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2260 ms (attempt 4/5)896error:897 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-gtjudgy5/update-flake-utils?ref=refs/heads/update-flake-utils&rev=4c508dc44a18c905a78ee50fded8853bb57fd725&shallow=1'898899 … while updating the flake input 'flake-utils'900901 … while fetching the input 'github:numtide/flake-utils'902903 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com904Traceback (most recent call last):905 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input906 result = subprocess.run(907 [908 ...<10 lines>...909 check=True,910 )911 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run912 raise CalledProcessError(retcode, process.args,913 output=stdout, stderr=stderr)914subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-gtjudgy5/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.915ERROR update_flake_inputs.cli:cli.py:259 Failed to update input flake-utils in flake.nix916Traceback (most recent call last):917 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input918 result = subprocess.run(919 [920 ...<10 lines>...921 check=True,922 )923 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run924 raise CalledProcessError(retcode, process.args,925 output=stdout, stderr=stderr)926subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-gtjudgy5/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.927928The above exception was the direct cause of the following exception:929930Traceback (most recent call last):931 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/cli.py", line 223, in process_flake_updates932 flake_service.update_flake_input(933 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^934 input_name,935 ^^^^^^^^^^^936 flake.file_path,937 ^^^^^^^^^^^^^^^^938 str(worktree_path),939 ^^^^^^^^^^^^^^^^^^^940 )941 ^942 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 235, in update_flake_input943 raise FlakeServiceError(msg) from e944update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-gtjudgy5/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.945Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 292 ms (attempt 1/5)946warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 531 ms (attempt 2/5)947warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1071 ms (attempt 3/5)948warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2260 ms (attempt 4/5)949error:950 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-gtjudgy5/update-flake-utils?ref=refs/heads/update-flake-utils&rev=4c508dc44a18c905a78ee50fded8853bb57fd725&shallow=1'951952 … while updating the flake input 'flake-utils'953954 … while fetching the input 'github:numtide/flake-utils'955956 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com957_____ TestProcessFlakeUpdates.test_worktree_based_on_base_branch_not_head ______958959self = <tests.test_process_flake_updates.TestProcessFlakeUpdates object at 0x10a4d5e00>960tmp_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_worktree_based_on_base_br0')961fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')962963 @pytest.mark.impure964 def test_worktree_based_on_base_branch_not_head(965 self,966 tmp_path: Path,967 fixtures_path: Path,968 ) -> None:969 """Test that update branches are based on base_branch, not current HEAD.970 971 When the action is triggered from a non-main branch, the worktree972 should still be based on origin/<base_branch> so that commits from973 the triggering branch don't leak into the update branch.974 """975 flake_content = """{976 inputs = {977 flake-utils.url = "github:numtide/flake-utils";978 };979 980 outputs = { self, flake-utils }: {981 # Test flake with updatable input982 };983 }"""984 985 (tmp_path / "flake.nix").write_text(flake_content)986 987 shutil.copy(988 fixtures_path / "minimal" / "flake.lock",989 tmp_path / "flake.lock",990 )991 992 _setup_git_repo(tmp_path)993 994 # Create a feature branch with an extra commit995 git_env = {996 **os.environ,997 "GIT_AUTHOR_NAME": "Test User",998 "GIT_AUTHOR_EMAIL": "test@example.com",999 "GIT_COMMITTER_NAME": "Test User",1000 "GIT_COMMITTER_EMAIL": "test@example.com",1001 }1002 subprocess.run(1003 ["git", "checkout", "-b", "feature-branch"],1004 cwd=tmp_path,1005 check=True,1006 )1007 (tmp_path / "extra-file.txt").write_text("feature branch content")1008 subprocess.run(["git", "add", "."], cwd=tmp_path, check=True)1009 subprocess.run(1010 ["git", "commit", "-m", "Feature branch commit"],1011 cwd=tmp_path,1012 check=True,1013 env=git_env,1014 )1015 1016 # Stay on feature-branch (simulating action triggered from non-main branch)1017 original_cwd = Path.cwd()1018 os.chdir(tmp_path)1019 1020 try:1021 flake_service = FlakeService()1022 test_gitea_service = MockGiteaService()1023 1024> process_flake_updates(1025 flake_service,1026 test_gitea_service,1027 "",1028 "main",1029 "",1030 auto_merge=False,1031 )10321033tests/test_process_flake_updates.py:328: 1034_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10351036flake_service = <update_flake_inputs.flake_service.FlakeService object at 0x10a555850>1037gitea_service = MockGiteaService(api_url='https://gitea.example.com', token='test-token', owner='test-owner', repo='test-repo', git_au...tions[bot]', git_committer_email='gitea-actions[bot]@noreply.gitea.io', merge_style='default', pr_creation_attempts=[])1038exclude_patterns = '', base_branch = 'main', branch_suffix = ''10391040 def process_flake_updates( # noqa: PLR09131041 flake_service: FlakeService,1042 gitea_service: GiteaService,1043 exclude_patterns: str,1044 base_branch: str,1045 branch_suffix: str,1046 *,1047 auto_merge: bool,1048 ) -> None:1049 """Process all flake updates.1050 1051 Args:1052 flake_service: Flake service instance1053 gitea_service: Gitea service instance1054 exclude_patterns: Patterns to exclude1055 base_branch: Base branch for PRs1056 branch_suffix: Optional suffix to append to branch names1057 auto_merge: Whether to automatically merge PRs1058 1059 """1060 # Discover flake files1061 flakes = flake_service.discover_flake_files(exclude_patterns)1062 if not flakes:1063 logger.info("No flake files found")1064 return1065 1066 logger.info("Found %d flake files to process", len(flakes))1067 1068 failed_inputs: list[str] = []1069 1070 # Process each flake1071 for flake in flakes:1072 logger.info("Processing flake: %s", flake.file_path)1073 logger.info("Inputs to update: %s", ", ".join(flake.inputs))1074 1075 # Don't include '.' for root directory1076 parent_path = Path(flake.file_path).parent1077 parent_suffix = "" if parent_path == Path() else f" in {parent_path}"1078 parent_branch = "" if parent_path == Path() else f"-{parent_path}"1079 suffix = branch_suffix.strip().replace("/", "-").strip("-")1080 1081 # Update each input1082 for input_name in flake.inputs:1083 try:1084 branch_name = f"update{parent_branch}-{input_name}"1085 branch_name = branch_name.replace("/", "-").strip("-")1086 if suffix:1087 branch_name = f"{branch_name}-{suffix}"1088 1089 logger.info(1090 "Updating input %s in %s (branch: %s)",1091 input_name,1092 flake.file_path,1093 branch_name,1094 )1095 1096 # Create worktree and update input1097 with gitea_service.worktree(branch_name, base_branch) as worktree_path:1098 # Update the input1099 flake_service.update_flake_input(1100 input_name,1101 flake.file_path,1102 str(worktree_path),1103 )1104 1105 # Commit changes1106 commit_message = f"Update {input_name}{parent_suffix}"1107 if gitea_service.commit_changes(1108 branch_name,1109 commit_message,1110 worktree_path,1111 ):1112 # Create pull request1113 pr_title = commit_message1114 pr_body = (1115 f"This PR updates the `{input_name}` input "1116 f"in `{flake.file_path}`.\n\n"1117 "Generated by update-flake-inputs action."1118 )1119 gitea_service.create_pull_request(1120 branch_name,1121 base_branch,1122 pr_title,1123 pr_body,1124 auto_merge=auto_merge,1125 )1126 else:1127 logger.info(1128 "No changes for input %s in %s",1129 input_name,1130 flake.file_path,1131 )1132 gitea_service.delete_branch(branch_name)1133 1134 except Exception:1135 logger.exception(1136 "Failed to update input %s in %s",1137 input_name,1138 flake.file_path,1139 )1140 failed_inputs.append(f"{input_name} in {flake.file_path}")1141 1142 if failed_inputs:1143 msg = f"Failed to process {len(failed_inputs)} input(s): {', '.join(failed_inputs)}"1144> raise UpdateFlakeInputsError(msg)1145E update_flake_inputs.exceptions.UpdateFlakeInputsError: Failed to process 1 input(s): flake-utils in flake.nix11461147src/update_flake_inputs/cli.py:268: UpdateFlakeInputsError1148----------------------------- Captured stdout call -----------------------------1149Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_worktree_based_on_base_br0/.git/1150[main (root-commit) 8fa61a5] Initial commit1151 2 files changed, 53 insertions(+)1152 create mode 100644 flake.lock1153 create mode 100644 flake.nix1154Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_worktree_based_on_base_br0.git/1155branch 'main' set up to track 'origin/main'.1156[feature-branch 6b09dec] Feature branch commit1157 1 file changed, 1 insertion(+)1158 create mode 100644 extra-file.txt1159branch 'update-flake-utils' set up to track 'origin/main'.1160HEAD is now at 8fa61a5 Initial commit1161----------------------------- Captured stderr call -----------------------------1162hint: Using 'master' as the name for the initial branch. This default branch name1163hint: will change to "main" in Git 3.0. To configure the initial branch name1164hint: to use in all of your new repositories, which will suppress this warning,1165hint: call:1166hint:1167hint: git config --global init.defaultBranch <name>1168hint:1169hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and1170hint: 'development'. The just-created branch can be renamed via this command:1171hint:1172hint: git branch -m <name>1173hint:1174hint: Disable this message with "git config set advice.defaultBranchName false"1175To /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_worktree_based_on_base_br0.git1176 * [new branch] main -> main1177Switched to a new branch 'feature-branch'1178From /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_worktree_based_on_base_br01179 * branch main -> FETCH_HEAD1180Preparing worktree (new branch 'update-flake-utils')1181------------------------------ Captured log call -------------------------------1182ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 11183Stdout: No stdout output1184Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 266 ms (attempt 1/5)1185warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 554 ms (attempt 2/5)1186warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1075 ms (attempt 3/5)1187warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2392 ms (attempt 4/5)1188error:1189 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-nr8rb83p/update-flake-utils?ref=refs/heads/update-flake-utils&rev=8fa61a5b3449d034e1ab75752e491527a0b54a82&shallow=1'11901191 … while updating the flake input 'flake-utils'11921193 … while fetching the input 'github:numtide/flake-utils'11941195 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com1196Traceback (most recent call last):1197 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input1198 result = subprocess.run(1199 [1200 ...<10 lines>...1201 check=True,1202 )1203 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run1204 raise CalledProcessError(retcode, process.args,1205 output=stdout, stderr=stderr)1206subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-nr8rb83p/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.1207ERROR update_flake_inputs.cli:cli.py:259 Failed to update input flake-utils in flake.nix1208Traceback (most recent call last):1209 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input1210 result = subprocess.run(1211 [1212 ...<10 lines>...1213 check=True,1214 )1215 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run1216 raise CalledProcessError(retcode, process.args,1217 output=stdout, stderr=stderr)1218subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-nr8rb83p/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.12191220The above exception was the direct cause of the following exception:12211222Traceback (most recent call last):1223 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/cli.py", line 223, in process_flake_updates1224 flake_service.update_flake_input(1225 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^1226 input_name,1227 ^^^^^^^^^^^1228 flake.file_path,1229 ^^^^^^^^^^^^^^^^1230 str(worktree_path),1231 ^^^^^^^^^^^^^^^^^^^1232 )1233 ^1234 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 235, in update_flake_input1235 raise FlakeServiceError(msg) from e1236update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-nr8rb83p/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.1237Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 266 ms (attempt 1/5)1238warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 554 ms (attempt 2/5)1239warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1075 ms (attempt 3/5)1240warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2392 ms (attempt 4/5)1241error:1242 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-nr8rb83p/update-flake-utils?ref=refs/heads/update-flake-utils&rev=8fa61a5b3449d034e1ab75752e491527a0b54a82&shallow=1'12431244 … while updating the flake input 'flake-utils'12451246 … while fetching the input 'github:numtide/flake-utils'12471248 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com1249___________ TestProcessFlakeUpdates.test_custom_git_author_committer ___________12501251self = <tests.test_process_flake_updates.TestProcessFlakeUpdates object at 0x10a4d6190>1252tmp_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_custom_git_author_committ0')1253fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')12541255 @pytest.mark.impure1256 def test_custom_git_author_committer(1257 self,1258 tmp_path: Path,1259 fixtures_path: Path,1260 ) -> None:1261 """Test that custom git author/committer configuration is used."""1262 # Create a flake with flake-utils1263 flake_content = """{1264 inputs = {1265 flake-utils.url = "github:numtide/flake-utils";1266 };1267 1268 outputs = { self, flake-utils }: {1269 # Test flake1270 };1271 }"""1272 1273 (tmp_path / "flake.nix").write_text(flake_content)1274 1275 # Copy old lock file from minimal fixture1276 shutil.copy(1277 fixtures_path / "minimal" / "flake.lock",1278 tmp_path / "flake.lock",1279 )1280 1281 _setup_git_repo(tmp_path)1282 1283 # Change to test directory1284 original_cwd = Path.cwd()1285 os.chdir(tmp_path)1286 1287 try:1288 # Create test services with custom git author/committer1289 flake_service = FlakeService()1290 test_gitea_service = MockGiteaService()1291 test_gitea_service.git_author_name = "Custom Bot"1292 test_gitea_service.git_author_email = "custom@bot.com"1293 test_gitea_service.git_committer_name = "Custom Committer"1294 test_gitea_service.git_committer_email = "committer@bot.com"1295 1296 # Process updates1297> process_flake_updates(1298 flake_service,1299 test_gitea_service,1300 "",1301 "main",1302 "",1303 auto_merge=False,1304 )13051306tests/test_process_flake_updates.py:398: 1307_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 13081309flake_service = <update_flake_inputs.flake_service.FlakeService object at 0x10a85d130>1310gitea_service = MockGiteaService(api_url='https://gitea.example.com', token='test-token', owner='test-owner', repo='test-repo', git_au...itter_name='Custom Committer', git_committer_email='committer@bot.com', merge_style='default', pr_creation_attempts=[])1311exclude_patterns = '', base_branch = 'main', branch_suffix = ''13121313 def process_flake_updates( # noqa: PLR09131314 flake_service: FlakeService,1315 gitea_service: GiteaService,1316 exclude_patterns: str,1317 base_branch: str,1318 branch_suffix: str,1319 *,1320 auto_merge: bool,1321 ) -> None:1322 """Process all flake updates.1323 1324 Args:1325 flake_service: Flake service instance1326 gitea_service: Gitea service instance1327 exclude_patterns: Patterns to exclude1328 base_branch: Base branch for PRs1329 branch_suffix: Optional suffix to append to branch names1330 auto_merge: Whether to automatically merge PRs1331 1332 """1333 # Discover flake files1334 flakes = flake_service.discover_flake_files(exclude_patterns)1335 if not flakes:1336 logger.info("No flake files found")1337 return1338 1339 logger.info("Found %d flake files to process", len(flakes))1340 1341 failed_inputs: list[str] = []1342 1343 # Process each flake1344 for flake in flakes:1345 logger.info("Processing flake: %s", flake.file_path)1346 logger.info("Inputs to update: %s", ", ".join(flake.inputs))1347 1348 # Don't include '.' for root directory1349 parent_path = Path(flake.file_path).parent1350 parent_suffix = "" if parent_path == Path() else f" in {parent_path}"1351 parent_branch = "" if parent_path == Path() else f"-{parent_path}"1352 suffix = branch_suffix.strip().replace("/", "-").strip("-")1353 1354 # Update each input1355 for input_name in flake.inputs:1356 try:1357 branch_name = f"update{parent_branch}-{input_name}"1358 branch_name = branch_name.replace("/", "-").strip("-")1359 if suffix:1360 branch_name = f"{branch_name}-{suffix}"1361 1362 logger.info(1363 "Updating input %s in %s (branch: %s)",1364 input_name,1365 flake.file_path,1366 branch_name,1367 )1368 1369 # Create worktree and update input1370 with gitea_service.worktree(branch_name, base_branch) as worktree_path:1371 # Update the input1372 flake_service.update_flake_input(1373 input_name,1374 flake.file_path,1375 str(worktree_path),1376 )1377 1378 # Commit changes1379 commit_message = f"Update {input_name}{parent_suffix}"1380 if gitea_service.commit_changes(1381 branch_name,1382 commit_message,1383 worktree_path,1384 ):1385 # Create pull request1386 pr_title = commit_message1387 pr_body = (1388 f"This PR updates the `{input_name}` input "1389 f"in `{flake.file_path}`.\n\n"1390 "Generated by update-flake-inputs action."1391 )1392 gitea_service.create_pull_request(1393 branch_name,1394 base_branch,1395 pr_title,1396 pr_body,1397 auto_merge=auto_merge,1398 )1399 else:1400 logger.info(1401 "No changes for input %s in %s",1402 input_name,1403 flake.file_path,1404 )1405 gitea_service.delete_branch(branch_name)1406 1407 except Exception:1408 logger.exception(1409 "Failed to update input %s in %s",1410 input_name,1411 flake.file_path,1412 )1413 failed_inputs.append(f"{input_name} in {flake.file_path}")1414 1415 if failed_inputs:1416 msg = f"Failed to process {len(failed_inputs)} input(s): {', '.join(failed_inputs)}"1417> raise UpdateFlakeInputsError(msg)1418E update_flake_inputs.exceptions.UpdateFlakeInputsError: Failed to process 1 input(s): flake-utils in flake.nix14191420src/update_flake_inputs/cli.py:268: UpdateFlakeInputsError1421----------------------------- Captured stdout call -----------------------------1422Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_custom_git_author_committ0/.git/1423[main (root-commit) 7827cc7] Initial commit1424 2 files changed, 53 insertions(+)1425 create mode 100644 flake.lock1426 create mode 100644 flake.nix1427Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_custom_git_author_committ0.git/1428branch 'main' set up to track 'origin/main'.1429branch 'update-flake-utils' set up to track 'origin/main'.1430HEAD is now at 7827cc7 Initial commit1431----------------------------- Captured stderr call -----------------------------1432hint: Using 'master' as the name for the initial branch. This default branch name1433hint: will change to "main" in Git 3.0. To configure the initial branch name1434hint: to use in all of your new repositories, which will suppress this warning,1435hint: call:1436hint:1437hint: git config --global init.defaultBranch <name>1438hint:1439hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and1440hint: 'development'. The just-created branch can be renamed via this command:1441hint:1442hint: git branch -m <name>1443hint:1444hint: Disable this message with "git config set advice.defaultBranchName false"1445To /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_custom_git_author_committ0.git1446 * [new branch] main -> main1447From /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_custom_git_author_committ01448 * branch main -> FETCH_HEAD1449Preparing worktree (new branch 'update-flake-utils')1450------------------------------ Captured log call -------------------------------1451ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 11452Stdout: No stdout output1453Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 295 ms (attempt 1/5)1454warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 657 ms (attempt 2/5)1455warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1296 ms (attempt 3/5)1456warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2286 ms (attempt 4/5)1457error:1458 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-i34zs223/update-flake-utils?ref=refs/heads/update-flake-utils&rev=7827cc78695eec2874a2b880b0a537fb167ab402&shallow=1'14591460 … while updating the flake input 'flake-utils'14611462 … while fetching the input 'github:numtide/flake-utils'14631464 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com1465Traceback (most recent call last):1466 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input1467 result = subprocess.run(1468 [1469 ...<10 lines>...1470 check=True,1471 )1472 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run1473 raise CalledProcessError(retcode, process.args,1474 output=stdout, stderr=stderr)1475subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-i34zs223/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.1476ERROR update_flake_inputs.cli:cli.py:259 Failed to update input flake-utils in flake.nix1477Traceback (most recent call last):1478 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input1479 result = subprocess.run(1480 [1481 ...<10 lines>...1482 check=True,1483 )1484 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run1485 raise CalledProcessError(retcode, process.args,1486 output=stdout, stderr=stderr)1487subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-i34zs223/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.14881489The above exception was the direct cause of the following exception:14901491Traceback (most recent call last):1492 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/cli.py", line 223, in process_flake_updates1493 flake_service.update_flake_input(1494 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^1495 input_name,1496 ^^^^^^^^^^^1497 flake.file_path,1498 ^^^^^^^^^^^^^^^^1499 str(worktree_path),1500 ^^^^^^^^^^^^^^^^^^^1501 )1502 ^1503 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 235, in update_flake_input1504 raise FlakeServiceError(msg) from e1505update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-i34zs223/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.1506Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 295 ms (attempt 1/5)1507warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 657 ms (attempt 2/5)1508warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1296 ms (attempt 3/5)1509warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2286 ms (attempt 4/5)1510error:1511 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-i34zs223/update-flake-utils?ref=refs/heads/update-flake-utils&rev=7827cc78695eec2874a2b880b0a537fb167ab402&shallow=1'15121513 … while updating the flake input 'flake-utils'15141515 … while fetching the input 'github:numtide/flake-utils'15161517 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com1518__________________ TestProcessFlakeUpdates.test_branch_suffix __________________15191520self = <tests.test_process_flake_updates.TestProcessFlakeUpdates object at 0x10a4c2450>1521tmp_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_branch_suffix0')1522fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')15231524 @pytest.mark.impure1525 def test_branch_suffix(1526 self,1527 tmp_path: Path,1528 fixtures_path: Path,1529 ) -> None:1530 """Test that branch suffix is properly appended to branch names."""1531 # Create a flake with flake-utils1532 flake_content = """{1533 inputs = {1534 flake-utils.url = "github:numtide/flake-utils";1535 };1536 1537 outputs = { self, flake-utils }: {1538 # Test flake1539 };1540 }"""1541 1542 (tmp_path / "flake.nix").write_text(flake_content)1543 1544 # Copy old lock file from minimal fixture1545 shutil.copy(1546 fixtures_path / "minimal" / "flake.lock",1547 tmp_path / "flake.lock",1548 )1549 1550 _setup_git_repo(tmp_path)1551 1552 # Change to test directory1553 original_cwd = Path.cwd()1554 os.chdir(tmp_path)1555 1556 try:1557 # Create test services1558 flake_service = FlakeService()1559 test_gitea_service = MockGiteaService()1560 1561 # Process updates with branch suffix1562> process_flake_updates(1563 flake_service,1564 test_gitea_service,1565 "",1566 "main",1567 "my-suffix",1568 auto_merge=False,1569 )15701571tests/test_process_flake_updates.py:465: 1572_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 15731574flake_service = <update_flake_inputs.flake_service.FlakeService object at 0x10a85e3f0>1575gitea_service = MockGiteaService(api_url='https://gitea.example.com', token='test-token', owner='test-owner', repo='test-repo', git_au...tions[bot]', git_committer_email='gitea-actions[bot]@noreply.gitea.io', merge_style='default', pr_creation_attempts=[])1576exclude_patterns = '', base_branch = 'main', branch_suffix = 'my-suffix'15771578 def process_flake_updates( # noqa: PLR09131579 flake_service: FlakeService,1580 gitea_service: GiteaService,1581 exclude_patterns: str,1582 base_branch: str,1583 branch_suffix: str,1584 *,1585 auto_merge: bool,1586 ) -> None:1587 """Process all flake updates.1588 1589 Args:1590 flake_service: Flake service instance1591 gitea_service: Gitea service instance1592 exclude_patterns: Patterns to exclude1593 base_branch: Base branch for PRs1594 branch_suffix: Optional suffix to append to branch names1595 auto_merge: Whether to automatically merge PRs1596 1597 """1598 # Discover flake files1599 flakes = flake_service.discover_flake_files(exclude_patterns)1600 if not flakes:1601 logger.info("No flake files found")1602 return1603 1604 logger.info("Found %d flake files to process", len(flakes))1605 1606 failed_inputs: list[str] = []1607 1608 # Process each flake1609 for flake in flakes:1610 logger.info("Processing flake: %s", flake.file_path)1611 logger.info("Inputs to update: %s", ", ".join(flake.inputs))1612 1613 # Don't include '.' for root directory1614 parent_path = Path(flake.file_path).parent1615 parent_suffix = "" if parent_path == Path() else f" in {parent_path}"1616 parent_branch = "" if parent_path == Path() else f"-{parent_path}"1617 suffix = branch_suffix.strip().replace("/", "-").strip("-")1618 1619 # Update each input1620 for input_name in flake.inputs:1621 try:1622 branch_name = f"update{parent_branch}-{input_name}"1623 branch_name = branch_name.replace("/", "-").strip("-")1624 if suffix:1625 branch_name = f"{branch_name}-{suffix}"1626 1627 logger.info(1628 "Updating input %s in %s (branch: %s)",1629 input_name,1630 flake.file_path,1631 branch_name,1632 )1633 1634 # Create worktree and update input1635 with gitea_service.worktree(branch_name, base_branch) as worktree_path:1636 # Update the input1637 flake_service.update_flake_input(1638 input_name,1639 flake.file_path,1640 str(worktree_path),1641 )1642 1643 # Commit changes1644 commit_message = f"Update {input_name}{parent_suffix}"1645 if gitea_service.commit_changes(1646 branch_name,1647 commit_message,1648 worktree_path,1649 ):1650 # Create pull request1651 pr_title = commit_message1652 pr_body = (1653 f"This PR updates the `{input_name}` input "1654 f"in `{flake.file_path}`.\n\n"1655 "Generated by update-flake-inputs action."1656 )1657 gitea_service.create_pull_request(1658 branch_name,1659 base_branch,1660 pr_title,1661 pr_body,1662 auto_merge=auto_merge,1663 )1664 else:1665 logger.info(1666 "No changes for input %s in %s",1667 input_name,1668 flake.file_path,1669 )1670 gitea_service.delete_branch(branch_name)1671 1672 except Exception:1673 logger.exception(1674 "Failed to update input %s in %s",1675 input_name,1676 flake.file_path,1677 )1678 failed_inputs.append(f"{input_name} in {flake.file_path}")1679 1680 if failed_inputs:1681 msg = f"Failed to process {len(failed_inputs)} input(s): {', '.join(failed_inputs)}"1682> raise UpdateFlakeInputsError(msg)1683E update_flake_inputs.exceptions.UpdateFlakeInputsError: Failed to process 1 input(s): flake-utils in flake.nix16841685src/update_flake_inputs/cli.py:268: UpdateFlakeInputsError1686----------------------------- Captured stdout call -----------------------------1687Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_branch_suffix0/.git/1688[main (root-commit) a49e813] Initial commit1689 2 files changed, 53 insertions(+)1690 create mode 100644 flake.lock1691 create mode 100644 flake.nix1692Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_branch_suffix0.git/1693branch 'main' set up to track 'origin/main'.1694branch 'update-flake-utils-my-suffix' set up to track 'origin/main'.1695HEAD is now at a49e813 Initial commit1696----------------------------- Captured stderr call -----------------------------1697hint: Using 'master' as the name for the initial branch. This default branch name1698hint: will change to "main" in Git 3.0. To configure the initial branch name1699hint: to use in all of your new repositories, which will suppress this warning,1700hint: call:1701hint:1702hint: git config --global init.defaultBranch <name>1703hint:1704hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and1705hint: 'development'. The just-created branch can be renamed via this command:1706hint:1707hint: git branch -m <name>1708hint:1709hint: Disable this message with "git config set advice.defaultBranchName false"1710To /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_branch_suffix0.git1711 * [new branch] main -> main1712From /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_branch_suffix01713 * branch main -> FETCH_HEAD1714Preparing worktree (new branch 'update-flake-utils-my-suffix')1715------------------------------ Captured log call -------------------------------1716ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 11717Stdout: No stdout output1718Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 257 ms (attempt 1/5)1719warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 533 ms (attempt 2/5)1720warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1216 ms (attempt 3/5)1721warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2131 ms (attempt 4/5)1722error:1723 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-h25ppesd/update-flake-utils-my-suffix?ref=refs/heads/update-flake-utils-my-suffix&rev=a49e81378a8f966e753372d6d5e9ce074161b2e3&shallow=1'17241725 … while updating the flake input 'flake-utils'17261727 … while fetching the input 'github:numtide/flake-utils'17281729 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com1730Traceback (most recent call last):1731 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input1732 result = subprocess.run(1733 [1734 ...<10 lines>...1735 check=True,1736 )1737 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run1738 raise CalledProcessError(retcode, process.args,1739 output=stdout, stderr=stderr)1740subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-h25ppesd/update-flake-utils-my-suffix?shallow=1', 'flake-utils']' returned non-zero exit status 1.1741ERROR update_flake_inputs.cli:cli.py:259 Failed to update input flake-utils in flake.nix1742Traceback (most recent call last):1743 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input1744 result = subprocess.run(1745 [1746 ...<10 lines>...1747 check=True,1748 )1749 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run1750 raise CalledProcessError(retcode, process.args,1751 output=stdout, stderr=stderr)1752subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-h25ppesd/update-flake-utils-my-suffix?shallow=1', 'flake-utils']' returned non-zero exit status 1.17531754The above exception was the direct cause of the following exception:17551756Traceback (most recent call last):1757 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/cli.py", line 223, in process_flake_updates1758 flake_service.update_flake_input(1759 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^1760 input_name,1761 ^^^^^^^^^^^1762 flake.file_path,1763 ^^^^^^^^^^^^^^^^1764 str(worktree_path),1765 ^^^^^^^^^^^^^^^^^^^1766 )1767 ^1768 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 235, in update_flake_input1769 raise FlakeServiceError(msg) from e1770update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-h25ppesd/update-flake-utils-my-suffix?shallow=1', 'flake-utils']' returned non-zero exit status 1.1771Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 257 ms (attempt 1/5)1772warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 533 ms (attempt 2/5)1773warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1216 ms (attempt 3/5)1774warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2131 ms (attempt 4/5)1775error:1776 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-h25ppesd/update-flake-utils-my-suffix?ref=refs/heads/update-flake-utils-my-suffix&rev=a49e81378a8f966e753372d6d5e9ce074161b2e3&shallow=1'17771778 … while updating the flake input 'flake-utils'17791780 … while fetching the input 'github:numtide/flake-utils'17811782 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com1783____ TestProcessFlakeUpdates.test_fails_at_end_when_individual_input_fails _____17841785self = <tests.test_process_flake_updates.TestProcessFlakeUpdates object at 0x10a5068b0>1786tmp_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_fails_at_end_when_individ0')1787fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')17881789 @pytest.mark.impure1790 def test_fails_at_end_when_individual_input_fails(1791 self,1792 tmp_path: Path,1793 fixtures_path: Path,1794 ) -> None:1795 """Test that the action continues updating other inputs but fails at the end."""1796 flake_content = """{1797 inputs = {1798 flake-utils.url = "github:numtide/flake-utils";1799 };1800 1801 outputs = { self, flake-utils }: {1802 # Test flake with updatable input1803 };1804 }"""1805 1806 (tmp_path / "flake.nix").write_text(flake_content)1807 1808 shutil.copy(1809 fixtures_path / "minimal" / "flake.lock",1810 tmp_path / "flake.lock",1811 )1812 1813 _setup_git_repo(tmp_path)1814 1815 original_cwd = Path.cwd()1816 os.chdir(tmp_path)1817 1818 try:1819 # FailingFlakeService injects "bad-input" during discovery and1820 # raises when asked to update it, simulating a 403 or dead ref1821 flake_service = FailingFlakeService(fail_inputs=["bad-input"])1822 test_gitea_service = MockGiteaService()1823 1824 with pytest.raises(UpdateFlakeInputsError, match="Failed to process 1 input"):1825> process_flake_updates(1826 flake_service,1827 test_gitea_service,1828 "",1829 "main",1830 "",1831 auto_merge=False,1832 )18331834tests/test_process_flake_updates.py:597: 1835_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 18361837flake_service = <tests.test_process_flake_updates.FailingFlakeService object at 0x10a13acf0>1838gitea_service = MockGiteaService(api_url='https://gitea.example.com', token='test-token', owner='test-owner', repo='test-repo', git_au...tions[bot]', git_committer_email='gitea-actions[bot]@noreply.gitea.io', merge_style='default', pr_creation_attempts=[])1839exclude_patterns = '', base_branch = 'main', branch_suffix = ''18401841 def process_flake_updates( # noqa: PLR09131842 flake_service: FlakeService,1843 gitea_service: GiteaService,1844 exclude_patterns: str,1845 base_branch: str,1846 branch_suffix: str,1847 *,1848 auto_merge: bool,1849 ) -> None:1850 """Process all flake updates.1851 1852 Args:1853 flake_service: Flake service instance1854 gitea_service: Gitea service instance1855 exclude_patterns: Patterns to exclude1856 base_branch: Base branch for PRs1857 branch_suffix: Optional suffix to append to branch names1858 auto_merge: Whether to automatically merge PRs1859 1860 """1861 # Discover flake files1862 flakes = flake_service.discover_flake_files(exclude_patterns)1863 if not flakes:1864 logger.info("No flake files found")1865 return1866 1867 logger.info("Found %d flake files to process", len(flakes))1868 1869 failed_inputs: list[str] = []1870 1871 # Process each flake1872 for flake in flakes:1873 logger.info("Processing flake: %s", flake.file_path)1874 logger.info("Inputs to update: %s", ", ".join(flake.inputs))1875 1876 # Don't include '.' for root directory1877 parent_path = Path(flake.file_path).parent1878 parent_suffix = "" if parent_path == Path() else f" in {parent_path}"1879 parent_branch = "" if parent_path == Path() else f"-{parent_path}"1880 suffix = branch_suffix.strip().replace("/", "-").strip("-")1881 1882 # Update each input1883 for input_name in flake.inputs:1884 try:1885 branch_name = f"update{parent_branch}-{input_name}"1886 branch_name = branch_name.replace("/", "-").strip("-")1887 if suffix:1888 branch_name = f"{branch_name}-{suffix}"1889 1890 logger.info(1891 "Updating input %s in %s (branch: %s)",1892 input_name,1893 flake.file_path,1894 branch_name,1895 )1896 1897 # Create worktree and update input1898 with gitea_service.worktree(branch_name, base_branch) as worktree_path:1899 # Update the input1900 flake_service.update_flake_input(1901 input_name,1902 flake.file_path,1903 str(worktree_path),1904 )1905 1906 # Commit changes1907 commit_message = f"Update {input_name}{parent_suffix}"1908 if gitea_service.commit_changes(1909 branch_name,1910 commit_message,1911 worktree_path,1912 ):1913 # Create pull request1914 pr_title = commit_message1915 pr_body = (1916 f"This PR updates the `{input_name}` input "1917 f"in `{flake.file_path}`.\n\n"1918 "Generated by update-flake-inputs action."1919 )1920 gitea_service.create_pull_request(1921 branch_name,1922 base_branch,1923 pr_title,1924 pr_body,1925 auto_merge=auto_merge,1926 )1927 else:1928 logger.info(1929 "No changes for input %s in %s",1930 input_name,1931 flake.file_path,1932 )1933 gitea_service.delete_branch(branch_name)1934 1935 except Exception:1936 logger.exception(1937 "Failed to update input %s in %s",1938 input_name,1939 flake.file_path,1940 )1941 failed_inputs.append(f"{input_name} in {flake.file_path}")1942 1943 if failed_inputs:1944 msg = f"Failed to process {len(failed_inputs)} input(s): {', '.join(failed_inputs)}"1945> raise UpdateFlakeInputsError(msg)1946E update_flake_inputs.exceptions.UpdateFlakeInputsError: Failed to process 2 input(s): bad-input in flake.nix, flake-utils in flake.nix19471948src/update_flake_inputs/cli.py:268: UpdateFlakeInputsError19491950During handling of the above exception, another exception occurred:19511952self = <tests.test_process_flake_updates.TestProcessFlakeUpdates object at 0x10a5068b0>1953tmp_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_fails_at_end_when_individ0')1954fixtures_path = PosixPath('/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/fixtures')19551956 @pytest.mark.impure1957 def test_fails_at_end_when_individual_input_fails(1958 self,1959 tmp_path: Path,1960 fixtures_path: Path,1961 ) -> None:1962 """Test that the action continues updating other inputs but fails at the end."""1963 flake_content = """{1964 inputs = {1965 flake-utils.url = "github:numtide/flake-utils";1966 };1967 1968 outputs = { self, flake-utils }: {1969 # Test flake with updatable input1970 };1971 }"""1972 1973 (tmp_path / "flake.nix").write_text(flake_content)1974 1975 shutil.copy(1976 fixtures_path / "minimal" / "flake.lock",1977 tmp_path / "flake.lock",1978 )1979 1980 _setup_git_repo(tmp_path)1981 1982 original_cwd = Path.cwd()1983 os.chdir(tmp_path)1984 1985 try:1986 # FailingFlakeService injects "bad-input" during discovery and1987 # raises when asked to update it, simulating a 403 or dead ref1988 flake_service = FailingFlakeService(fail_inputs=["bad-input"])1989 test_gitea_service = MockGiteaService()1990 1991> with pytest.raises(UpdateFlakeInputsError, match="Failed to process 1 input"):1992 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^1993E AssertionError: Regex pattern did not match.1994E Expected regex: 'Failed to process 1 input'1995E Actual message: 'Failed to process 2 input(s): bad-input in flake.nix, flake-utils in flake.nix'19961997tests/test_process_flake_updates.py:596: AssertionError1998----------------------------- Captured stdout call -----------------------------1999Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/test_fails_at_end_when_individ0/.git/2000[main (root-commit) 6645bc5] Initial commit2001 2 files changed, 53 insertions(+)2002 create mode 100644 flake.lock2003 create mode 100644 flake.nix2004Initialized empty Git repository in /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_fails_at_end_when_individ0.git/2005branch 'main' set up to track 'origin/main'.2006branch 'update-bad-input' set up to track 'origin/main'.2007HEAD is now at 6645bc5 Initial commit2008branch 'update-flake-utils' set up to track 'origin/main'.2009HEAD is now at 6645bc5 Initial commit2010----------------------------- Captured stderr call -----------------------------2011hint: Using 'master' as the name for the initial branch. This default branch name2012hint: will change to "main" in Git 3.0. To configure the initial branch name2013hint: to use in all of your new repositories, which will suppress this warning,2014hint: call:2015hint:2016hint: git config --global init.defaultBranch <name>2017hint:2018hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and2019hint: 'development'. The just-created branch can be renamed via this command:2020hint:2021hint: git branch -m <name>2022hint:2023hint: Disable this message with "git config set advice.defaultBranchName false"2024To /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_fails_at_end_when_individ0.git2025 * [new branch] main -> main2026From /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_fails_at_end_when_individ02027 * branch main -> FETCH_HEAD2028Preparing worktree (new branch 'update-bad-input')2029From /private/var/tb/7/scratch/173a9b950582271e/build/pytest-of-_tribuchetbld7/pytest-0/remote-test_fails_at_end_when_individ02030 * branch main -> FETCH_HEAD2031Preparing worktree (new branch 'update-flake-utils')2032------------------------------ Captured log call -------------------------------2033ERROR update_flake_inputs.cli:cli.py:259 Failed to update input bad-input in flake.nix2034Traceback (most recent call last):2035 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/cli.py", line 223, in process_flake_updates2036 flake_service.update_flake_input(2037 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^2038 input_name,2039 ^^^^^^^^^^^2040 flake.file_path,2041 ^^^^^^^^^^^^^^^^2042 str(worktree_path),2043 ^^^^^^^^^^^^^^^^^^^2044 )2045 ^2046 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/test_process_flake_updates.py", line 635, in update_flake_input2047 raise FlakeServiceError(msg)2048update_flake_inputs.exceptions.FlakeServiceError: Simulated failure updating bad-input2049ERROR update_flake_inputs.flake_service:flake_service.py:223 Failed to update flake input flake-utils in flake.nix. Exit code: 12050Stdout: No stdout output2051Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 296 ms (attempt 1/5)2052warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 506 ms (attempt 2/5)2053warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1291 ms (attempt 3/5)2054warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2116 ms (attempt 4/5)2055error:2056 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-img092s3/update-flake-utils?ref=refs/heads/update-flake-utils&rev=6645bc5c4a78cfe90f4b7110a892f5dfc38e6f49&shallow=1'20572058 … while updating the flake input 'flake-utils'20592060 … while fetching the input 'github:numtide/flake-utils'20612062 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com2063Traceback (most recent call last):2064 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input2065 result = subprocess.run(2066 [2067 ...<10 lines>...2068 check=True,2069 )2070 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run2071 raise CalledProcessError(retcode, process.args,2072 output=stdout, stderr=stderr)2073subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-img092s3/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.2074ERROR update_flake_inputs.cli:cli.py:259 Failed to update input flake-utils in flake.nix2075Traceback (most recent call last):2076 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 191, in update_flake_input2077 result = subprocess.run(2078 [2079 ...<10 lines>...2080 check=True,2081 )2082 File "/nix/store/2m6cdwqkpqw3cwm203mwv25l74sqbabw-python3-3.13.13-env/lib/python3.13/subprocess.py", line 577, in run2083 raise CalledProcessError(retcode, process.args,2084 output=stdout, stderr=stderr)2085subprocess.CalledProcessError: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-img092s3/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.20862087The above exception was the direct cause of the following exception:20882089Traceback (most recent call last):2090 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/cli.py", line 223, in process_flake_updates2091 flake_service.update_flake_input(2092 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^2093 input_name,2094 ^^^^^^^^^^^2095 flake.file_path,2096 ^^^^^^^^^^^^^^^^2097 str(worktree_path),2098 ^^^^^^^^^^^^^^^^^^^2099 )2100 ^2101 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/tests/test_process_flake_updates.py", line 636, in update_flake_input2102 super().update_flake_input(input_name, flake_file, work_dir)2103 ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^2104 File "/private/var/tb/7/scratch/173a9b950582271e/build/src/src/update_flake_inputs/flake_service.py", line 235, in update_flake_input2105 raise FlakeServiceError(msg) from e2106update_flake_inputs.exceptions.FlakeServiceError: Failed to update flake input flake-utils in flake.nix: Command '['nix', 'flake', 'update', '--flake', 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-img092s3/update-flake-utils?shallow=1', 'flake-utils']' returned non-zero exit status 1.2107Stderr: warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 296 ms (attempt 1/5)2108warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 506 ms (attempt 2/5)2109warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 1291 ms (attempt 3/5)2110warning: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com; retrying in 2116 ms (attempt 4/5)2111error:2112 … while updating the lock file of flake 'git+file:///private/var/tb/7/scratch/173a9b950582271e/build/flake-update-img092s3/update-flake-utils?ref=refs/heads/update-flake-utils&rev=6645bc5c4a78cfe90f4b7110a892f5dfc38e6f49&shallow=1'21132114 … while updating the flake input 'flake-utils'21152116 … while fetching the input 'github:numtide/flake-utils'21172118 error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': Could not resolve hostname (6) Could not resolve host: api.github.com2119=========================== short test summary info ============================2120FAILED tests/test_flake_service.py::TestFlakeService::test_update_flake_input2121FAILED tests/test_flake_service.py::TestFlakeService::test_update_subflake_input2122FAILED tests/test_process_flake_updates.py::TestProcessFlakeUpdates::test_with_updatable_flake_input2123FAILED tests/test_process_flake_updates.py::TestProcessFlakeUpdates::test_worktree_based_on_base_branch_not_head2124FAILED tests/test_process_flake_updates.py::TestProcessFlakeUpdates::test_custom_git_author_committer2125FAILED tests/test_process_flake_updates.py::TestProcessFlakeUpdates::test_branch_suffix2126FAILED tests/test_process_flake_updates.py::TestProcessFlakeUpdates::test_fails_at_end_when_individual_input_fails21277 failed, 16 passed in 104.64s (0:01:44)