-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support all latest versions, add even more tests for other issues #79
base: master
Are you sure you want to change the base?
Conversation
Contributed by @Nelonn
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: npm/prismarine-chunk@1.35.0) |
Instead of closing and reopening an identical PR you should instead either do a force push where needed to change history or commits. This prevents the PR from needing to be re-reviewed from scratch. |
"prismarine-chunk": "^1.29.0", | ||
"prismarine-nbt": "^2.0.0", | ||
"prismarine-block": "^1.17.1", | ||
"prismarine-chunk": "github:zardoy/prismarine-chunk", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocked at least by PrismarineJS/prismarine-chunk#240
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocked by addressing comments at PrismarineJS/prismarine-chunk#240
AFAIK, you cannot change the source branch after creating a Pull Request. You have to create a new one instead! |
all comments from the previous pr are resolved, now, I only need to think about what to do with failing tests: should I remove them or disable them somehow for now? |
This reverts commit 5dbeb3b.
You cannot change your branch, but you can change the commits on the branch. If you need to change the commits on the branch and change history git makes it possible to update the history with a force push. If you need to make a new branch locally and push to a remote branch with your PR you do
They are not resolved |
const bitsPerBiome = Math.ceil(Math.log2(biomePalette.length)) | ||
|
||
if (!bitsPerBlock) { | ||
blockStates = nbt.comp({ palette: nbt.list(nbt.comp(blockPalette)) }) | ||
} else { | ||
if (bitsPerBlock === 1 || bitsPerBlock === 2 || bitsPerBlock === 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test was already there, so I added it back:
https://github.com/PrismarineJS/prismarine-provider-anvil/actions/runs/9491519760/job/26157101354?pr=79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. Are you saying tests in the current master branch are failing without this? I don't understand the reasoning behind this change, it doesn't make sense to me because this will definitely have an effect on decoding blocks (as in incorrect block states may be read despite tests seeming to pass).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is in the writing part of the code, not reading, isn't it? And yes tests are failing without this. Reverting this change and tests change will not fix the issue itself , for me saving didn't work most of the time. And it was the simple way to fix the problem . If you have any other suggestions please let me know 🙏
Also i couldn't find anything bad in this so far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely does not seem correct
Yes, the previous source branch is the default branch of my repo and I pushed some experimental unrelated to PR changes for my projects. In theory, I could rename it to something else, create a new branch, and set it as a new default branch with the old name. Sorry, I forgot there is a simple way to rename remote branches.
Can you elaborate? I don't see anything that I made worse.. |
tests are green, I will be waiting for your reply |
|
||
for (const version of testedVersions) { | ||
if (todoVersions.includes(version)) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you skipping versions? Either all versions should be tested or you should revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in the previous PR all versions wasn't tested in the previous version of the code either. I just refactored it make it clear but didn't change the list of tested versions here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is your point that there is missing test data for these versions? If so that should be written explicitly in a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@extremeheat The point of this change is to ensure newly added versions in supported versions are tested without needing to add new versions here (you may forget to do it). This was made for convenience. Could I just rename it to skippedVersions
? Or will it still not be clear?
if (!reChunk.dump().equals(chunk.dump())) { | ||
console.warn('Warning: chunk dump does not match original chunk dump') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the assert here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what was the point of this assertion? Isn't it to okay to have a different buffer if it's valid? And this was failing for half of the versions.
Please don't say I disabled it just to make tests pass, I just really didn't understand the reason of testing it (especially when everything release works fine)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of the test is to ensure re-encoding works! There is no non-determinism in minecraft chunks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, it will work, but again, what is the point of asserting the buffer contents? I don't think it's a good option to compare buffers without context.
eg it fails for previously disabled versions where re-encoding seems to be absolutely fine and the tests above also check it in a clear way.
I'm just trying to understand what is going on here. I want to enable more versions to test here, but this test fails and doesn't make any sense to me. Can you provide an example of the problem it solves?
const todoVersions = ['1.9', '1.10', '1.11', '1.12', '1.15'] | ||
const testedVersions = require('../').supportedVersions | ||
|
||
for (const version of testedVersions) { | ||
if (todoVersions.includes(version)) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as below
|
||
column.x = data.xPos | ||
column.z = data.zPos | ||
column.lastUpdate = data.LastUpdate.valueOf() | ||
column.inhabitedTime = data.InhabitedTime.valueOf() | ||
|
||
for (const section of data.sections) { | ||
if (!section.block_states) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this valid? What's the reasoning behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also to fix saving test for the latest version. If the section doesn't have information what's the point to proceed it?
const bitsPerBiome = Math.ceil(Math.log2(biomePalette.length)) | ||
|
||
if (!bitsPerBlock) { | ||
blockStates = nbt.comp({ palette: nbt.list(nbt.comp(blockPalette)) }) | ||
} else { | ||
if (bitsPerBlock === 1 || bitsPerBlock === 2 || bitsPerBlock === 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. Are you saying tests in the current master branch are failing without this? I don't understand the reasoning behind this change, it doesn't make sense to me because this will definitely have an effect on decoding blocks (as in incorrect block states may be read despite tests seeming to pass).
No, "renaming" the branch will either auto close the PR or move the PR's source branch with it. The only way to fix it is to keep the current remote and push a new history to it. I don't see anything different in this PR to the last one, but I've re-reviewed it. |
I already pointed that I couldn't keep the same remote, it was not because of different history. At least I made tests green in this PR. And yes, not all was tested on master (and I increased the number of tested versions in writeNBT), that's why there are some of the changes to fix them |
until #75 if fixed, it won't be possible to support newer versions |
how is this related? new versions almost don't have any changes and will work with 1.18 implementation fine (just like in p-chunk) |
please address comments or close the PR |
easy to say... |
re opened pr as changed the branch