asyncapi / cli

CLI to work with your AsyncAPI files. You can validate them and in the future use a generator and even bootstrap a new file. Contributions are welcomed!
https://www.asyncapi.com/tools/cli
Apache License 2.0
179 stars 145 forks source link

Adding codeowners for each command #781

Open jonaslagoni opened 12 months ago

jonaslagoni commented 12 months ago

Reason/Context

In Modelina we have a similar setup (where each language, input and website has sub-codeowners) which I think makes sense to have in the CLI as well.

And that is: Each command has their own set of codeowners, so that for example https://github.com/asyncapi/cli/blob/master/src/commands/generate/models.ts has me @magicmatatjahu and @kennethaasan as codeowners.

The same would apply for all the other commands as well of course.

That will lift the burden on CLI core codeowners, as most changes to those commands are unrelated to the core of the CLI and does not really need their focus.

Hope it makes sense, otherwise let me know

ayushnau commented 11 months ago

@jonaslagoni i would like to work on this. please project me to correct direction how can i do this. also if possible can show how it is implemented in modelina.

jonaslagoni commented 11 months ago

This is not something you can pickup @Ayush2020012016, this has to come from the current cli codeowners.

ayushnau commented 11 months ago

ok @jonaslagoni

derberg commented 8 months ago

So yeah, the idea makes sense, not sure though if here it can be done 100% same as in Modelina. We would probably have to first plan how to properly test commands consistency with the rules we set for CLI

smoya commented 6 months ago

I like the idea. My only concern is when someone makes a change that affects all or several commands (i.e. changing the Parser config or similar). Not sure how you @jonaslagoni do in Modelina. Perhaps writing some guidelines in the docs might fix it.

Let me go deep on what I mean. At least two scenarios come to my mind:

  1. The PR does change anything on those commands. Then, owners will be required in the PR review automatically (by matching the file path).
  2. The PR does not change anything on those commands. Then, review from those command owners won't be automatically required by Github.

In the second case, shall the author of the PR add all those command owners as reviewers? In addition, it could happen that they don't really know the whole impact of their change.

In both cases, should at least 1 owner of each command give their +1 in order to get the PR merged?

derberg commented 5 months ago

I'm not sure how we can do it and still make sure we are consistent across commands. I guess in Modelina you just implement interfaces on "language" level ownership. Here, things work differently, maybe it would be enough to move flags like https://github.com/asyncapi/cli/blob/master/src/commands/convert.ts#L20-L24 to separate, single location, that is maintained by core maintainers so whenever changes are introduced, they know, and the rest of implementation is under command-level maintainers? 🤔 that could be first step, later we would have to figure out errors consistency

@Souvikns wdyt? @Amzani this could be a good PR for you to onboard as core maintainer https://github.com/asyncapi/cli/pull/1220#issuecomment-1988053610 as with onboarding you we could onboard other command-level maintainers. So refactor + contrib guide that explains new setup (some can probably copy/paste from modelina)

jonaslagoni commented 5 months ago

Why not just say that all core CLI maintainers are also maintainers of each command?

That way they always have full control to adapt anything within the CLI while command-level owners still have full control over the commands.

derberg commented 5 months ago

That will lift the burden on CLI core codeowners, as most changes to those commands are unrelated to the core of the CLI and does not really need their focus.

but then ☝🏼 will not work and I will be pined in every PR

jonaslagoni commented 5 months ago

Hmmm, yea, that is true.

derberg commented 5 months ago

@jonaslagoni but this should be doable -> https://github.com/asyncapi/cli/issues/781#issuecomment-1988082703 and we anyway have @Amzani volunteering to maintain CLI and could maybe work on it

Amzani commented 5 months ago

Looks like a good plan, I'm rethinking and POCing a better architecture for CLI

derberg commented 5 months ago

@Amzani perfect, I like the new structure, so yeah, please take into account this issue, that we need some parts to be in separate files, so when configuring CODEOWNERS we can provide paths where core maintainers whenever there are cross commands/api modifications, or commands or API design is affected.

example scenarion:

Amzani commented 5 months ago

Sure @derberg I'll incorporate this requirement in the new architecture of CLI, to validate my approach using the hexagonal architecture

Let's say I'm changing a foo command, or /foo endpoint to the API

Who is pinged when paths are affected?

Notes:

cc @jonaslagoni @smoya

derberg commented 5 months ago

what is internal in relation to https://github.com/asyncapi/cli/pull/1200 ?

Amzani commented 5 months ago

@derberg I renamed internal to core to make it explicit

smoya commented 5 months ago

1200

Don't wanna sound picky, but I think domain is the word you are looking for if it is the location where all domain logic (models, services, data loaders or repositories, etc) will be located into.