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

Validation v3 #36

Merged
merged 17 commits into from
Jul 11, 2024
Merged

Validation v3 #36

merged 17 commits into from
Jul 11, 2024

Conversation

maurafortino
Copy link

What's Included:

  • Update the options.go file to include validation for RegistrationV2
  • Updated unit tests to include test cases for RegistrationV2 and the default cases.

**Need to discuss:

  • Validation for RegistrationV2: what fields do we want to validate and are the current validations correct

@maurafortino maurafortino added the needs discussion Further discussion is needed to move forward label Jul 1, 2024
@maurafortino maurafortino requested a review from denopink July 1, 2024 20:01
@maurafortino maurafortino self-assigned this Jul 1, 2024
@maurafortino maurafortino marked this pull request as draft July 1, 2024 20:44
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
webhook.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
webhook.go Outdated Show resolved Hide resolved
Copy link

@denopink denopink 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! This is coming along, I left a few suggestions.

I think we should reconsider reusing the validation code in order to reduce the volume of changes in the pr.

Also, we should consider following the same pattern for the RegistrationV2's validation code (i.e. moving the V2 validation code into their own funcs)

Great work, keep it up! 🍻

options.go Outdated Show resolved Hide resolved
@denopink denopink mentioned this pull request Jul 8, 2024
}
}
return nil
}
Copy link
Author

Choose a reason for hiding this comment

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

I removed this function entirely since the code is the same for both v1 and v2

@@ -87,7 +78,7 @@ func buildURLChecker(config ValidatorConfig) (*urlegit.Checker, error) {
func BuildValidators(config ValidatorConfig) ([]Option, error) {
var opts []Option

checker, err := buildURLChecker(config)
checker, err := BuildURLChecker(config)
if err != nil {
return nil, err
}
Copy link
Author

Choose a reason for hiding this comment

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

This function will be updated in a future PR

GetId() string
GetUntil() time.Time
}

Copy link
Author

Choose a reason for hiding this comment

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

This has been added to ancla

@maurafortino maurafortino requested a review from denopink July 8, 2024 16:54
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
Copy link

@denopink denopink left a comment

Choose a reason for hiding this comment

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

left a few small suggestions, otherwise LGTM! 🍻

@maurafortino maurafortino marked this pull request as ready for review July 10, 2024 20:31
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 99.01961% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (denopink/feat/webhooks@dda637f). Learn more about missing BASE report.

Files Patch % Lines
webhook.go 96.15% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             denopink/feat/webhooks      #36   +/-   ##
=========================================================
  Coverage                          ?   91.61%           
=========================================================
  Files                             ?        3           
  Lines                             ?      298           
  Branches                          ?        0           
=========================================================
  Hits                              ?      273           
  Misses                            ?       25           
  Partials                          ?        0           
Flag Coverage Δ
unittests 91.61% <99.01%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@maurafortino maurafortino merged commit 0ee06ff into denopink/feat/webhooks Jul 11, 2024
13 checks passed
@maurafortino maurafortino deleted the validation-v3 branch July 11, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Further discussion is needed to move forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants