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

fix(gitea): Use correct URL in PR Pagination #26876

Closed
wants to merge 11 commits into from

Conversation

ASDFGamer
Copy link

@ASDFGamer ASDFGamer commented Jan 26, 2024

Changes

This PR fixes a Bug that occures on the gitea plattform.

Previously it would use the url that was returned by gitea for the second page without checking if the url should be changed according to the gitUrl option.

This change removes the host part of the Url, like it is done for the first page of PRs and lets renovate choose the appropiate host and scheme.

Context

The bug occures only if the gitea api returns more than one page of PRs and the gitUrl option is set to endpoint or ssh.
I have no minimal reproduction of this bug becuse it needs a gitea instance and i don't have a public instance.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

This fixes a Bug that occures, when multiple pages of PRs are returned by gitea and the gitUrl option is set to endpoint.
@ASDFGamer ASDFGamer changed the title Use correct URL in Gitea PR Pagination fix(gitea): Use correct URL in PR Pagination Jan 26, 2024
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

this isn't a renovate bug. you're not correctly configure gitea to return proper urls.

set ROOT_URL to the public url and everything is fine.

https://docs.gitea.com/administration/config-cheat-sheet#server-server

@ASDFGamer
Copy link
Author

I thougth that the gitUrl endpoint setting can be used to override the url that is used (docs).
I run renovate and gitea inside of docker und use the ROOT_URL setting already to use a different external URL for gitea. This url is not accessible by renovate because it is routed through a reverse proxy. And i can't add a dns entry with the same url to the gitea container because the reverse proxy also adds HTTPS which means that the ROOT_URL in gitea uses HTTPS.

@viceice
Copy link
Member

viceice commented Jan 27, 2024

ok, then this should be hidden behind the feature flag RENOVATE_X_REBASE_PAGINATION_LINKS.
it should work as is and can use your suggestion when flag is enabled.

https://docs.renovatebot.com/self-hosted-experimental/#renovate_x_rebase_pagination_links

@ASDFGamer
Copy link
Author

Sounds good, I'm gonna change it to work that way,but it could take some time

@viceice viceice marked this pull request as draft January 30, 2024 07:45
@rarkins
Copy link
Collaborator

rarkins commented Mar 18, 2024

@ASDFGamer do you have time to continue this?

@ASDFGamer
Copy link
Author

Thanks for the reminder, I think that i should be able to do it in the next week

This is done as a preparation for the next changes to make the code cleaner
The RENOVATE_X_REBASE_PAGINATION_LINKS is now used to enable the rebasing of the pagination links
The docs for RENOVATE_X_REBASE_PAGINATION_LINKS contain now a
mentioning of the gitea platform
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

needs tests

This adds two tests for paginated PRs. The first test is for paginated PRs where
gitlab returns the expected link and the second test is for paginated PRs where
gitlab returns a different link.
The first test could have been added bevore this PR and isn't changed by this PR.
@ASDFGamer ASDFGamer marked this pull request as ready for review April 10, 2024 20:06
@ASDFGamer
Copy link
Author

I'm not familiar with your process for PRs. Ist there still something that I have to do or are you just busy with other things?

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

I'll need some time to investigate further. maybe we need a refactor first.

@rarkins rarkins requested a review from viceice May 7, 2024 05:35
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

this should be implemented like in #19888 instead

@ASDFGamer
Copy link
Author

Ok, I will try to implement it like that.

@rarkins rarkins closed this Jul 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants