-
Notifications
You must be signed in to change notification settings - Fork 26
Cached PR template does not update after remote file changed #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey, just to narrow this down: Is the branch you're submitting from restacked on top of trunk? |
Yes. |
Follow up: Is trunk fully synced? |
We calculate the template cache key based on the hashes of the files inside the locations in the repository where tempates are stored, but we check their state at `$trunk` instead of `$remote/$trunk`. This results in the cache not being invalidated if the remote has been updated and fetched, but the local ref is behind. Ref #369
If the above is the issue, then #370 should fix this. |
We calculate the template cache key based on the hashes of the files inside the locations in the repository where tempates are stored, but we check their state at `$trunk` instead of `$remote/$trunk`. This results in the cache not being invalidated if the remote has been updated and fetched, but the local ref is behind. Ref #369
I think so, I've ran |
Oh, And if the issue still persists: what is the path to the template file? |
yes, the file name is indeed lower case: |
Aha! That's it! Fix incoming! |
We use the contents of possible PR template sites as the hash key for caching the PR templates we get from the remote. This was only looking at PULL_REQUEST_TEMPLATE.md names, even though pull_request_template.md is valid and accepted. This change ensures that lower-cased versions are also considered when calculating the hash key. The contract of ChangeTemplatePaths has been adjusted to state that all paths are case-sensitive, not the other way around, since we don't have a guarantee that all forges will treat these as case-insensitive. Resolves #369
Alright, #371 should take care of it. |
We use the contents of possible PR template sites as the hash key for caching the PR templates we get from the remote. This was only looking at `PULL_REQUEST_TEMPLATE.md` names, even though `pull_request_template.md` is valid and accepted. This change ensures that lower-cased versions are also considered when calculating the hash key. To do this, we consider upper-case and lower-case variants of configured Forge template paths when calculating the cache key. Case-insensitivity of this path is considered part of the Forge contract because GitHub and GitLab both treat these as case-insensitive-ish. We can adjust this assumption if we add a forge that doesn't. Resolves #369
Thanks for the quick fix! v0.5.2 works fine now. |
I've updated
pull_request_template.md
in trunk of remote git repository, butgit-spice
still uses the old cached template when submitting stacks.The text was updated successfully, but these errors were encountered: