Skip to content

add basic READMEs #14

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

Merged
merged 6 commits into from
Mar 6, 2024
Merged

add basic READMEs #14

merged 6 commits into from
Mar 6, 2024

Conversation

bpmct
Copy link
Member

@bpmct bpmct commented Mar 5, 2024

This is intended to be a starting point, and I am happy to pair and/or take this to completion.

What this is missing:

  • Thorough API reference
  • Example of using full Coder API

I believe we already have this content, so it should be somewhat trivial to add/reference. If I am wrong, let me know and perhaps we can adjust to remove this.

README.md Outdated
We believe [Backstage.io](https://backstage.io) can be extended to help developers where they spend the majority of their time: their IDE. This repository contains a collection of plugins that onboard developers faster and reduce context-switching by giving them one-click into reproducible development environments:

- [backstage-plugin-coder](./plugins/backstage-plugin-coder/README.md): A plugin for integrating Coder workspaces into Backstage.
- [backstage-plugin-devcontainers](./plugins/backstage-plugin-devcontainers/README.md): A plugin for integrating DevContainers into Backstage (no Coder deployment necessary).
Copy link
Member Author

@bpmct bpmct Mar 5, 2024

Choose a reason for hiding this comment

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

will there be a frontend one? right now there is only backstage-plugin-devcontainers-backend

how are READMEs typically handled when there is this "split"?

Copy link
Member

Choose a reason for hiding this comment

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

Looking at some community examples I think we'll just stick one at plugin root so folks don't have to cobble together information from two different sources (so what you have is fine).

@Kira-Pilot Kira-Pilot requested a review from Parkreiner March 5, 2024 01:58
Co-authored-by: Kira Pilot <kira.pilot23@gmail.com>
Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@Parkreiner Parkreiner left a comment

Choose a reason for hiding this comment

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

I think this looks good overall! Mainly added some color commentary to some of the wording

mode: 'manual',
// This parameter is used to filter Coder workspaces
// by a repo URL parameter.
repoUrlParamKeys: ['custom_repo', 'repo_url'],
Copy link
Member

Choose a reason for hiding this comment

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

Think it might be help to make it more clear that this is specifically for specifying multiple parameters for the repo URL, if a company somehow has multiple teams using different key names

There's a section in the API Reference that mentions the general order of operations that the logic uses to process these parameter names. Might be worth linking to it once the API docs are good to go

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how a single template would be supported, but multiple parameters for repo, unless I'm missing something. I think we leave it in the API reference for now.

```ts
// MyCustomComponent.tsx
import { useOpenInCoderLink } from '@internal/plugin-coder';
1. Add the `WorkspacesList` card to the entity page in your app:
Copy link
Member

@Parkreiner Parkreiner Mar 6, 2024

Choose a reason for hiding this comment

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

Suggested change
1. Add the `WorkspacesList` card to the entity page in your app:
1. Add the `CoderWorkspacesCard` card to the entity page in your app:

Do you also think that it's worth shouting out that the individual pieces will be available as imports, too, for people who want more customization options, or can that stay more of a footnote in the API docs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that would be excellent. Will we have an example of that in the API docs? Left a comment for now.

Comment on lines +114 to +117
// TODO. I believe Michael said this is possible today?
// This can be a very basic component that requires auth
// and lists all templates in a basic unstyled list
// with a refresh button
Copy link
Member

@Parkreiner Parkreiner Mar 6, 2024

Choose a reason for hiding this comment

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

Yeah, this depends on your definition of "possible today".

With the current proxy settings, it is possible to hit any arbitrary endpoint, though there's zero type-safety/type-hints or good ergonomics around it. There's also not a great way to bring the Coder session token from the other UI components into any arbitrary fetch call

Again, though, these changes are perfectly doable in time for launch – they're just not ready quite yet

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha. Commented out fo rnow


More ideas welcome!
- [ ] Add support for only rendering component if `catalog-info.yaml` indicates the item is compatible with Coder
Copy link
Member

@Parkreiner Parkreiner Mar 6, 2024

Choose a reason for hiding this comment

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

I don't think this would be too hard – my gut feeling is that we would basically export a custom hook (something like useCoderCatalogInfo) that exposes a property saying whether the current entity has a YAML config in the current file

I think that'll be the best option for giving devs the most control, since there's so much freedom as far as where the component can be placed, and blindly hiding an element could cause layout jank in our user's webpages. Though on top of this, we could also add a property to the component that says whether to render at all

@Kira-Pilot
Copy link
Member

@bpmct, Asher brought up some great points in another ticket:

  • The readme title should probably match the package name?
  • Seems NPM uses the first line in the readme as the description, but maybe we want an explicit description field in the package.json.
  • Could add keywords in the package.json to make the plugins more discoverable.

@bpmct bpmct marked this pull request as ready for review March 6, 2024 22:55
@bpmct
Copy link
Member Author

bpmct commented Mar 6, 2024

@bpmct, Asher brought up some great points in another ticket:

  • The readme title should probably match the package name?
  • Seems NPM uses the first line in the readme as the description, but maybe we want an explicit description field in the package.json.
  • Could add keywords in the package.json to make the plugins more discoverable.

Extracted to #18

@bpmct bpmct merged commit f7742a2 into main Mar 6, 2024
@code-asher code-asher mentioned this pull request Mar 7, 2024
@code-asher code-asher deleted the coder-readme branch March 7, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants