Skip to content

Support intellisense for new file types #47

@carolynvs

Description

@carolynvs

In Porter v1, we introduced some new files that people will be editing by hand and it would be great if VS Code would autocomplete these documents when the Porter extension is installed.

  • credential set
  • parameter set
  • installation
  • plugins (the file argument passed to porter plugins install -f plugins.yaml)

Here is an example of what they look like and they are documented at https://getporter.org/reference/file-formats/ with links to the corresponding json schema files.

Credential Set

schemaType: CredentialSet
schemaVersion: 1.0.0
namespace: demo
name: whalegap
credentials:
  - name: kubeconfig
    source:
      path: /Users/carolynvs/.kube/config

Parameter Set

schemaType: ParameterSet
schemaVersion: 1.0.0
namespace: demo
name: hello-llama
parameters:
  - name: name
    source:
      env: USER

Installation

schemaType: Installation
schemaVersion: 1.0.0
name: demo
namespace: demo
bundleRepository: carolynvs/tabbycat-demo
bundleVersion: 0.2.1

Plugins

schemaType: Plugins
schemaVersion: 1.0.0
plugins:
  helm3:
    version: v1.0.1
    url: https://github.com/MChorfa/porter-helm3/releases/download

Seems like before porter releases we should tweak the schemaVersion field to indicate which file it is, e.g. schemaVersion: "credential-set-1.0.0", so that VS code can detect the type of file? Or do you recommend another way, like a separate field like kind: credential-set`? Porter now adds a schemaType field so that we can detect the file type. So if a file is yaml, and it contains a known schemaType, then we should apply the corresponding json schema so that the user gets autocomplete.

Since the schema for these is fixed (unlike porter.yaml which is generated directly by porter on demand), I was thinking that the extension could download the schema from a well-known url, e.g. https://getporter.org/schema/VERSION/FILE_TYPE.json. So the installation schema from https://raw.githubusercontent.com/getporter/porter/release/v1/pkg/schema/installation.schema.json (this isn't the URL we want to use in the extension) would be available at https://getporter.org/schema/v1/installation.schema.json (this is the URL to use in the extension, so that we can improve or fix it later as needed using URL redirects).

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions