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

Correct the runIDFromURLRE regex to properly match the callbackURL #3495

Merged

Conversation

pputman-clabs
Copy link
Contributor

the callbackURL from the event previously didn't match with the regex, and was always causing a "no match found error". This includes the full URL and should match.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

I should have caught this before (sorry about that), but this repo supports both public GitHub and enterprise GitHub installations, which means that we can't hard-code a domain name in a regex.

Instead of your change, we should simply remove the leading carat (^) and then it should support both styles of URLs.

Please update this PR and then add a test for both styles of URLs showing that it should work on both. Thank you, @pputman-clabs.

@gmlewis gmlewis changed the title correct the regex to properly match the callbackURL Correct the regex to properly match the callbackURL Feb 25, 2025
@gmlewis gmlewis changed the title Correct the regex to properly match the callbackURL Correct the runIDFromURLRE regex to properly match the callbackURL Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.03%. Comparing base (a25b53e) to head (2cb7af7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3495   +/-   ##
=======================================
  Coverage   91.03%   91.03%           
=======================================
  Files         179      179           
  Lines       15574    15574           
=======================================
  Hits        14178    14178           
  Misses       1223     1223           
  Partials      173      173           

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

…move the carat(^) to match any url, along with tests for both https://api.github.com along with a dummy url for enterprise Github
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

One more tweak, please, @pputman-clabs, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Feb 25, 2025
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @pputman-clabs!
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 26, 2025

@stevehipwell - might you have time for a code review? Thank you!

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Feb 26, 2025
@gmlewis
Copy link
Collaborator

gmlewis commented Feb 26, 2025

Thank you, @stevehipwell!
Merging.

@gmlewis gmlewis merged commit e9d8a58 into google:master Feb 26, 2025
7 checks passed
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.

3 participants