Fixing problems with project overview
requested to merge 419973-follow-up-from-frontend-changes-to-support-fully-qualified-refs-on-blob-and-tree-view into master
What does this MR do and why?
This fixes a few bugs on the project overview when the redirect_with_ref_type
feature flag is enabled.
Fix problems around commit messages and last commits:
- There is a graphql query with ref_type with the incorrect case (should be uppercase), this didn't seem to be related to the bugs here but we're fixing it anyways.
- Make ref_type case insensitive for api requests (allowing frontend to always uppercase ref_type)
- make project overview implicitly request a branch ref_type
Fix problems around buttons for adding files:
- make head_tree always refer to a branch (the default branch) rather than situationally to a tag
Screenshots or screen recordings
Pay particular attention to:
- the last commit widget is showing the wrong commit in the before image
- the commit messages do not render for the files that are not in the tag in the before image
- there is a
README
button on the before image even though there isn't a README in the default branch
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Enable the
redirect_with_ref_type
feature flag (e.gFeature.enable(:redirect_with_ref_type)
) - Create a repository with a README
- Create a branch main2 that does not have a readme For example
git checkout -b main2 &&
git rm README.md &&
git commit -m "removed readme"
- Add another file to
main2
echo "newfile" > newfile &&
git add newfile &&
git commit -m "Add newfile" &&
git push origin main2
- Create a tag
main2
that does have README For example
git checkout main &&
git tag main2 &&
git push --tags
- Make
main2
the default branch of the repository (Settings -> Repository -> Branch defaults) - Check the project overview to see that
- the latest commit widget shows the message "removed readme"
- the commit message next newfile loads
- There is an
Add README
button
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #419973 (closed)
Edited by Jerry Seto