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

Gitea/FJ: create branch before opening PR #273

Closed
wants to merge 2 commits into from

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented Jan 8, 2025

fix #204

Untested, would test in woodpecker-plugins with next to see if that solves the current issues there.

@pat-s pat-s requested review from 6543 and anbraten as code owners January 8, 2025 17:50
@@ -37,6 +37,13 @@ export class GiteaForge extends Forge {
sourceBranch: string;
targetBranch: string;
}): Promise<{ pullRequestLink: string }> {
await this.handleApiErrors(
Copy link
Member

Choose a reason for hiding this comment

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

We already push changes (and thereby create a new branch with actual content) a few lines before, so this seems to be rather a hack that would not include those changes. Is gitea taking some time after pushing a branch to recognize it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might have multiple issues: one for branch creation, one for PR creation.

For this one, when the branch is pushed/created, do we check for conflicts? I can't really infer where this is done. If it is a push, no conflicts should arise, if it an API call, it should be accounted for.

And yes, the "undefined" return in case of an API error should also be improved to at least see the underlying error.

@pat-s
Copy link
Contributor Author

pat-s commented Jan 9, 2025

Agree that this is not the issue. Will create a new, more comprehensive refactor PR soon which is more robust to the current issues at hand.

@pat-s pat-s closed this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gitea/Forgejo: can not create branch
2 participants