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

Split client into multiple files and add more tests #3647

Merged
merged 7 commits into from
Apr 26, 2024
Merged

Conversation

xoxys
Copy link
Member

@xoxys xoxys commented Apr 25, 2024

All the client functions were in a single file, which was already very long, and the test file gets even longer as more tests are added. I split it into separate files representing the API path and started adding some tests.

@xoxys xoxys requested a review from a team April 25, 2024 19:50
@qwerty287 qwerty287 added refactor delete or replace old code lib about our woodpecker-go api lib labels Apr 26, 2024
@xoxys
Copy link
Member Author

xoxys commented Apr 26, 2024

I have changed the anonymous struct in woodpecker-go/woodpecker/types.go to a declared one, as it makes tests easier. This change should be non-breaking, or am I wrong?

@xoxys xoxys requested a review from qwerty287 April 26, 2024 08:33
@qwerty287
Copy link
Contributor

It could be breaking for some users, but it's very unlikely.
I'd just add a todo comment so we can change it in 3.0 - this way we're safe.

Copy link
Contributor

@qwerty287 qwerty287 left a comment

Choose a reason for hiding this comment

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

Didn't test, but looks good

@xoxys xoxys enabled auto-merge (squash) April 26, 2024 11:38
@xoxys xoxys merged commit 2d66cfc into main Apr 26, 2024
5 of 7 checks passed
@xoxys xoxys deleted the refactor-wp-go branch April 26, 2024 11:46
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 26, 2024
1 task
6543 pushed a commit to 6543-forks/woodpecker that referenced this pull request Sep 5, 2024
All the client functions were in a single file, which was already very
long, and the test file gets even longer as more tests are added. I
split it into separate files representing the API path and started
adding some tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib about our woodpecker-go api lib refactor delete or replace old code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants