-
Notifications
You must be signed in to change notification settings - Fork 14
Initial support for removing dynamically imported artifacts. #3716
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
Changes from 1 commit
84ffb1e
99c5bbb
ae23900
3998736
3e95cab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,7 @@ import ( | |||||
| configMediator "github.com/ActiveState/cli/internal/mediators/config" | ||||||
| "github.com/ActiveState/cli/internal/sliceutils" | ||||||
| "github.com/ActiveState/cli/internal/smartlink" | ||||||
| "github.com/ActiveState/cli/pkg/buildplan" | ||||||
| ) | ||||||
|
|
||||||
| const ( | ||||||
|
|
@@ -52,6 +53,11 @@ type artifactInfo struct { | |||||
| Size int64 `json:"size"` | ||||||
| LastAccessTime int64 `json:"lastAccessTime"` | ||||||
|
|
||||||
| // These fields are used by ecosystems during Add/Remove/Apply. | ||||||
| Namespace string `json:"namespace,omitempty"` | ||||||
| Name string `json:"name,omitempty"` | ||||||
| Version string `json:"version,omitempty"` | ||||||
|
|
||||||
| id strfmt.UUID // for convenience when removing stale artifacts; should NOT have json tag | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -218,7 +224,7 @@ func (d *depot) DeployViaLink(id strfmt.UUID, relativeSrc, absoluteDest string) | |||||
| Path: absoluteDest, | ||||||
| Files: files.RelativePaths(), | ||||||
| RelativeSrc: relativeSrc, | ||||||
| }) | ||||||
| }, nil) | ||||||
| if err != nil { | ||||||
| return errs.Wrap(err, "Could not record artifact use") | ||||||
| } | ||||||
|
|
@@ -275,7 +281,7 @@ func (d *depot) DeployViaCopy(id strfmt.UUID, relativeSrc, absoluteDest string) | |||||
| Path: absoluteDest, | ||||||
| Files: files.RelativePaths(), | ||||||
| RelativeSrc: relativeSrc, | ||||||
| }) | ||||||
| }, nil) | ||||||
| if err != nil { | ||||||
| return errs.Wrap(err, "Could not record artifact use") | ||||||
| } | ||||||
|
|
@@ -286,7 +292,9 @@ func (d *depot) DeployViaCopy(id strfmt.UUID, relativeSrc, absoluteDest string) | |||||
| // Track will record an artifact deployment. | ||||||
| // This is automatically called by `DeployVia*()` functions. | ||||||
| // This should be called for ecosystems that handle installation of artifacts. | ||||||
| func (d *depot) Track(id strfmt.UUID, deploy *deployment) error { | ||||||
| // The artifact parameter is only necessary for tracking dynamically imported artifacts after being | ||||||
| // added by an ecosystem. | ||||||
| func (d *depot) Track(id strfmt.UUID, deploy *deployment, artifact *buildplan.Artifact) error { | ||||||
|
||||||
| func (d *depot) Track(id strfmt.UUID, deploy *deployment, artifact *buildplan.Artifact) error { | |
| func (d *depot) Track(artifact *buildplan.Artifact, deploy *deployment) error { |
Could you try to make this the behaviour? The reason this was using id was to keep it as dumb as possible. Obviously for artifacts that ship has now sailed, I'd prefer we're consistent then in so far as that is possible.
This also means updating the Deploy functions. The real question mark here is going to be the Save() function, which far as I can tell is "abusing" the Track() function in order to clean up the cache. I don't recall specifically what the exact behaviour is there nor can I quickly grok it, but I would suggest spending some time there to try and see if we can remove its reliance on Track(). If this turns into a deep rabbit hole please push back.
Uh oh!
There was an error while loading. Please reload this page.