-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix incorrect divergence cache after switching default branch #34370
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
Conversation
Issue: After switching the default branch, other branches are still compared against the old default branch due to outdated divergence cache. Change: Clear the divergence cache in SetRepoDefaultBranch to ensure correct comparisons against the new default branch. Fixes go-gitea#34369
aec8d9b
to
9902c62
Compare
It's better to have a test. |
Verify that branch divergence counts are correctly recalculated after changing the default branch.
I’ve added an integration test to verify that branch divergence counts are correctly recalculated after switching the default branch. |
|
||
htmlDoc := NewHTMLParser(t, resp.Body) | ||
|
||
branchNodes := htmlDoc.doc.Find(".gt-ellipsis").Nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class selector is too unspecific. Can you maybe add a new unique class to the elements in question and select on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a new .branch-name
class to branch name elements in the branch list template, and updated integration test accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a new
.branch-name
class to branch name elements in the branch list template, and updated integration test accordingly.
I suggest left a comment like something that branch-name
is used for tests, do not remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest left a comment like something that branch-name is used for tests, do not remove.
Not strictly needed imho, but nice to have because one will notice anyways when the test starts to fail.
…ea#34370) Issue: After switching the default branch, other branches are still compared against the old default branch due to outdated divergence cache. Change: Clear the divergence cache in SetRepoDefaultBranch to ensure correct comparisons against the new default branch. Fixes go-gitea#34369
#34406) Backport #34370 by @GWDx Issue: After switching the default branch, other branches are still compared against the old default branch due to outdated divergence cache. Change: Clear the divergence cache in SetRepoDefaultBranch to ensure correct comparisons against the new default branch. Fixes #34369 Co-authored-by: GWDx <[email protected]>
* giteaofficial/main: [skip ci] Updated translations via Crowdin Fix autofocus behavior (go-gitea#34397) Fix incorrect divergence cache after switching default branch (go-gitea#34370) Add a button editing action secret (go-gitea#34348) Fix LFS file not stored in LFS when uploaded/edited via API or web UI (go-gitea#34367) [skip ci] Updated translations via Crowdin Fix "The sidebar of the repository file list does not have a fixed height go-gitea#34298" (go-gitea#34321) feat: add label 'state' to metric 'gitea_users' (go-gitea#34326) Update JS and PY dependencies (go-gitea#34391) Upgrade go-github v61 -> v71 (go-gitea#34385) Bump `@github/relative-time-element` to v4.4.7 (go-gitea#34384) gitignore: Visual Studio settings folder (go-gitea#34375) Grey out expired artifact on Artifacts list (go-gitea#34314)
Issue: After switching the default branch, other branches are still compared against the old default branch due to outdated divergence cache.
Change: Clear the divergence cache in SetRepoDefaultBranch to ensure correct comparisons against the new default branch.
Fixes #34369