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

Accounting for IDs of cluster features when the promoteID properties is set #4899

Merged
merged 24 commits into from
Nov 6, 2024

Conversation

popkinj
Copy link
Contributor

@popkinj popkinj commented Oct 25, 2024

This is to address the issue of loosing the ID for clusters when the promoteId property is set. Talked about here.

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.93%. Comparing base (138ed60) to head (fd942ec).

Files with missing lines Patch % Lines
src/data/feature_index.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4899      +/-   ##
==========================================
- Coverage   89.10%   88.93%   -0.18%     
==========================================
  Files         269      269              
  Lines       38268    38271       +3     
  Branches     2351     2367      +16     
==========================================
- Hits        34100    34037      -63     
- Misses       3165     3224      +59     
- Partials     1003     1010       +7     

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

@HarelM
Copy link
Collaborator

HarelM commented Oct 26, 2024

Please add a test that covers this scenario and a changelog entry.
If there's an open issue in the repo please link to it.

@popkinj
Copy link
Contributor Author

popkinj commented Oct 29, 2024

Please add a test that covers this scenario and a changelog entry. If there's an open issue in the repo please link to it.
Hey @HarelM

Just a quick sanity check... So I'm guessing I'll:

  • Make a new folder here called something like promote-id-cluster.
  • Write a style to have one clustered feature and one un-clustered.
  • Set the promoteId to some attribute.
  • Style the two features based on ID? If an ID is missing it would be one colour. If the ID is there it would be another (correct) colour.
  • Then finally create an expected.png file as the control.

I'm I heading down the right direction.

@HarelM
Copy link
Collaborator

HarelM commented Oct 29, 2024

I would look into writing a unit test and not an integration test. i.e. Look for other tests for this class and add the relevant scenario you fixed in the test.
It is best to check that the test fails without the fix you did to make sure the test actually tests your fix.

@popkinj popkinj marked this pull request as ready for review November 3, 2024 21:39
@HarelM
Copy link
Collaborator

HarelM commented Nov 4, 2024

Overall, this looks great, thanks!
I've added some minor comments.

@popkinj popkinj requested a review from HarelM November 4, 2024 21:36
@HarelM
Copy link
Collaborator

HarelM commented Nov 4, 2024

According to the coverage report, it looks like the test is not covering the code that you added.
Can you check that removing your fix causes the test to fail?
I've seen in the past that the coverage report is not accurate, but I want to make sure this is not the case here...

@popkinj
Copy link
Contributor Author

popkinj commented Nov 4, 2024

According to the coverage report, it looks like the test is not covering the code that you added. Can you check that removing your fix causes the test to fail? I've seen in the past that the coverage report is not accurate, but I want to make sure this is not the case here...

Yes.... Looking into that now. One of the three tests is not behaving how I thought. Maybe that's the issue.
Removing the fix doesn't seem to trip the last of the three tests.

@popkinj
Copy link
Contributor Author

popkinj commented Nov 4, 2024

Yeah... Think I was trying to get to fancy with my tests... I've pared it down to only test the three lines.

@popkinj
Copy link
Contributor Author

popkinj commented Nov 4, 2024

According to the coverage report, it looks like the test is not covering the code that you added. Can you check that removing your fix causes the test to fail? I've seen in the past that the coverage report is not accurate, but I want to make sure this is not the case here...

Removing my code now causes my test to fail. However I'm not seeing any changes in the report.
Hmmm.... Maybe I don't understand how the code coverage works. Am I missing some Codecov settings somewhere?

@HarelM
Copy link
Collaborator

HarelM commented Nov 4, 2024

Can you run the coverage locally and see if this is covered?

@HarelM
Copy link
Collaborator

HarelM commented Nov 4, 2024

And also make sure you push your changes in case you haven't by mistake.

@popkinj
Copy link
Contributor Author

popkinj commented Nov 5, 2024

Can you run the coverage locally and see if this is covered?

Good thinking... That's much better then waiting for the pipeline to finish haha.

@popkinj
Copy link
Contributor Author

popkinj commented Nov 5, 2024

How do you run the coverage locally @HarelM . Is it something like npm run codegen?

@HarelM
Copy link
Collaborator

HarelM commented Nov 5, 2024

npm run test-unit-ci IIRC

@popkinj
Copy link
Contributor Author

popkinj commented Nov 5, 2024

npm run test-unit-ci IIRC

Hmmmm... That worked well.
In the output report it's not mentioning my new lines as uncovered:

feature_index.ts | 41.22 | 68.75 | 36.36 | 41.22 | 109-172,175-253,258-285,288-295,319-324,326-338,340-342

If I'm not mistaken... the new code I added are on lines 305-307. Does this mean it worked?

@popkinj
Copy link
Contributor Author

popkinj commented Nov 6, 2024

Hey @HarelM .
Is the GH action really running out of resources... as the error suggests? Or is it something I introduced?

@HarelM
Copy link
Collaborator

HarelM commented Nov 6, 2024

You need to increase the build size expected value a bit.

@HarelM HarelM merged commit 91e4945 into maplibre:main Nov 6, 2024
15 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