Skip to content
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: use template excludes in generation config #2453

Merged
merged 7 commits into from
Feb 9, 2024

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented Feb 8, 2024

In this PR:

  • Modify generate_prerequisite_files to render owlbot.py using template excludes from GenerationConfig, rather than hard code the excludes.
  • Add unit tests to verify from_yaml method.

@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Feb 8, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Feb 9, 2024
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 9, 2024
@JoeWang1127 JoeWang1127 marked this pull request as ready for review February 9, 2024 01:49
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner February 9, 2024 01:49
@JoeWang1127 JoeWang1127 added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 9, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 9, 2024
Copy link
Contributor

@diegomarquezp diegomarquezp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@@ -54,8 +54,8 @@ def generate_composed_library(
:param library_path: the path to which the generated file goes
:param library: a LibraryConfig object contained inside config, passed here
for convenience and to prevent all libraries to be processed
:param output_folder:
:param versions_file:
:param output_folder: the folder to where tools go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later, we should consider renaming this folder because it is not where we create the resulting library/repo (which is the actual output of the script (?))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, the name is a bit of confusing.

Do you have a better name in mind?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although anything created by the script is output, in a functional perspective the output we care about is the one we have a final use for. Just clarifying this rationale because "anything is output" can be valid too (and this is more of a suggestion in the end).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll keep it as-is for now (I need sometime to think of a better name).

We can come up with a new name later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, the name is a bit of confusing.

Do you have a better name in mind?

I find it slightly tough to answer. What about workspace?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this sounds good.

@@ -104,6 +105,97 @@ def test_eprint_valid_input_succeeds(self):
# print() appends a `\n` each time it's called
self.assertEqual(test_input + "\n", result)

# parameterized tests need to run from the class, see
# https://github.com/wolever/parameterized/issues/37 for more info.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# https://github.com/wolever/parameterized/issues/37 for more info.
# https://github.com/wolever/parameterized/issues/37 for more info.
# This test confirms that a ValueError with an error message about a missing key (specified in the first parameter of each `parameterized` tuple) when parsing a test configuartion yaml (second parameter) will be raised.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link

sonarqubecloud bot commented Feb 9, 2024

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarqubecloud bot commented Feb 9, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JoeWang1127 JoeWang1127 merged commit ed21464 into main Feb 9, 2024
28 of 30 checks passed
@JoeWang1127 JoeWang1127 deleted the chore/use-excludes-from-config branch February 9, 2024 15:58
ddixit14 pushed a commit that referenced this pull request Feb 15, 2024
In this PR:
- Modify `generate_prerequisite_files` to render `owlbot.py` using
template excludes from `GenerationConfig`, rather than hard code the
excludes.
- Add unit tests to verify `from_yaml` method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants