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

Modified regex to match user only #2751

Merged
merged 1 commit into from Feb 1, 2022

Conversation

Kevan-Y
Copy link
Contributor

@Kevan-Y Kevan-Y commented Jan 27, 2022

Issue This PR Addresses

Fixes #2707

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Modified the regex that filters GitHub URL to find GitHub Users tagged in posts to be shown under user/organization

Before

image

After

image

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@Kevan-Y Kevan-Y added type: bug Something isn't working area: front-end labels Jan 27, 2022
@Kevan-Y Kevan-Y self-assigned this Jan 27, 2022
@gitpod-io
Copy link

gitpod-io bot commented Jan 27, 2022

Copy link
Contributor

@AmasiaNalbandian AmasiaNalbandian left a comment

Choose a reason for hiding this comment

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

Great Work @Kevan-Y 💯

Look at this:
The link I hover on here is from michaels repository (you can see link at bottom left):
chrome_8NfDKNEFw6

That link adds both himself under users, and his repository under respository.
chrome_FUDZFwUFP4

@Kevan-Y
Copy link
Contributor Author

Kevan-Y commented Jan 27, 2022

Edge case found,

Example:
https://github.com/issues
https://github.com/marketplace
https://github.com/features/codespaces

Those will still be able to display in the Github info.

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

This is the sort of thing that is so easy to test, we should add some for filterGitHubUrls in a follow-up.

@Kevan-Y
Copy link
Contributor Author

Kevan-Y commented Jan 27, 2022

Don't very have a good solution right now besides hardcoded. Like have a list of reserved names, and do a check before adding to the list of repo or org.

The second solution is to call GitHub API to check one by one but might run out of the limit in a sec.

@humphd
Copy link
Contributor

humphd commented Jan 27, 2022

I don't think we should call the GitHub API. Having a list of ones we know are static endpoints would work. It doesn't need to be perfect, just "better".

aserputov
aserputov previously approved these changes Jan 31, 2022
@aserputov
Copy link
Contributor

@humphd can we merge this one ?

@humphd humphd merged commit 210828f into Seneca-CDOT:master Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: front-end type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub Users tagged in posts are not showing under user/organization
4 participants