Skip to content
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

Support shortened commit SHAs in URLs #13686

Merged
merged 6 commits into from
Nov 25, 2020

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Nov 24, 2020

Fixes #6450

Closes #6452

@lafriks lafriks added the type/enhancement An improvement of existing functionality label Nov 24, 2020
@lafriks lafriks added this to the 1.14.0 milestone Nov 24, 2020
@codecov-io
Copy link

Codecov Report

Merging #13686 (9003d75) into master (24330f7) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13686      +/-   ##
==========================================
- Coverage   42.27%   42.26%   -0.02%     
==========================================
  Files         697      697              
  Lines       76616    76618       +2     
==========================================
- Hits        32389    32380       -9     
- Misses      38908    38915       +7     
- Partials     5319     5323       +4     
Impacted Files Coverage Δ
modules/context/repo.go 54.82% <100.00%> (-0.02%) ⬇️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
modules/queue/workerpool.go 61.22% <0.00%> (-0.82%) ⬇️
models/gpg_key.go 53.33% <0.00%> (-0.58%) ⬇️
services/pull/pull.go 40.78% <0.00%> (-0.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24330f7...9003d75. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 24, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 24, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 24, 2020
Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

Feedback from other PR:

Can we support the shortened sha but redirect to the full actual one ?

@lafriks
Copy link
Member Author

lafriks commented Nov 24, 2020

@techknowlogick I don't think that's needed as it does kind of break desired behavior imho and other (ex. Github and Gitlab) also does not do redirection

@6543
Copy link
Member

6543 commented Nov 24, 2020

hmm redirection could be a feature ...

@lafriks
Copy link
Member Author

lafriks commented Nov 24, 2020

Also we don't do redirection also in other places where we already support short sha urls. Also if later added to API it would be even undesirable

@techknowlogick
Copy link
Member

In that case is it possible to add rel=canoical tags to the commit page with the full sha (more info: https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls) so that search engines don't duplicate the information?

@lafriks
Copy link
Member Author

lafriks commented Nov 25, 2020

@techknowlogick it's not fool proof but added :D

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

Thanks :)

@techknowlogick
Copy link
Member

🚀

@techknowlogick techknowlogick merged commit 57fa9b0 into go-gitea:master Nov 25, 2020
@lafriks lafriks deleted the feat/short_commitsha branch November 25, 2020 21:17
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal to add missing support for short-hash src URLs
6 participants