Conversation
16 failing tests:
|
dfc22cd to
948cf8b
Compare
libs/structaccess/typecheck.go
Outdated
| // Fields marked readonly/internal are considered inaccessible. | ||
| btag := structtag.BundleTag(sf.Tag.Get("bundle")) | ||
| if btag.Internal() || btag.ReadOnly() { | ||
| return fmt.Errorf("%s: field %q not found in %s", newPrefix, c.Key(), owner.String()) |
There was a problem hiding this comment.
Shall we be more specific here and say that we're trying to access internal field?
There was a problem hiding this comment.
It's a good idea. However, this code is actually unused -- bundle tags filtered out earlier, so I remove this here: 7131d9c
The reason earlier code filters it out and not doing hard error is because we might still have success later with non-internal field.
libs/structaccess/typecheck.go
Outdated
| // Fields marked readonly/internal are considered inaccessible. | ||
| btag := structtag.BundleTag(sf.Tag.Get("bundle")) | ||
| if btag.Internal() || btag.ReadOnly() { | ||
| return fmt.Errorf("%s: field %q not found in %s", newPrefix, c.Key(), owner.String()) |
There was a problem hiding this comment.
Also, why can't we use ReadOnly?
There was a problem hiding this comment.
Currently it is only used for "id" which is handled separately.
| @@ -0,0 +1,8 @@ | |||
| resources: | |||
There was a problem hiding this comment.
It looks like TF fails to deploy with all of ingestion_definition,ingestion_definition.0.objects must be specified but direct is not, why is that? and is it intended? TF error looks valid though
There was a problem hiding this comment.
This is a validation that TF does. In direct we don't do any validations (but important ones we should add to initialize phase). I added objects so that it passes TF validation -- 2274f77
Changes
Why
I'm going to add lookups in remote state. Remote state is optional / needs a request to backend. Type checking the path allows checking if reference is valid for remote state without actually having the state.
Tests
New acceptance test to show value-based non-existent field.
More non-regression test that cover different types of access and show inconsistencies between terraform and direct.