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

remove defaultValue() and create DefaultValue namespace #12252

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

dave-b-b
Copy link

@dave-b-b dave-b-b commented Oct 13, 2024

Description

  • I started over because I could not get the tests to pass
  • removed defaultValue() in 'easy' to spot references
  • fetched most up to date copy of cesium, so that my pull request wasn't cluttered

Issue number and link

Issue: 11674
#11674

Testing plan

The following tests failed:
✗ renders a point
✗ renders pnts with point size style

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

- I started over because I could not get the tests to pass
- removed defaultValue() in 'easy' to spot references
- fetched most up to date copy of cesium, so that my pull request wasn't cluttered
Copy link

Thank you for the pull request, @dave-b-b!

✅ We can confirm we have a CLA on file for you.

@dave-b-b
Copy link
Author

@jjspace Can you delete the other commits I had? I started over because I couldn't get the tests to pass. This one is much cleaner. If I can get help on the two tests that are failing, then I can move forward with this one.

@jjspace jjspace self-assigned this Oct 14, 2024
@jjspace
Copy link
Contributor

jjspace commented Oct 14, 2024

@dave-b-b I'm a little confused on the state of this with #12207 still open? should that PR be closed and only plan to merge this one?
All the tests look like they're passing on this branch, which ones are you having issues with?
I also still see a bunch of instances of defaultValue() being used on this branch, are there commits missing? is this ready to review?

@dave-b-b
Copy link
Author

@jjspace Yes, I could not get the tests to pass on #12207, so I started over. You can delete that pull request because I redid everything here.
I had two tests fail:
✗ renders a point
✗ renders pnts with point size style

They weren't passing on my machine. I'm almost done with this pull request. I'm trying to finish everything right now.

- I've finished making all the changes, but a few tests are failing:
@dave-b-b
Copy link
Author

@jjspace I finished and submitted the final pull request, but I'm not sure whether I should rebase/merge.

A few of the tests are failing, so I must have messed something up. Can you help with this?

  1. destroys resources after pixel datatype changes
    Renderer/FramebufferManager

  2. destroys resources after pixel format changes
    Renderer/FramebufferManager

  3. BalloonStyle: creates table from ExtendedData
    DataSources/KmlDataSource

  4. Parse Camera and LookAt on features
    DataSources/KmlDataSource

  5. recreates resources when HDR changes
    Scene/GlobeTranslucencyFramebuffer

  6. white
    Scene/PostProcessStageCollection HDR tonemapping Reinhard

  7. red
    Scene/PostProcessStageCollection HDR tonemapping Reinhard

  8. green
    Scene/PostProcessStageCollection HDR tonemapping Reinhard

  9. blue
    Scene/PostProcessStageCollection HDR tonemapping Reinhard

  10. white
    Scene/PostProcessStageCollection HDR tonemapping Filmic

  11. red
    Scene/PostProcessStageCollection HDR tonemapping Filmic

  12. green
    Scene/PostProcessStageCollection HDR tonemapping Filmic

  13. blue
    Scene/PostProcessStageCollection HDR tonemapping Filmic

  14. white
    Scene/PostProcessStageCollection HDR tonemapping ACES

  15. red
    Scene/PostProcessStageCollection HDR tonemapping ACES

  16. green
    Scene/PostProcessStageCollection HDR tonemapping ACES

  17. blue
    Scene/PostProcessStageCollection HDR tonemapping ACES

  18. white
    Scene/PostProcessStageCollection HDR tonemapping PBR Neutral

  19. grey
    Scene/PostProcessStageCollection HDR tonemapping PBR Neutral

  20. red
    Scene/PostProcessStageCollection HDR tonemapping PBR Neutral

  21. green
    Scene/PostProcessStageCollection HDR tonemapping PBR Neutral

  22. blue
    Scene/PostProcessStageCollection HDR tonemapping PBR Neutral

  23. renders with HDR when available
    Scene/Scene

  24. renders a point
    Scene/Vector3DTilePoints

  25. renders pnts with point size style
    Scene/Model/Model3DTileContent pnts

  26. changing specularEnvironmentMaps works
    Scene/Model/Model imageBasedLighting

- change CesiumMath.toRadians((tilt, 0.0)) to CesiumMath.toRadians(tilt ?? 0.0)
- put the parenthesis in the right place to fix the logic in FramebuggerManager lines 143 - 151
Copy link
Contributor

@jjspace jjspace left a comment

Choose a reason for hiding this comment

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

Did a pass on just the code and spotted a handful of text errors. looks like you might've fixed one already but take a look. I will try and look at the test failures soon if they're still happening.

