architect-team / architect-cli

Command line interface for running Architect services locally
https://docs.architect.io
37 stars 13 forks source link

Dependencies without tags #893

Closed TylerAldrich closed 1 year ago

TylerAldrich commented 1 year ago

Related API PR that updates dependency tag resolution to support the various cases where a tag isn't specified and the component does/doesn't exist: https://gitlab.com/architect-io/hub-api/-/merge_requests/763

When a tag is specified, no functionality is changed and the current rules still apply - that is, whatever is currently deployed in the environment is used unless a component is specified in the architect deploy command. E.g., if dependency:tag1 is deployed in an environment, and architect deploy component:latest dependency:latest is run, dependency:latest will be deployed and replace the dependency:tag1 component. If architect deploy component:latest is run, the dependency component won't get replaced even if the tag in the architect.yml is changed.

When no tag is specified, similar rules apply - the only addition is that latest is the assumed tag. So, by default, dependency:latest will be deployed into an environment if it's not specified via the command or architect.yml and the dependency component doesn't currently exist in the environment.


The primary change in the CLI is the spec for dependencies now supports an object value as well as a string. So instead of this:

dependencies:
  foo: latest

you can write:

depenencies:
  foo: {}  # <-- empty object, tag is implied to be "latest"

The following is also valid:

dependencies:
  foo: 
    tag: latest

The DependencySpec object was implemented as a class with an optional deprecated tag argument - a completely empty class was causing a lot of issues so I opted to do this instead and defer the issues with an object that must be empty 😬.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.41.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: