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 changed files for Gitea PRs #1342

Merged
merged 27 commits into from
Oct 28, 2022
Merged

Conversation

qwerty287
Copy link
Contributor

@qwerty287 qwerty287 commented Oct 26, 2022

#1138

TODOs:

  • add tests (just use existing and extend) for this testcase
  • ignore error if gitea version is to low
  • change docs acordingly

@qwerty287 qwerty287 added forge/gitea gitea forge related enhancement improve existing features labels Oct 26, 2022
@qwerty287 qwerty287 added this to the 1.0.0 milestone Oct 26, 2022
@qwerty287 qwerty287 requested a review from a team October 26, 2022 12:41
@qwerty287 qwerty287 self-assigned this Oct 26, 2022
@6543

This comment was marked as outdated.

server/remote/gitea/gitea.go Outdated Show resolved Hide resolved
@woodpecker-bot
Copy link
Collaborator

woodpecker-bot commented Oct 26, 2022

Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-1342.surge.sh

qwerty287 and others added 2 commits October 26, 2022 16:18
Co-authored-by: 6543 <6543@obermui.de>
@6543
Copy link
Member

6543 commented Oct 26, 2022

thanks ❤️ now only tests are missing

I think you can just look into github remote as there already should be some in that you can copy/use as template

qwerty287 and others added 2 commits October 26, 2022 16:26
@qwerty287
Copy link
Contributor Author

@6543 GitHub doesn't contain any tests for this, I'll add some new (for Gitea) though.

@qwerty287
Copy link
Contributor Author

I tried to add some tests now, but without real success. The issue is that this new method needs to access the user token and I don't really know how I can inject a user into it without having to inject a store in the context. I can add a new key user-debug that is used when the store is not available. Would you say that's fine?

@codecov-commenter

This comment was marked as off-topic.

@qwerty287
Copy link
Contributor Author

For a failing example of a test and the user-debug key look at cb5e784

@qwerty287 qwerty287 removed their assignment Oct 27, 2022
@6543 6543 requested a review from lafriks October 28, 2022 13:22
@6543
Copy link
Member

6543 commented Oct 28, 2022

added tests by using the mock_store

@6543 6543 enabled auto-merge (squash) October 28, 2022 13:31
@qwerty287
Copy link
Contributor Author

@6543 There's this lint

server/store/context.go:46:9: context-keys-type: should not use basic type string as key in context.WithValue (revive)
	return context.WithValue(ctx, key, store)

@qwerty287
Copy link
Contributor Author

How can I fix this?

@6543
Copy link
Member

6543 commented Oct 28, 2022

We cant as we use gin framework

We would have to patch that upstream

@6543

This comment was marked as outdated.

@6543 6543 disabled auto-merge October 28, 2022 17:16
@6543 6543 merged commit 8f183c8 into woodpecker-ci:master Oct 28, 2022
@qwerty287 qwerty287 deleted the gitea-pr-files branch October 29, 2022 06:13
simmstein pushed a commit to simmstein/woodpecker that referenced this pull request Dec 27, 2022
- add tests to fetch changed files
- ignore error if gitea version is to low
- adjust docs accordingly

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing features forge/gitea gitea forge related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants