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

Add filter to list repository pipelines API #4416

Merged
merged 6 commits into from
Nov 28, 2024

Conversation

6543
Copy link
Member

@6543 6543 commented Nov 19, 2024

we currently filter thing on the client side:

const allPipelines = inject<Ref<Pipeline[]>>('pipelines');
const pipelines = computed(() =>
allPipelines?.value.filter(
(b) =>
(b.event === 'pull_request' || b.event === 'pull_request_closed') &&
b.ref
.replaceAll('refs/pull/', '')
.replaceAll('refs/merge-requests/', '')
.replaceAll('refs/pull-requests/', '')
.replaceAll('/from', '')
.replaceAll('/merge', '')
.replaceAll('/head', '') === pullRequest.value,
),
);

this makes it possible to filter server side in an upcomming pull addressing the frontend

@6543 6543 added server enhancement improve existing features labels Nov 19, 2024
@anbraten
Copy link
Member

We still need to filter on the client though to get reactive queries updating on changes coming from the sse stream.

@6543
Copy link
Member Author

6543 commented Nov 19, 2024

☝️ well yes but we also need it from the server as getting a random count of entry's even if there should exist more ... is bad

e.g: https://ci.woodpecker-ci.org/repos/3780/branches/main

-> somethimes it just displays 2 ... or 3 ... or some other random number

@6543
Copy link
Member Author

6543 commented Nov 19, 2024

@6543 6543 requested a review from anbraten November 19, 2024 18:57
@xoxys
Copy link
Member

xoxys commented Nov 27, 2024

but we have https://ci.woodpecker-ci.org/repos/3780/pipeline/15602 ....

Can you explain how server-side filtering help in this case?

@6543
Copy link
Member Author

6543 commented Nov 27, 2024

well you currently can not discover it if you dont have the link or are on the specific pull to retrive the link

@6543
Copy link
Member Author

6543 commented Nov 27, 2024

this is just false:

image
image

@xoxys
Copy link
Member

xoxys commented Nov 27, 2024

That was clear already, I still don't understand how server-side filtering will solve it.

@6543
Copy link
Member Author

6543 commented Nov 27, 2024

you have to query the server again and use that filter if you switch the pipeline list view to a different one

@6543
Copy link
Member Author

6543 commented Nov 27, 2024

If I have time I'll also update the frontend within this pull at some point

@woodpecker-bot
Copy link
Contributor

woodpecker-bot commented Nov 27, 2024

Deployment of preview was torn down

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 60.71429% with 11 lines in your changes missing coverage. Please review.

Project coverage is 28.22%. Comparing base (de82236) to head (4416d06).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
server/api/pipeline.go 38.88% 10 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4416      +/-   ##
==========================================
+ Coverage   28.21%   28.22%   +0.01%     
==========================================
  Files         384      384              
  Lines       27833    27854      +21     
==========================================
+ Hits         7852     7862      +10     
- Misses      19292    19302      +10     
- Partials      689      690       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xoxys xoxys merged commit 52fb493 into woodpecker-ci:main Nov 28, 2024
9 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 28, 2024
1 task
@6543 6543 deleted the pipelines-api-add-filter branch November 28, 2024 23:46
@woodpecker-bot woodpecker-bot mentioned this pull request Dec 14, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing features server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants