Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to update backend for already existing TypeInstance #636

Open
Tracked by #604
mszostok opened this issue Feb 15, 2022 · 1 comment
Open
Tracked by #604

Add an option to update backend for already existing TypeInstance #636

mszostok opened this issue Feb 15, 2022 · 1 comment
Labels
area/hub Relates to Hub enhancement New feature or request
Milestone

Comments

@mszostok
Copy link
Member

Description

Make the backend.id mutable. Currently, it's saved on the root of the TypeInstance (same as typeRef) and cannot be changed via GraphQL mutation. This should be change from immutable to become mutable.

We don't need to change mutation GraphQL syntax:

mutation CreateTypeInstances {
  createTypeInstances(
    in: {
     typeInstances: [
      {
        alias: "helm-release"
        typeRef: { path: "cap.type.helm.chart.release", revision: "0.1.0" }
        value: {
          key: "test" # same as it was
        }
        backend: {
          id: "123" # it's like that already.
          context: { # new property of type `Any!`
            name: "release-name",
            namespace: "release-namespace",
          }
        }
      }
    ]
  }
  ) {
    id
    alias
  }
}

but we need to change how it is handled by Local Hub and save it under TypeInstanceRevision.

Acceptance Criteria

  • Update Local Hub mutation to save backend under TypeInstanceRevision.
  • Change query syntax:
    query GetTypeInstance($typeInstanceID: ID!) {
      typeInstance(id: $typeInstanceID) {
        id
        typeRef {
          path
          revision
        }
        backend { # remove this backend entry
          id
          abstract
        }    
        lockedBy
        latestResourceVersion {
            resourceVersion
            createdBy
            metadata {
              attributes {
                path
                revision
              }
            }
            spec {
              value
            }
            backend {
              # id <- new fields
              # abstract <- new fields
              context { # new property of type `Any!`
                name
                namespace
              }
            }
        }
      }
    }
  • Update related documentation and examples.
  • Add integration test coverage that backend can be changed.

Related issues

See epic #604 for reason and use cases.

@mszostok
Copy link
Member Author

If implemented we need to ensure that delegated storage backends will work properly, see discussion in: #644 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hub Relates to Hub enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant