Uh oh!
There was an error while loading. Please reload this page.
feat: Automatically populate uuid4 fields - #1985
Conversation
7f93c76 to
03cc1e1Compare247c62b to
66c4309Compare497f954 to
c2feb1aComparec2feb1a to
68a79a5CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
parthea
commented
Mar 21, 2024
This is already being done since we're running tests against gapic-generator-python/noxfile.py Line 197 in 24a23a1 On an unrelated note, I've opened PR #1991 to add showcase to the |
@vchudnov-g Please could you take a look? |
| {% if method_settings is not none %} | ||
| {% for auto_populated_field in method_settings.auto_populated_fields %} | ||
| # Ensure that the uuid4 field is set according to AIP 4235 | ||
| assert re.match(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].{{ auto_populated_field }}) |
There was a problem hiding this comment.
We have this check in multiple places, so I suggest having this in a macro. Even if we have to have duplicate macros for the ads vs non-ads templates (we can define the Ads macro in this file, IIUC)
| {% if method_settings is not none %} | ||
| {% for auto_populated_field in method_settings.auto_populated_fields %} | ||
| # Ensure that the uuid4 field is set according to AIP 4235 | ||
| assert re.match(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].{{ auto_populated_field }}) |
There was a problem hiding this comment.
Ditto previous comment: We have this check in multiple places, so I suggest having this in a macro.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Adds support for automatically populating uuid fields as per https://google.aip.dev/client-libraries/4235
Towards b/322910372