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(gitlab): handle pagination of GitLab webhooks (#684) #684

Merged
merged 1 commit into from
May 7, 2024

Conversation

mdonadoni
Copy link
Member

Depends on #681

Closes #682

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 60.13%. Comparing base (4d23c62) to head (f11c539).

❗ Current head f11c539 differs from pull request most recent head 3f716f7. Consider uploading reports for the commit 3f716f7 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #684      +/-   ##
==========================================
+ Coverage   60.06%   60.13%   +0.06%     
==========================================
  Files          32       32              
  Lines        3308     3316       +8     
==========================================
+ Hits         1987     1994       +7     
- Misses       1321     1322       +1     
Files Coverage Δ
reana_server/utils.py 59.19% <86.66%> (+0.66%) ⬆️

@@ -511,27 +524,22 @@ def _get_gitlab_hook_id(project_id, gitlab_token):
"""
gitlab_hooks_url = (
REANA_GITLAB_URL
+ "/api/v4/projects/{0}/hooks?access_token={1}".format(project_id, gitlab_token)
+ "/api/v4/projects/{0}/hooks?per_page=100&access_token={1}".format(
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we could introduce a new configuration variable in config.py with REANA_GITLAB_PER_PAGE = 100 so that the value wouldn't be hard-coded?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have introduced REANA_GITLAB_MAX_PER_PAGE

@mdonadoni mdonadoni merged commit 3f716f7 into reanahub:master May 7, 2024
12 checks passed
@mdonadoni mdonadoni deleted the pagination-webhooks branch May 7, 2024 07:43
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.

gitlab: handle paginated results when fetching webhooks
2 participants