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

[github] Fix GitHub failing with URL ending with a slash #1160

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions grimoire_elk/raw/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def get_perceval_params_from_url(cls, url):
""" Get the perceval params given a URL for the data source """
params = []

url = url.rstrip('/')
owner = url.split('/')[-2]
repository = url.split('/')[-1]
params.append(owner)
Expand Down
7 changes: 7 additions & 0 deletions releases/unreleased/github-url-ending-with-slash-failed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: GitHub URL ending with slash failed
category: fixed
author: Jose Javier Merchante <[email protected]>
issue: 1159
notes: >
GrimoireLab failed to run with GitHub URLs ending in a slash
6 changes: 6 additions & 0 deletions tests/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ def test_perceval_params(self):
]
self.assertListEqual(GitHubOcean.get_perceval_params_from_url(url), expected_params)

url = "https://github.com/chaoss/grimoirelab-perceval/"
expected_params = [
'chaoss', 'grimoirelab-perceval'
]
self.assertListEqual(GitHubOcean.get_perceval_params_from_url(url), expected_params)

def test_demography_study(self):
""" Test that the demography study works correctly """

Expand Down