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

added constants for builtin providers #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

josearomeroj
Copy link

@josearomeroj josearomeroj commented Jan 9, 2023

Added type safety for builtin providers names

@umputun
Copy link
Member

umputun commented Jan 9, 2023

Thank you for the pull request. Unfortunately, it seems that the changes made do not provide the type safety described in the description. Currently, the BuiltinProviderName type will happily accept a "naked string", meaning that there is nothing preventing a user from passing a regular string as the provider name.

Generally speaking, this PR is OK as it deduplicates usage of string constants but doesn't do what the PR description says.

Please update the description to reflect these changes and address the minor linter issue. Once that has been done, I will be happy to merge the pull request.

@josearomeroj
Copy link
Author

Just added real type safety and fixed the lint issue

Copy link
Member

@umputun umputun left a comment

Choose a reason for hiding this comment

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

This really is type-safe, but it breaks back compatibility for all the existing users. The previous method wasn't type-safe but was less destructive. Making such a change will require a new major version, and I see no reason to start v2 just for this thing.

@josearomeroj
Copy link
Author

This really is type-safe, but it breaks back compatibility for all the existing users. The previous method wasn't type-safe but was less destructive. Making such a change will require a new major version, and I see no reason to start v2 just for this thing.

Yes, you are right, this change is not that important to remove the backwards compatibility. Should I left it as it was before (Changing the commit message)?

@umputun
Copy link
Member

umputun commented Jan 9, 2023

yep, just revert it to accept naked string and change the PR description

@josearomeroj josearomeroj changed the title added type safety for builtin providers added constants for builtin providers Jan 9, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3877687112

  • 13 of 14 (92.86%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 95.72%

Changes Missing Coverage Covered Lines Changed/Added Lines %
auth.go 13 14 92.86%
Totals Coverage Status
Change from base Build 3832831444: 0.03%
Covered Lines: 246
Relevant Lines: 257

💛 - Coveralls

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.

None yet

3 participants