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

Dependencies without tags #893

Merged
merged 6 commits into from
May 15, 2023
Merged

Dependencies without tags #893

merged 6 commits into from
May 15, 2023

Conversation

TylerAldrich
Copy link
Contributor

@TylerAldrich TylerAldrich commented Apr 14, 2023

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 😬.

Comment on lines +26 to +27
} else if (typeof arg === 'object' && 'type' in arg && 'pattern' in arg) {
anyOf.push(arg);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was needed to specifically support this -

AnyOf({
  type: 'string',
  pattern: Slugs.ComponentTagValidator.source,
}, DependencySpec)

Currently you can only AnyOf any string/object/etc, but not a string with a specific pattern, which this now fixes

@TylerAldrich TylerAldrich marked this pull request as ready for review April 17, 2023 14:42
…rything to DependencySpec so no string handling is needed

Update tests to validate dependency string tags are converted to objects
@TylerAldrich TylerAldrich requested a review from tjhiggins April 18, 2023 17:45
…Config object, add tests to validate that works properly, and undo changes that modify the spec so that all dependencies are DependencySpec

This reverts commit db66b8f.
@tjhiggins tjhiggins merged commit 015a3a9 into rc May 15, 2023
@tjhiggins tjhiggins deleted the 439-dependency-without-tag branch May 15, 2023 15:32
github-actions bot pushed a commit that referenced this pull request May 15, 2023
# [1.40.0-rc.8](v1.40.0-rc.7...v1.40.0-rc.8) (2023-05-15)

### Bug Fixes

* **ports:** Use a list of restricted ports instead of allowing ports ([121d0b8](121d0b8))

### Features

* **spec:** Dependencies without tags ([#893](#893)) ([015a3a9](015a3a9))
github-actions bot pushed a commit that referenced this pull request Jun 5, 2023
# [1.41.0-rc.1](v1.40.0...v1.41.0-rc.1) (2023-06-05)

### Bug Fixes

* **base:** Make sure telemetry does not interfere with CLI ([#913](#913)) ([b92cc8e](b92cc8e))
* **ports:** Use a list of restricted ports instead of allowing ports ([121d0b8](121d0b8))
* **warning:** Add a warning for livenessprobe to let users know that path and port will be deprecated soon ([8bb5dc4](8bb5dc4))

### Features

* **environment:** Add --flag=zero-trust to env:create ([#906](#906)) ([f3ef7b9](f3ef7b9))
* **spec:** Dependencies without tags ([#893](#893)) ([015a3a9](015a3a9))
github-actions bot pushed a commit that referenced this pull request Jun 5, 2023
# [1.41.0](v1.40.0...v1.41.0) (2023-06-05)

### Bug Fixes

* **base:** Make sure telemetry does not interfere with CLI ([#913](#913)) ([b92cc8e](b92cc8e))
* **ports:** Use a list of restricted ports instead of allowing ports ([121d0b8](121d0b8))
* **warning:** Add a warning for livenessprobe to let users know that path and port will be deprecated soon ([8bb5dc4](8bb5dc4))

### Features

* **environment:** Add --flag=zero-trust to env:create ([#906](#906)) ([f3ef7b9](f3ef7b9))
* **spec:** Dependencies without tags ([#893](#893)) ([015a3a9](015a3a9))
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

🎉 This PR is included in version 1.41.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants