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

refactor: Allow coordinate parameter to be [string, string] #1066

Closed
wants to merge 2 commits into from

Conversation

samm459
Copy link

@samm459 samm459 commented Jun 12, 2022

Hello! This is my first contribution to this great repo 🙏. Hope it helps!

Opted for :
coordinate?: [longitude: number | string, latitude: number | string]
instead of this:
coordinate?: [longitude: number, latitude: number] | [longitude: string, latitude: string]

Made sense to me given my approach coerces both into numbers either way. Hopefully this is what you were looking for.

Thank you!

@samm459 samm459 requested a review from a team as a code owner June 12, 2022 19:40
@xDivisionByZerox xDivisionByZerox added c: chore PR that doesn't affect the runtime behavior p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs and removed c: chore PR that doesn't affect the runtime behavior labels Jun 13, 2022
@xDivisionByZerox xDivisionByZerox added this to the v7 - Current Major milestone Jun 13, 2022
Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

Can you provide one extra test with mixed ([number, string]) parameters on the coordinate property? Just to ensure that nothing breaks during runtime.

@xDivisionByZerox xDivisionByZerox requested a review from a team June 13, 2022 15:36
@xDivisionByZerox xDivisionByZerox added needs test More tests are needed s: accepted Accepted feature / Confirmed bug labels Jun 13, 2022
@xDivisionByZerox xDivisionByZerox changed the title chore: Allow coordinate parameter to be [string, string] (#1044) refactor: Allow coordinate parameter to be [string, string] (#1044) Jun 13, 2022
@xDivisionByZerox
Copy link
Member

I changed the title to a refactor, hope you don't mind.

@xDivisionByZerox xDivisionByZerox linked an issue Jun 13, 2022 that may be closed by this pull request
@xDivisionByZerox xDivisionByZerox changed the title refactor: Allow coordinate parameter to be [string, string] (#1044) refactor: Allow coordinate parameter to be [string, string] Jun 13, 2022
@xDivisionByZerox
Copy link
Member

Listed as a todo in #1044.

@codecov
Copy link

codecov bot commented Jun 13, 2022

Codecov Report

Merging #1066 (0b3599b) into main (5b3f85a) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1066      +/-   ##
==========================================
- Coverage   99.65%   99.64%   -0.01%     
==========================================
  Files        2135     2135              
  Lines      229134   229134              
  Branches      974      971       -3     
==========================================
- Hits       228348   228329      -19     
- Misses        765      784      +19     
  Partials       21       21              
Impacted Files Coverage Δ
src/modules/address/index.ts 98.42% <100.00%> (ø)
src/modules/internet/user-agent.ts 86.37% <0.00%> (-6.38%) ⬇️
src/modules/finance/index.ts 100.00% <0.00%> (+0.68%) ⬆️

Copy link
Author

@samm459 samm459 left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback! Added another loop to the current test which runs the assertions against all 4 possible type combinations. Does this solution work for you?

ST-DDT
ST-DDT previously approved these changes Jun 13, 2022
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for your contribution!

@ST-DDT ST-DDT added s: needs decision Needs team/maintainer decision and removed s: accepted Accepted feature / Confirmed bug labels Jun 13, 2022
@ST-DDT
Copy link
Member

ST-DDT commented Jun 13, 2022

We should discuss whether we want to support string coordinates at all:

See also:

Sorry for the trouble.

@ST-DDT ST-DDT added s: on hold Blocked by something or frozen to avoid conflicts and removed needs test More tests are needed labels Jun 13, 2022
Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

@samm459 We had a team meeting today, where we discussed this PR. We came to the conclusion, that we currently don't feel responsible for providing a wide variety of input types. That means that the PR as-is will not be merged. In the #1044 you can see that this todo is updated to "will not fix".

But, this is your first PR in our project we want you to have a positive feeling of achievement.
Since the todo will no longer be fixed it needs to be removed from the code base.
So would you be so kind and revert your changes and then push an additional commit where you remove the comment?

@xDivisionByZerox xDivisionByZerox removed s: on hold Blocked by something or frozen to avoid conflicts s: needs decision Needs team/maintainer decision labels Jun 23, 2022
@ST-DDT ST-DDT dismissed their stale review June 23, 2022 16:33

Changed requirements

@samm459
Copy link
Author

samm459 commented Jun 27, 2022

Sounds good, can do. After giving it some thought I totally agree with the decision.

@xDivisionByZerox xDivisionByZerox added the m: location Something is referring to the location module label Jul 28, 2022
@xDivisionByZerox
Copy link
Member

@samm459 are you still willing to update your PR? Just wanted to make sure, was just checking open PRs.
You are allowed to take your time.

@ST-DDT
Copy link
Member

ST-DDT commented Aug 5, 2022

Superseded by #1234

@ST-DDT ST-DDT closed this Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: location Something is referring to the location module p: 1-normal Nothing urgent
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants