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

Made contributing.md file name check case insensitive in the cookbook source_url repo; Fixed github url regex; #2180

Conversation

RajeshPaul38
Copy link
Contributor

@RajeshPaul38 RajeshPaul38 commented Aug 24, 2021

Signed-off-by: Rajesh Paul rajesh.paul@progress.com

Description

made contributing.md file name check case insensitive in the repo given in source url of cookbooks for reflecting correctly in cookbook quality metric

Issues Resolved

#1837

Check List

…en in source url of cookbooks for reflecting correctly in cookbook quality metric

Signed-off-by: Rajesh Paul <rajesh.paul@progress.com>
@RajeshPaul38 RajeshPaul38 requested a review from a team August 24, 2021 19:08
@RajeshPaul38 RajeshPaul38 requested review from a team as code owners August 24, 2021 19:08
@RajeshPaul38 RajeshPaul38 linked an issue Aug 24, 2021 that may be closed by this pull request
@tas50
Copy link
Contributor

tas50 commented Aug 24, 2021

Is it possible to write a test for this? Did we have existing unit tests for this functionality?

@tas50
Copy link
Contributor

tas50 commented Aug 24, 2021

@RajeshPaul38 It looks like there's a legit failure in the specs that will need to be resolved

@RajeshPaul38
Copy link
Contributor Author

yes working on the fix for the unit tests.

Signed-off-by: Rajesh Paul <rajesh.paul@progress.com>
…atibility with spec

Signed-off-by: Rajesh Paul <rajesh.paul@progress.com>
@RajeshPaul38
Copy link
Contributor Author

@tas50 I've resolved the testcases. Have also fixed the regex to check for github URL match because there were multiple invalid github urls which were passing through the regex. Also have added a unit test to check for non github urls. You can review now.

@RajeshPaul38 RajeshPaul38 changed the title made contributing.md file name check case insensitive in the cookbook source_url repo Made contributing.md file name check case insensitive in the cookbook source_url repo; Fixed github url regex; Aug 25, 2021
@@ -7,8 +7,7 @@ class SourceRepoWorker

def source_repo(cookbook_json)
url = source_repo_url(cookbook_json)

url.match(%r{(?<=github.com\/)[\w-]+\/[\w-]+}).to_s
url.match(%r{^(https?\://)?(github\.com/)(\w+/\w+)}).try(:[], 3).to_s
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we include rubular permalink as a comment here? e.g. from https://rubular.com

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion @dheerajd-msys . Thanks for the link. It's a great tool. Should I add the permalink in code?

@dheerajd-msys
Copy link
Contributor

LGTM overall !!

@tas50 tas50 merged commit 0341487 into main Aug 26, 2021
@tas50 tas50 deleted the rajeshpaul38/contributing.md-check-case-insensitive-cookbook-quality-metric branch August 26, 2021 16:36
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.

CONTRIBUTING.md quality metric should not be case sensitive
3 participants