Closed koppor closed 1 week ago
Thanks a lot for reporting!
My initial investigation leads to this portion of the code responsible for reading the PR file from disk:
It clearly assumes to receive a worktree-relative path, but I have a feeling that the PR request path is absolute.
Alternatively, maybe it's not available in the tree as the function actually tries to read it from the current HEAD^{tree}
, not from the worktree (i.e. checked out files on disk).
If you could provide the logs of a failure it should become clearer where exactly it fails, which should help to fix it 'blindly'. Thanks again.
at a.fromError (https://tauri.localhost/_app/immutable/chunks/Icon.Bfycfzga.js:1:1104)
at S1 (https://tauri.localhost/_app/immutable/chunks/Icon.Bfycfzga.js:1:1310)
at async Za.pullRequestTemplateContent (https://tauri.localhost/_app/immutable/nodes/3.IgIM1k96.js:201:8251)
I get the same error. Windows. Version 0.13.0
ipc->get_pr_template_contents: {"relativePath":"D:\\source\\MewsSystems\\guest-profiles\\.github\\PULL_REQUEST_TEMPLATE.md","projectId":"a853f7a3-7ad0-4aa3-8f62-79a1f0ff7015"} a: Invalid workspace file
at a.fromError (https://tauri.localhost/_app/immutable/chunks/Icon.Bfycfzga.js:1:1104)
at S1 (https://tauri.localhost/_app/immutable/chunks/Icon.Bfycfzga.js:1:1310)
at async Za.pullRequestTemplateContent (https://tauri.localhost/_app/immutable/nodes/3.IgIM1k96.js:201:8251) Object
(anonymous) @ user.CSv90AG6.js:4
user.CSv90AG6.js:4 Error reading pull request template at path: D:\source\MewsSystems\guest-profiles\.github\PULL_REQUEST_TEMPLATE.md a: Invalid workspace file
at a.fromError (https://tauri.localhost/_app/immutable/chunks/Icon.Bfycfzga.js:1:1104)
at S1 (https://tauri.localhost/_app/immutable/chunks/Icon.Bfycfzga.js:1:1310)
at async Za.pullRequestTemplateContent (https://tauri.localhost/_app/immutable/nodes/3.IgIM1k96.js:201:8251)
Thanks a lot for the backend logs.
It actually does run into the issue I thought it would run into, so we see Invalid workspace file
.
The problem is canonicalize()
, which on Windows produces funny paths that would only do what one expects if compared to other canonicalized paths. Maybe that's not the case here.
Will investigate.
@Byron The error still happens in 0.13.1
ipc->get_pr_template_contents: {"relativePath":"D:\\source\\MewsSystems\\guest-profiles\\.github\\PULL_REQUEST_TEMPLATE.md","projectId":"a853f7a3-7ad0-4aa3-8f62-79a1f0ff7015"} a: Repo path `D:\source\MewsSystems\guest-profiles\.github\PULL_REQUEST_TEMPLATE.md` should be relative, not a windows prefix
at a.fromError (https://tauri.localhost/_app/immutable/chunks/Icon.CsL-f0F-.js:1:1104)
at S1 (https://tauri.localhost/_app/immutable/chunks/Icon.CsL-f0F-.js:1:1310)
at async Za.pullRequestTemplateContent (https://tauri.localhost/_app/immutable/nodes/3.S8Z9hBEv.js:201:8251)
Thanks a lot for reporting back!
I think the source of the issue is now clearer thanks to the added context: Repo path '<path>' should be relative, not a windows prefix
.
It is due to read_file_from_workspace()
trying to use a non-relative path, which in turn is an oddity that should be fixed by #5089.
This issue will now auto-close when #5089 is merged.
Version
0.13.0
Operating System
Windows
Distribution Method
msi (Windows)
Describe the issue
I selected a PR template, but I get
I checked in Explorer - the file exists:
Think, this refs https://github.com/gitbutlerapp/gitbutler/pull/4814
How to reproduce
Expected behavior
PR template is used.
Relevant log output
No response