Skip to content

Conversation

@booxter
Copy link
Contributor

@booxter booxter commented May 4, 2025

This is helpful when running with --no-shell where there's no "paused"
context of nix-shell to assume. The link is clickable.

(Yes, the user sees git workspace removed at the end of the run but it's
not very convenient to copy the root of nixpkgs checkout, then append
logs manually.)

Signed-off-by: Ihar Hrachyshka ihar.hrachyshka@gmail.com

@booxter booxter marked this pull request as draft May 5, 2025 00:09
@booxter booxter marked this pull request as ready for review May 5, 2025 00:09
@booxter booxter marked this pull request as draft May 5, 2025 12:54
@booxter
Copy link
Contributor Author

booxter commented May 5, 2025

Will update to do it on tty only; and also may need to explore using hostname aware links for remote execution.

This is helpful when running with --no-shell where there's no "paused"
context of nix-shell to assume. The link is clickable.

(Yes, the user sees git workspace removed at the end of the run but it's
not very convenient to copy the root of nixpkgs checkout, then append
`logs` manually.)

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
@booxter booxter marked this pull request as ready for review May 7, 2025 22:26
# https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
def to_file_uri(path: Path) -> str:
"""Convert a path to a file URI, including hostname."""
return f"file://{socket.gethostname()}{path.absolute()}"
Copy link
Contributor Author

@booxter booxter May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including hostname gives the desired behavior, e.g. in kitty:

Editing /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs from build05
The command: ssh -o 'ControlPath=~/.ssh/kitty-rf-68330-%C' -o TCPKeepAlive=yes -o ControlPersist=yes -o BatchMode=yes linux-builder cat /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs failed
cat: /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs: Is a directory

Failed to download /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs

Yes, it failed to edit it after all, but the main point is that it correctly detected that the URI is remote and tried to download it for edit. I believe I just need some adjustment to kitty to make this work too.

(In the next PR that will add links to each built package this won't be a problem anyway since these will point to actual files.)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have some limit i.e. when too many packages are broken to not show all these links. This is also to keep the length of the report within a reasonable size that still is compatible with Github's limits for displaying comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 The links are seen only on tty and they won't blow up the (visible) size of reports because links are hidden, they are activated by "clicking" them. And they will not go to Github.

@booxter booxter requested a review from Mic92 May 7, 2025 22:40
@Mic92 Mic92 merged commit 82a6f39 into Mic92:master May 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants