backstage icon indicating copy to clipboard operation
backstage copied to clipboard

beps(cli): modularization

Open aramissennyeydd opened this issue 1 year ago • 28 comments

Hey, I just made a Pull Request!

👋 , one more BEP to add to my pile 😁 . Following up on conversation in #23818.

This BEP introduces a new initial design for CLI modularization based off of my work in #24488 which proved that some level of reuse of the backend abstractions is viable for a CLI. I also added the idea of profiles to allow for more purpose driven workflows, where a user may not want to install every plugin to their CLI and they instead just want to choose a few plugins for a certain task. That may lead itself to personalization, ie having a development CLI with build, test, start, and another CLI with api [endpoint] [ref], catalog search, pagerduty page [oncall], etc.

I also wanted to design with personalization in mind, once we have a modular CLI, users may want to start using this CLI outside of their Backstage repos. That isn't solved here, but I also think it's important to provide some foundation for that work to build off of when we get there.

cc: @drodil @Rugvip

:heavy_check_mark: Checklist

  • [ ] A changeset describing the change and affected packages. (more info)
  • [ ] Added or updated documentation
  • [ ] Tests for new functionality and regression tests for bug fixes
  • [ ] Screenshots attached (for UI changes)
  • [x] All your commits have a Signed-off-by line in the message. (more info)

aramissennyeydd avatar May 25 '24 17:05 aramissennyeydd

I like this, reminds me a lot of how golang cli's are setup and extended. I am however, gonna pass this review over to @Rugvip for some eyes too :eyes: :pray:

benjdlambert avatar May 27 '24 12:05 benjdlambert

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jun 10 '24 12:06 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jul 08 '24 17:07 github-actions[bot]

@Rugvip I had a similar thought around migration that that might fit into, removed it in the most recent draft but I agree it would be a good place to start. How should I proceed here? Do we want to merge this BEP and start working to understand what modularizing the existing CLI looks like, reduce the scope of this BEP to just modularizing the existing CLI, or start a PRFC/RFC instead?

aramissennyeydd avatar Jul 18 '24 14:07 aramissennyeydd

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Aug 21 '24 13:08 github-actions[bot]

I haven't had a chance to update this since we chatted about this last. A sparse tree approach seems best here, not leveraging the existing new backend infra and instead creating some custom set up instead.

aramissennyeydd avatar Aug 21 '24 13:08 aramissennyeydd

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Sep 04 '24 13:09 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Sep 20 '24 10:09 github-actions[bot]

Going to get an updated version of this out by this weekend 😁

aramissennyeydd avatar Sep 25 '24 01:09 aramissennyeydd

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Oct 16 '24 09:10 github-actions[bot]

@Rugvip Do we want to close this until cycles emerge? I can pick up some work to start modularizing the existing CLI

aramissennyeydd avatar Oct 16 '24 13:10 aramissennyeydd

@aramissennyeydd to be honest I've been doing some experimentation on my side the last few weeks as I'm finding this to be more and more of a high priority for the framework. I think I'm at a point where I have a good enough idea of the kind of communication patterns that we need that I can help drive this forward fairly efficiently. I do think we want to continue with experimentation such as #27213 as the way to move this forward for the time being though.

In fact I wouldn't mind experimenting a bit with the BEP process in the meantime as well as I don't find the provisional -> implementable move to work that well right now. What do you think about keeping this BEP open with comments and changes here while we iterate and tweak the design, and eventually merge it straight into the implementable state?

Rugvip avatar Oct 19 '24 17:10 Rugvip

@Rugvip Sounds good 😁

aramissennyeydd avatar Oct 19 '24 18:10 aramissennyeydd

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Nov 02 '24 18:11 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Nov 16 '24 23:11 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Dec 02 '24 15:12 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Dec 16 '24 15:12 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jan 31 '25 23:01 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Feb 15 '25 16:02 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Mar 10 '25 21:03 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Apr 05 '25 10:04 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Apr 19 '25 19:04 github-actions[bot]

Are we ready to start maybe adding a new module to the CLI yet? Either with clipanion or something else?

Thinking about the future of #26952 once that's ready, don't want to ship something as @backstage/scaffolder-cli for it to be instantly deprecated the next release if we're close :pray:

benjdlambert avatar May 06 '25 10:05 benjdlambert

@Rugvip Thoughts on ^? I think we could do it as a "module" (in the same package and not yet separated out) for the @backstage/cli - we still need to figure out the installation pattern for plug + playable modules. If we did that as a "module", we'd need to have support for the old commander-based system as well.

aramissennyeydd avatar May 06 '25 15:05 aramissennyeydd

@aramissennyeydd @benjdlambert hmm, I'm thinking we could easily ship it as a module just for the alpha CLI? That way people could access it via backstage-cli-alpha ... but that will obviously go away in the future.

I'd say the main thing to figure out regarding modularization from the PoV of a module is what and how we provide things to use. Will we for example bring in the backend service system or not?

Rugvip avatar May 07 '25 16:05 Rugvip

Yeah, we could do that - probably worth chatting through what a cutover of backstage-cli-alpha to backstage-cli looks like, but it shouldn't affect the scaffolder work.

I signed up for next week's Framework SIG to chat about the missing pieces :)

aramissennyeydd avatar May 07 '25 17:05 aramissennyeydd

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar May 27 '25 22:05 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jun 11 '25 15:06 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jun 30 '25 22:06 github-actions[bot]