Comment on lines 2156 to 2158
text += `<tr><th>${
value.displayName ?? key
}</th><td>${(value.value, "")}</td></tr>`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
text += `<tr><th>${
value.displayName ?? key
}</th><td>${(value.value, "")}</td></tr>`;
text += `<tr><th>${
value.displayName ?? key
}</th><td>${value.value ?? ""}</td></tr>`;


tilt = CesiumMath.toRadians(defaultValue(tilt, 0.0));
heading = CesiumMath.toRadians(defaultValue(heading, 0.0));
tilt = CesiumMath.toRadians((tilt, 0.0));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tilt = CesiumMath.toRadians((tilt, 0.0));
tilt = CesiumMath.toRadians(tilt ?? 0.0);

packages/engine/Source/Scene/GltfPipeline/addDefaults.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/addDefaults.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/addDefaults.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/addDefaults.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/addDefaults.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/addDefaults.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/parseGlb.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/GltfPipeline/updateVersion.js Outdated Show resolved Hide resolved
@jjspace jjspace mentioned this pull request Oct 16, 2024
6 tasks
It seems like only the following errors remain - renders a point
- renders pnts with point size style
@dave-b-b dave-b-b changed the title remove defaultValue() remove defaultValue() and create DefaultValue namespace Oct 20, 2024
@dave-b-b
Copy link
Author

@jjspace Everything seems fine except two tests that I can't get to pass.

  • renders a point
  • renders pnts with point size style

@dave-b-b
Copy link
Author

Screenshot 2024-10-21 at 5 53 09 PM

@jjspace Not sure why this test fails in the pipeline, but it passes when I run it on my computer....

@jjspace
Copy link
Contributor

jjspace commented Oct 21, 2024

@dave-b-b that statistics test failure is a known test failure we've been fighting in CI for a little bit. Don't worry about it #11958

- I started over because I could not get the tests to pass
- removed defaultValue() in 'easy' to spot references
- fetched most up to date copy of cesium, so that my pull request wasn't cluttered
- I've finished making all the changes, but a few tests are failing:
- change CesiumMath.toRadians((tilt, 0.0)) to CesiumMath.toRadians(tilt ?? 0.0)
- put the parenthesis in the right place to fix the logic in FramebuggerManager lines 143 - 151
It seems like only the following errors remain - renders a point
- renders pnts with point size style
- updated CHANGES.md
- updated CONTRIBUTORS.md
- removed defaultValue() rom FramebufferManager.js
- commented out tests for defaultValueSpec.js
@dave-b-b
Copy link
Author

@jjspace I think this is done now. I add something to the change log under 2024-12-01

@dave-b-b
Copy link
Author

@jjspace Should I update the branch? I don't know what I should do. We already discussed the one test that is failing.

Copy link
Contributor

@jjspace jjspace left a comment

Choose a reason for hiding this comment

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

@dave-b-b this is looking good. All the tests are passing now and I didn't spot any other weird instances of missing parens or formatting issues. Just had a couple small comments.

It looks like there might have been a bad merge somewhere. It's considering all the #11953 changes and one or two other PR's changes as being part of this PR. Could you take a look at the git history and see what might've happened.

On top of that since this is such a wide reaching change we'll probably want to tag a commit before and after this change to make it easier to merge into other PRs. Similar to what we did for the recent prettier changes. I can help create the tags but we should figure out the other git issue first

expect(defaultValue(1, 5)).toEqual(1);
});
});
// import { defaultValue } from "../../index.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably be deleted completely right?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah This can be deleted.

Comment on lines +5 to +7
##### Deprecated :hourglass_flowing_sand:

- defaultValue() has been deprecated. All uses have been changed to the nullish coalescing operator (??)
Copy link
Contributor

Choose a reason for hiding this comment

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

This can go under the 1.123 release since that will be the next one (and I expect we should be able to get this in by then)

Choose a reason for hiding this comment

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

@jjspace Is the play to stick with the nullish coalescing operator, or deprecating defaultValue and create DefaultValue? Based on #12238, I understood it is the latter. If that is the case, would it make more sense to first create DefaultValue and then replace defaultValue with DefaultValue in the codebase? I saw Dave mention he may need to redo the majority of the PR, so it may be easier to directly replace defaultValue with DefaultValue. Rather than replace defaultValue with ?? to then replace it with DefaultValue. If I misunderstood anything, could you provide some guidance?

@dave-b-b
Copy link
Author

@jjspace I didn't realize that rebasing would bring in changes from other pull requests. The only way for me to undo this would be to redo the vast majority of the pull request. Can you help me figure this out?

@dave-b-b
Copy link
Author

dave-b-b commented Dec 3, 2024

Not sure what to do about this one. It looks like the default values have been removed and options have been removed...

image

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