Skip to content

Update project schema to use new API #3259

Closed

Description

@sipsma

Expanding this comment out to its own issue: #3016 (comment)

Project loading + building has it's own schema:

func (s *projectSchema) Schema() string {
return `
"A set of scripts and/or extensions"
type Project {
"name of the project"
name: String!
"schema provided by the project"
schema: String
"extensions in this project"
extensions: [Extension!]
"scripts in this project"
scripts: [Script!]
"other projects with schema this project depends on"
dependencies: [Project!]
"install the project's schema"
install: Boolean!
"Code files generated by the SDKs in the project"
generatedCode: Filesystem!
}
"A schema extension provided by a project"
type Extension {
"path to the extension's code within the project's filesystem"
path: String!
"schema contributed to the project by this extension"
schema: String!
"sdk used to generate code for and/or execute this extension"
sdk: String!
}
"An executable script that uses the project's dependencies and/or extensions"
type Script {
"path to the script's code within the project's filesystem"
path: String!
"sdk used to generate code for and/or execute this script"
sdk: String!
}
extend type Filesystem {
"load a project's metadata"
loadProject(configPath: String!): Project!
}
extend type Core {
"Look up a project by name"
project(name: String!): Project!
}
`
}

It is only used internally (not meant to be used by users directly yet) but it nonetheless needs to be integrated with the new API (i.e. Directory/Container/etc.). At minimum, this is needed so we can delete the old Filesystem code, but it will also be good to rethink the design at this time too.

Activity

  1. self-assigned this
    on Oct 4, 2022
  2. added this to the Cloak preview milestone on Oct 4, 2022
  3. sipsma commented on Oct 5, 2022

    @sipsma
    ContributorAuthor

    This may actually just be a matter of removing this from the "public" schema and only supporting this internally, with dagger.gql contents provided as a header. We may still model this as an API if convenient but it should not be exposed directly to users.

  4. sipsma commented on Oct 5, 2022

    @sipsma
    ContributorAuthor

    Also, note to self, be sure to try not to break the existing mechanism for all this if feasible and if cloud work relies on any of it.

  5. vito commented on Oct 12, 2022

    @vito
    Contributor

    Update: the project schema has been updated, slightly, via the above PR - but it still uses LLB directly and returns a *core.Directory. It should instead return a *core.Container, so this issue is still valid. Some context here: #3304 (comment)

  6. added
    area/engine
    and removed on Dec 5, 2022
  7. sipsma commented on Dec 6, 2022

    @sipsma
    ContributorAuthor

    I think updating the schema to not use Filesystem is good enough for this issue. Any future changes to the internal code can be tracked separately. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/engine

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions