Skip to content

Europa: Consistency #1236

Closed
Closed

Description

@talentedmrjones

Plan Spec

Plan spec currently contains a mix of singular and plural:

#Plan: {
	// Receive inputs from the client
	input: {
		// Receive directories
		directories: [string]: _#inputDirectory
		// Securely receive secrets
		secrets: [string]: _#inputSecret
	}

	// Forward network services to and from the client
	proxy: [string]: _#proxyEndpoint

	// Execute actions in containers
	actions: {
		...
	}
}

Notice that input is singular while directories is plural and proxy is singular while actions is plural. This is inconsistent.

I propose that all collections be plural, and all singluar items be singular:

#Plan: {
	// Receive inputs from the client
	inputs: {
		// Receive directories
		directories: [string]: _#inputDirectory
		// Securely receive secrets
		secrets: [string]: _#inputSecret
	}

	// Forward network services to and from the client
	proxies: [string]: _#proxyEndpoint

	// Execute actions in containers
	actions: {
		...
	}
}

Types and Tasks

There is also inconsistency among values of common keys:

#ReadFile: {
    _type: "ReadFile"

    input:    #FS
    path:     string
    contents: string
    output:   #FS
}

Notice that contents here is a string and output contains the #FS while other structs (like input.directories provide contents as an #FS and no output

I propose that the same key always be the same value: contents OR output is always #FS and when a string type is provided it is made available through another key like text

Activity

  1. added this to the milestone on Dec 16, 2021
  2. shykes commented on Dec 17, 2021

    @shykes
    Contributor
    • inputs: ✅ I was indifferent (kind of like that input.directories sounded like “input directories”). But since this solves our shadowing problem, let’s do it.
    • outputs ✅ Same as inputs.
    • proxies ❌ There is only one proxy, configured by this field. Alternatives like proxyServices, services, endpoints, proxyEndpoints are nominally more consistent, but IMO not as good as proxy.
  3. talentedmrjones commented on Dec 17, 2021

    @talentedmrjones
    Author

    As the spec is now proxy: [string]: _#proxyEndpoint allows multiple. Do you intend for it to be the following instead?

    proxy: [string]: _#proxyEndpoint & struct.MaxFields(1)

  4. shykes commented on Dec 17, 2021

    @shykes
    Contributor

    As the spec is now proxy: [string]: _#proxyEndpoint allows multiple. Do you intend for it to be the following instead?

    proxy: [string]: _#proxyEndpoint & struct.MaxFields(1)

    There is one proxy, which can be configured with multiple endpoints. To be more explicit, this could be:

    proxy: endpoints: [string]: _#proxyEndpoint
    

    I had initially skipped the endpoints field to keep paths shorter.

  5. samalba commented on Dec 21, 2021

    @samalba
    Contributor

    Adding some more consistencies issues to address:

  6. shykes commented on Jan 3, 2022

    @shykes
    Contributor

    This is on purpose, because build is not meant to be chained to parent instructions, which is what the input convention is for. It’s more like #GitPull, #ImagePull, #Scratch: always the first in the pipeline.

  7. shykes commented on Jan 3, 2022

    @shykes
    Contributor

    Closing this in favor of more specific issues.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions