✨ Fix few issues with hack/new-schema-version script#1528
Open
bryanv wants to merge 2 commits intovmware-tanzu:mainfrom
Open
✨ Fix few issues with hack/new-schema-version script#1528bryanv wants to merge 2 commits intovmware-tanzu:mainfrom
bryanv wants to merge 2 commits intovmware-tanzu:mainfrom
Conversation
For types that were just added in the current Hub() version, the new schema script wouldn't generate the conversion for them. That impacted: VirtualMachineGroupPublishReques VirtualMachineClassInstance VirtualMachineSnapshot
The prior Hub() version should get fuzz tests defined with the version bump
f866f4a to
fc58288
Compare
Minimum allowed line rate is |
Collaborator
|
I am not sure if it is an error from your changes or not, but the following command fails: $ hack/new-schema-version.py --dry-run v1alpha7
[DRY RUN] Would create new API schema version v1alpha7 from v1alpha6...
[1/24] Copying api/v1alpha6 to api/v1alpha7... [OK]
[2/24] Demoting api/v1alpha6 from hub to spoke... [OK]
[3/24] Removing storage version from api/v1alpha6... [OK]
[4/24] Adding localSchemeBuilder to api/v1alpha6... [OK]
[5/24] Updating api/apis.go... [OK]
[6/24] Updating doc.go conversion-gen targets... [OK]
[7/24] Creating api/v1alpha6 conversion subdirs... [OK]
[8/24] Updating Makefile... [OK]
[9/24] Creating webhooks/conversion/v1alpha7... [OK]
[10/24] Updating older API versions to reference v1alpha7... [OK]
[11/24] Updating webhook schema version to v1alpha7... [OK]
[12/24] Updating imports to api/v1alpha7... [OK]
[13/24] Updating unit and integration tests... [OK]
[14/24] Updating .golangci.yml importas for new hub... [OK]
[15/24] Updating api/v1alpha6 to use versioned import aliases... [OK]
[16/24] Creating api/test/v1alpha6 conversion tests... [OK]
[17/24] Adding v1alpha7 template constants to pkg/providers/vsphere/constants... [OK]
[18/24] Demoting hub in bootstrap_templatedata and adding v1alpha7 hub... [OK]
[19/24] Running make generate... [DRY RUN] Would run: make generate
[20/24] Running make generate-go-conversions... [DRY RUN] Would run: make generate-go-conversions
[21/24] Running make manager-only... [DRY RUN] Would run: make manager-only
[22/24] Running make lint-go-full... [DRY RUN] Would run: make lint-go-full
[23/24] Running make generate-api-docs... [DRY RUN] Would run: make generate-api-docs
[24/24] Updating docs... [FAIL]
❌ Failed!
To revert the changes, run:
git reset --hard HEAD && git clean -fd
Traceback (most recent call last):
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 2320, in <module>
sys.exit(main())
~~~~^^
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 2305, in main
migration.run()
~~~~~~~~~~~~~^^
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 598, in run
raise exc_holder[0]
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 579, in run_step
step_func()
~~~~~~~~~^^
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 2058, in step_update_docs
self.ops.replace_in_file(new_ref, old_ver, new_ver)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 153, in replace_in_file
content = self.read_file(path)
File "/Users/akutz/Projects/vmop/new-schema-script/hack/new-schema-version.py", line 147, in read_file
return path.read_text()
~~~~~~~~~~~~~~^^
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pathlib/__init__.py", line 787, in read_text
with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pathlib/__init__.py", line 771, in open
return io.open(self, mode, buffering, encoding, errors, newline)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/akutz/Projects/vmop/new-schema-script/docs/ref/api/v1alpha7.md'
It fails on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do, and why is it needed?
For resources that were first added in the prior hub version, the script wouldn't generate needed conversion for them in the new hub version. This impacted VirtualMachineClassInstance, VirtualMachineGroupPublishRequest, VirtualMachineSnapshot.
Add the fuzzing tests in api/tests for the prior hub version
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: