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: github adapter only applies to URLs formatted as expected #1708

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

pierrecamilleri
Copy link
Collaborator

@pierrecamilleri pierrecamilleri commented Nov 21, 2024

In the absence of other hints (e.g. a Controller object associated to another plugin), all URLs from github.com were being processed by the GithubPlugin, to create a Github Data Portal adapter.

With this PR, GithubPlugin only handles the URL if it has the expected format "https://github.com/user_or_org/repo", and "https://github.com/user_or_org", otherwise it is passed other to be treated as a plain URL.

I also made some refactorings along the way, to have more readable and less nested code.

As tests github portal are currently skipped, I checked manually that I have not broken this functionality.

Copy link
Contributor

@pdelboca pdelboca left a comment

Choose a reason for hiding this comment

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

Looks good @pierrecamilleri .

Personally I like early returns in methods (so +1!), they make the overall logic of the method easier to follow since you automatically discard scenarios in your mind 👍🏼

@pierrecamilleri pierrecamilleri merged commit d97ae46 into main Nov 22, 2024
9 checks passed
@pierrecamilleri pierrecamilleri deleted the fix/github-url branch November 22, 2024 08:02
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.

2 participants