types.reference: calculate reference field name correctly#48
Merged
muvaf merged 1 commit intocrossplane:mainfrom Jul 29, 2022
muvaf:ref-name-calc
Merged
types.reference: calculate reference field name correctly#48muvaf merged 1 commit intocrossplane:mainfrom muvaf:ref-name-calc
muvaf merged 1 commit intocrossplane:mainfrom
muvaf:ref-name-calc
Conversation
…t that originally has snake case so that calculation is correct for cases where there are multiple acronyms one after the other Signed-off-by: Muvaffak Onus <me@muvaf.com>
3 tasks
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.
Description of your changes
This is currently blocking https://github.com/upbound/official-providers/pull/457 to go through.
Fixes #45
I have:
make reviewableto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
In https://github.com/upbound/official-providers/pull/457 , I've confirmed that the ref tags are produced as
apiIdRefinstead ofapiidRef.However, there is another change in some resources in AWS. In cases we give custom ref and selector field names, like

VpcSecurityGroupIdRefsso that it doesn't end up beingVpcSecurityGroupIdsRefs, we run into errors since with the new calculation we always default to using.Camelproperty of the name, which is in line with the CRD type builder but those custom overrides are given as camel computed, i.e. given asVpcSecurityGroupIdRefsinstead ofVPCSecurityGroupIDRefs. What we end up with without this change is the following:With this change we produce the fields with
.Camelbut then the reference comments don't match. So, we should either opt for.CamelComputedfor all fields or change the custom overrides and I'm leaning towards the latter. Azure and GCP are not affected since apparently they haven't overridden any ref or selector fields.