-
Notifications
You must be signed in to change notification settings - Fork 609
Add test command to verify version collisions do not occur #2272
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
Add test command to verify version collisions do not occur #2272
Conversation
| else: | ||
| raise RuntimeError("Unreachable code") | ||
|
|
||
| if 'previous' in lock_from_file: |
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.
While this code worked, the flaw was that it relied on the root (current) version as a comparison. This meant that when the root version incremented, it would quietly allow previous entries to creep as well.
L290-295 instead use the newly pinned max_allowable_version to keep a static check
| @dev_group.command('test-version-lock') | ||
| @click.argument('branches', nargs=-1, required=True) | ||
| @click.option('--remote', '-r', default='origin', help='Override the remote from "origin"') | ||
| def test_version_lock(branches: tuple, remote: str): |
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.
We potentially could run this in all unit tests where a rule file is changed to be really thorough, but I think for now we should leave it as a manual command
|
While running the new So when it eventually gets to the root version, it detects that a previous entry is higher (as expected). So the 2 things to figure out:
Again, these bugs are separate from this PR, but before merging, we should investigate a bit more to fully understand the resolution, since this modifies the version.lock (with the maxes) |
|
Checked out 7.16 and ran the Outlier chosen: The issue appears to stem from having multiple forked rules and route C specifically on line 281. info_from_rule - The latest forked content, 8.3 and version 100 If these do not match, as expected, it will set the 7.16 forked entry to the 8.3 entry and update that rule version as well. We do have a TODO note in here to determine supporting old locked versions so maybe this is the right time to discuss and update this route. I am not sure why these 17 specific rules are hitting this bug as every rule should have a previous 7.16 forked entry and forked again at 8.3 as they don't have rule content changes based on the SHA256 hash. This may also point to the bug as well, for some reason when |
|
unnecessary bump resolution. Still need to fix the massive version jump for legitimate cases though. |
Mikaayenson
left 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.
LGTM for this split merge
There was just misalignment between the rule min stack and corresponding lock. Fix normalizes them to be major.minor to match |
…ection-rules into version-collision-test
* Add test command to verify version collisions do not occur * add max_allowable_version to schema and lock flow * add max_allowable_version to all entries in version.lock * add test-version-lock command * use min supported stack if > locked min stack * share lock conversion code with rule and lock to fix M.m bug (cherry picked from commit 2ee5a18)
* Add test command to verify version collisions do not occur * add max_allowable_version to schema and lock flow * add max_allowable_version to all entries in version.lock * add test-version-lock command * use min supported stack if > locked min stack * share lock conversion code with rule and lock to fix M.m bug (cherry picked from commit 2ee5a18)
* Add test command to verify version collisions do not occur * add max_allowable_version to schema and lock flow * add max_allowable_version to all entries in version.lock * add test-version-lock command * use min supported stack if > locked min stack * share lock conversion code with rule and lock to fix M.m bug (cherry picked from commit 2ee5a18)
* Add test command to verify version collisions do not occur * add max_allowable_version to schema and lock flow * add max_allowable_version to all entries in version.lock * add test-version-lock command * use min supported stack if > locked min stack * share lock conversion code with rule and lock to fix M.m bug (cherry picked from commit 2ee5a18)
* Add test command to verify version collisions do not occur * add max_allowable_version to schema and lock flow * add max_allowable_version to all entries in version.lock * add test-version-lock command * use min supported stack if > locked min stack * share lock conversion code with rule and lock to fix M.m bug (cherry picked from commit 2ee5a18)
* Add test command to verify version collisions do not occur * add max_allowable_version to schema and lock flow * add max_allowable_version to all entries in version.lock * add test-version-lock command * use min supported stack if > locked min stack * share lock conversion code with rule and lock to fix M.m bug (cherry picked from commit 2ee5a18)
Issues
related to #2251
Summary
If a forked rule (a rule that was previously locked and a subsequent
min_stack_versionwas added - this can be tracked by any rule with apreviousentry in the lock file) gets changes, there are no checks to ensure that the change will result in a version collision with a future state of the rule.This adds a command to check for version space, which will be executed in the incrementally in the
lock-multiple.shscript as part of the lock-versions workflow.