Skip to content

Ecosystem implementation #3683

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

Closed
wants to merge 4 commits into from
Closed

Ecosystem implementation #3683

wants to merge 4 commits into from

Conversation

Naatan
Copy link
Member

@Naatan Naatan commented Jul 11, 2025

StoryCP-933 Introduce ecosystem mechanic into State Tool

  • This PR omits implementation of Remove() and Untrack() function, which is to be done in CP-956.
  • The artifact install and uninstall routines are very enmeshed in the depot and lifting them out and into setup.go would be a pretty significant refactor, so I have those features call Track() and Untrack() as necessary.
  • The ecosystem Add() and Remove() functions do not call the depot's existing artifact install and uninstall routines, just Track() and Untrack().

The depot does not actually contain buildplan artifact structs, so we can only use IDs.
@@ -90,7 +91,7 @@ type setup struct {
toInstall buildplan.ArtifactIDMap

// toUninstall encompasses all artifacts that will need to be uninstalled for this runtime.
toUninstall map[strfmt.UUID]struct{}
toUninstall map[strfmt.UUID]bool
Copy link
Contributor

@mitchell-as mitchell-as Jul 15, 2025

Choose a reason for hiding this comment

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

The depot does not have enough information to construct a buildplan.Artifact object. The depot only tracks artifact IDs, and we infer what artifacts to uninstall by IDs that do not exist in the incoming buildplan. I am changing from struct{} to bool to better reflect this for now, as it was a source of confusion.

CP-956, which is to implement Remove() and Untrack() should hopefully figure out how best to accomplish what we want.

@@ -269,11 +281,18 @@ func (s *setup) update() error {
}
}

// Tell applicable ecosystems to perform any final uninstall actions.
Copy link
Contributor

@mitchell-as mitchell-as Jul 15, 2025

Choose a reason for hiding this comment

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

I'm not convinced we can have Apply() do both uninstall and install at the same time, so I'm calling Apply() here after all of the Remove() calls, and then again later in this file after all of the Add() calls.

Feel free to correct me on this.


// TODO: CP-956
//if ecosys := filterEcosystemMatchingArtifact(artifact, s.ecosystems); ecosys != nil {
// err := ecosys.Remove(artifact)
Copy link
Contributor

Choose a reason for hiding this comment

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

The depot does not have enough information to construct an artifact (buildplan.Artifact), so CP-956 will have to figure out what approach to take when re-enabling this block of code.

@Naatan
Copy link
Member Author

Naatan commented Jul 15, 2025

@mitchell-as could you open a new PR? I'll close this one. Since I opened it I can't properly review it.

@Naatan Naatan closed this Jul 15, 2025
@mitchell-as
Copy link
Contributor

@Naatan done.

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

Successfully merging this pull request may close these issues.

2 participants