Moya / moya-peril

Moya's peril settings
3 stars 0 forks source link

I did not receive an organization invitation #31

Closed cruisediary closed 5 years ago

cruisediary commented 5 years ago

I requested 3 PR for Moya organization but didn't receive an organization invitation

I guess when I requested and merged my first PR, there are Github shut down issue 👻 so invitation didn't work that times and my merged PR count is more than 1 so after second, third PR merged invitation didn't work also because doesn't following if (mergedPrCount === 1) condition 😢

related to #21 Would you help me please ? @Moya/core-team 😄

// https://github.com/Moya/moya-peril/blob/master/org/aeryn.ts
try {
      // This throws if the user isn't a member of the org yet. If it doesn't
      // throw, then it means the user was already invited or has already
      // accepted the invitation (we ignore the return value here).
      await api.orgs.checkMembership({ org, username });
    } catch (error) {
      // Search to check if user has had a PR merged before
      const query = `org:moya+author:${username}+type:pr+is:merged`;
      await api.search.issues({ q: query }).then(async res => {
        const mergedPrCount = res.data.total_count;
        if (mergedPrCount === 1) {
          markdown(inviteMarkdown);
          await api.orgs.addOrgMembership({ org, username, role: "member" });
        }
      });
    }
AndrewSB commented 5 years ago

Thats really weird, you should have gotten an invite. I also see that the bot didn't mention that they were sending you an invite. @ashfurrow is the bot broken?

AndrewSB commented 5 years ago

I also tried adding you manually, but I don't know if admin access allows me to add you. Nothing on https://github.com/orgs/Moya/teams/contributors/members as I expected to find.

Thank you for your work @cruisediary, we're going to try to fix this and get you added soon

SD10 commented 5 years ago

Hey @cruisediary, thanks for letting us know and sorry that this happened to you! 😓 The situation is caused by a combination of two factors:

  1. The peril app is only activated for the Moya/Moya repo
  2. We only send out an invite for your first PR merged to the org (this is because some people don't want to accept the invite and we don't want to spam them)

Since your first PR was on the Moya/contributors repo, your PR to the Moya/Moya repo did not trigger an invite because your total PR count was already beyond 1.

In the meantime, I've sent you an invite to the Moya organization in case @AndrewSB was unable to. Thank you so much for your contributions and we're happy to have you join us! 🥇💯

How can we resolve this?

We should definitely send an invite out for all Moya repos. I'll work on getting that setup. I'm just a bit foggy as to why I did not enable it across all repos in the first place. I think it was because of some other peril automation.

ashfurrow commented 5 years ago

Thanks @SD10 – I appreciate you looking into this. I agree with your appraisal and I think it might just be an artefact of some previous constraint. We should definitely do it 👍

SD10 commented 5 years ago

This should be fixed by #32