mozilla / contribute.json

A JSON schema for open-source project contribution data.
https://www.contributejson.org/
Mozilla Public License 2.0
41 stars 29 forks source link

Non-IRC chat references #106

Closed jaywink closed 4 years ago

jaywink commented 4 years ago

Currently the schema has in the participate section both irc and irc-contacts.

As per this announcement, IRC is being replaced inside Mozilla with Matrix. This will make it impossible for Mozilla projects to satisfy the demands of the observatory which demands an IRC channel and contacts.

The easiest would be to just add matrix and matrix-contacts in a similar fashion, under participate, for example:

"participate": {
  "matrix": "#matrix:matrix.org",
  "matrix-contacts": [
    "@someaccount:matrix.org",
    "@someaccount:mozilla.org"
  ],
}

However, possibly a more future proof way would be to introduce an array of chat rooms as objects? Something like this, an example for the Matrix project:

"participate": {
  "chat": [
    {
      "location": "irc://chat.freenode.net/#matrix",
      "contacts": [
        "someaccount1",
        "someaccount2"
      ]
    },
    {
      "location": "matrix:room/matrix:matrix.org",
      "contacts": [
        "@someaccount1:matrix.org",
        "@someaccount2:mozilla.org"
      ]
    }
  ]
}

Not entirely sure what the keys would be. The Matrix URI scheme proposal is based on MSC2312 which is yet to be accepted.

Opening for discussion, happy to PR something as well if there is consensus.

pmac commented 4 years ago

I like the 2nd option a lot. Even if we don't use a chat-specific URI I think it'd still be useful to give a direct https link to the room where possible, like with chat.m.o.

peterbe commented 4 years ago

A much simpler format would be:

"participate": {
  "chat": "#matrix:matrix.org",
  "chat-contacts": ["peterbe", "pmac"]
}

Then it can work for any team no matter what they use. If they use Slack, IRC, or Matrix, it's just a URL.

Another option to consider is this alternative:

"participate": {
  "chat": {
      "url": "#matrix:matrix.org",
      "contacts": ["peterbe", "pmac"]
  }
}

This latter is like your latter suggestion. But simpler.

peterbe commented 4 years ago

@mathjazz Can you please help out here?

mathjazz commented 4 years ago

I wonder if there's need for chat to be a list - do projects use more than one chat platform?

In Pontoon we basically followed the first example by @peterbe and linked to c.m.o: https://github.com/mozilla/pontoon/blob/master/contribute.json#L11

I like his 2nd example even better and would be happy to update if it becomes part of the schema. :)

jaywink commented 4 years ago

IMHO having a primary chat link sounds ok. And making chat an object IMHO makes more sense and is more future proof.

"contacts": ["peterbe", "pmac"]

For IRC or some other platforms, this works fine. But for Matrix, the list should contain full mxid's, ie for example ["@peterbe:mozilla.org", "@pmac:mozilla.org"], should those users be on the Mozilla server in this case. But this is probably not something that belongs in the contribute.json specification itself :)

So possibly this kind of schema change?

  "chat": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string"
      },
      "contacts": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "url",
      "contacts"
    ]
  }
peterbe commented 4 years ago

The only thing I don't like is that contacts is required. I've been on projects where there is a chat place but there isn't one or two individuals to single out. Attempting to maintain that list, since people come and go, feels like a burden.

So, I'd love to see that as a PR but with:

"required": [
      "url"
    ]
julienw commented 4 years ago

Sorry I missed the action here :-) Any reason why chat isn't an array after all? We can imagine projects to be on several channels, one being the primary (eg: chatmo) but others also existing (devtools is on discourse too for example). So maybe this could be an array of objects, the first one is the primary implicitely, or there's an explicit primary: true property on one of them.

Also some "standard" guidance about how to specify a matrix room would be super useful!

What do you think? Should we reopen here or should I file another issue?

jaywink commented 4 years ago

Also some "standard" guidance about how to specify a matrix room would be super useful!

This is indeed a tricky one. I was going to propose using the matrix:// URI scheme, but it's not yet accepted. Until that happens, there isn't a good way to link to a Matrix room. Possibly for now it would be best to just suggest listing the room alias ie #room:domain.tld instead of an URI?

peterbe commented 4 years ago

Sorry I missed the action here :-) Any reason why chat isn't an array after all? We can imagine projects to be on several channels, one being the primary (eg: chatmo) but others also existing (devtools is on discourse too for example). So maybe this could be an array of objects, the first one is the primary implicitely, or there's an explicit primary: true property on one of them.

Also some "standard" guidance about how to specify a matrix room would be super useful!

What do you think? Should we reopen here or should I file another issue?

I think there's a conflict between simplicity and flexibility. Making it a simple object instead of a list/array does make it "dumber" which has its own benefits. For it's definitely counter to teams where they have multiple chat rooms(*).

Perhaps it should have be a list/array from the start. Ah well.

Is it possible to edit the JSON Schema so it can be an object or a list of said objects? Would that help? I.e. not urlS but chatS instead. Or is it too late?

(*) A lot of teams have multiple chat rooms but there's usually one that is more "primary" than the others. Especially in terms of where they'd expect new/visitors to come to first.

openjck commented 4 years ago

Just reading this now. It doesn't sound like there was agreement on a standardized way to point to a Matrix channel from contribute.json. Is that correct? If so, let me know if you'd like me to open a separate issue about that.

peterbe commented 4 years ago

Just reading this now. It doesn't sound like there was agreement on a standardized way to point to a Matrix channel from contribute.json. Is that correct? If so, let me know if you'd like me to open a separate issue about that.

Well, there is the chat object which you can use to point to a Matrix channel. See https://github.com/mozilla/contribute.json/pull/107 E.g. https://github.com/mdn/kuma/blob/33ef2ab6e1d0bfa9b93a488dc0211820f810d544/contribute.json#L14

openjck commented 4 years ago

I think the challenge I'm having right now is that there's no standardized URL for a Matrix channel, given its distributed nature, and the matrix:// protocol is not yet supported as mentioned in this comment.

I guess a link to chat.mozilla.com, e.g. https://chat.mozilla.org/#/room/#public-data:mozilla.org would work fine, although matrix:// might be better when it's supported.