Feat(expressions): read another component with $(component.<name>) (15/21)

Merged
BR
16d ago
+1673-63

Stack 15/21 · after #966 · next #968 · uses KubeVela kubevela/kubevela#7423 at runtime

Targets main but builds on #966, so the earlier stack commits show here too: review the last commit only. Merge after #966.

Description of your changes

The expression editor knows component.<name>: it's in the environment, checked, and completed, typed from the definitions' output schemas, with one-click fixes.

$(component.db.output.data.host)            typed from db's definition
$(component["my-db"].output.metadata.name)  hyphenated names, by index

The API refuses a property expression that doesn't check, and the form blocks the save and says why.

15-completion

Fixes #

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run yarn lint to ensure the frontend changes are ready for review.
  • Run make reviewableto ensure the server changes are ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

Special notes for your reviewer

  • Types come from the output schemas KubeVela stores (kubevela/kubevela#7423); without them reads are typed as any and still work.