-
Notifications
You must be signed in to change notification settings - Fork 16
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
chore: librarian time check #594
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
20c8a30
chore: librarian time check
manisha1997 0805792
chore: librarian time check
manisha1997 008dc31
chore: librarian time check
manisha1997 d4e080d
chore: librarian time check
manisha1997 a0b96b5
chore: librarian time check
manisha1997 d1fbb8e
chore: librarian time check
manisha1997 3079291
chore: librarian time check
manisha1997 e33f742
chore: librarian time check
manisha1997 c26a19e
chore: librarian time check
manisha1997 d359a72
Merge branch 'main' into librarian-time
manisha1997 2702f39
Merge branch 'main' into librarian-time
manisha1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,18 @@ def generate(spec_folder: str, spec_files: List[str], output_path: str, language | |
if language in generateForLanguages.get(spec_file): | ||
generate_domain_for_language(spec_file, config_path, spec_folder, output_path, language, parent_dir) | ||
else: generate_domain_for_language(spec_file, config_path, spec_folder, output_path, language, parent_dir) | ||
if spec_files[0] in generateForLanguages and language in generateForLanguages.get(spec_files[0]): | ||
print(f'Generating {output_path} from {spec_folder}') | ||
run_openapi_generator(parent_dir, language) | ||
print(f'Code generation completed at {output_path}') | ||
elif spec_files[0] not in generateForLanguages: | ||
print(f'Generating {output_path} from {spec_folder}') | ||
run_openapi_generator(parent_dir, language) | ||
print(f'Code generation completed at {output_path}') | ||
if language in CLEANUP_IMPORT_LANGUAGES: | ||
remove_unused_imports(output_path, language) | ||
if language in REMOVE_DUPLICATE_IMPORT_LANGUAGES: | ||
remove_duplicate_imports(output_path, language) | ||
|
||
def generate_domain_for_language(spec_file: str, config_path: str, spec_folder: str, output_path: str, language: str, parent_dir: str) -> None: | ||
full_path = os.path.join(spec_folder, spec_file) | ||
|
@@ -62,18 +74,17 @@ def generate_domain_for_language(spec_file: str, config_path: str, spec_folder: | |
'arrayItemSuffix': '' | ||
}, | ||
} | ||
|
||
# print(config) | ||
with open(full_config_path, 'w') as f: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. print can be removed. |
||
f.write(json.dumps(config)) | ||
|
||
print(f'Generating {output_path} from {spec_folder}') | ||
run_openapi_generator(parent_dir, language) | ||
print(f'Code generation completed at {output_path}') | ||
|
||
if language in CLEANUP_IMPORT_LANGUAGES: | ||
remove_unused_imports(output_path, language) | ||
if language in REMOVE_DUPLICATE_IMPORT_LANGUAGES: | ||
remove_duplicate_imports(output_path, language) | ||
# print(f'Generating {output_path} from {spec_folder}') | ||
# run_openapi_generator(parent_dir, language) | ||
# print(f'Code generation completed at {output_path}') | ||
# if language in CLEANUP_IMPORT_LANGUAGES: | ||
# remove_unused_imports(output_path, language) | ||
# if language in REMOVE_DUPLICATE_IMPORT_LANGUAGES: | ||
# remove_duplicate_imports(output_path, language) | ||
|
||
def run_openapi_generator(parent_dir: Path, language: str) -> None: | ||
properties = '-DapiTests=false' | ||
|
Oops, something went wrong.
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.
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.
try to create a different PR which has less commits. This PR has 9 commits.
Changes looks good, I have tested code is getting generated within 20 seconds.
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.
It takes 20 seconds because we are passing directory, If file is passed it takes more time.
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.
Get approval from @AsabuHere as well.