-
Notifications
You must be signed in to change notification settings - Fork 138
direct: Generate resources config based on OpenAPI field behaviours #4391
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
Open
denik
wants to merge
12
commits into
main
Choose a base branch
from
denik/openapi-gen-direct
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+572
−66
Conversation
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
add api.yml update update update simplify simplify simlify find matching types Add generate_apitypes.py tool and apitypes.yml output Add a Python script that finds matching OpenAPI schema types for each resource by comparing field names with weighted scoring. The script outputs apitypes.yml with the best matching type for each resource. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> clean up; use apitypes.generated.yml Refactor direct resource generators to use argparse and stdout - Move gen_resources_api.py to tools/generate_resources_api.py - Update both generators to take apischema and out.fields.txt as args - Output YAML to stdout, logging to stderr - Update Makefile targets: generate-direct-apitypes, generate-direct-resources - Generated files go to build/direct/dresources/*.generated.yml - Remove old resources_api.yml (now generated) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Output generated files to bundle/direct/dresources/, add clean target - Change output path from build/ to bundle/direct/dresources/ - Add generate-direct-clean target to remove generated YAML files - Add resources.generated.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Rename generate_resources_api.py to generate_resources.py - Read resource types from apitypes.generated.yml instead of out.fields.txt - Still filter fields by STATE/ALL from out.fields.txt - Update Makefile with new script name and dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> clean uop clean up
987d99a to
9ac8452
Compare
Collaborator
|
Commit: a77ddb6
20 interesting tests: 9 KNOWN, 5 SKIP, 4 RECOVERED, 2 flaky
Top 50 slowest tests (at least 2 minutes):
|
8114df2 to
b099cb5
Compare
…-string map. Updated both the generator (generate_apitypes.py) and consumer (generate_resources.py) to use a simpler YAML format where each resource maps directly to its type name instead of a single-element list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Changes
Why
This adds a lot of input_only, output_only fields. Many of the fields matching are currently ignored via "server_side_default" reason. This PR allows removing that eventually.
Tests
I removed server_side_default field on main and this branch and compared invariant/no_drift tests results on testserver:
On main:
on this branch:
So it fixes 5 no_drift tests: alerts, database_catalog, app, synced_database_table, database_instance