SFDO-Tooling / Metecho

Web-based tool for collaborating on Salesforce projects
BSD 3-Clause "New" or "Revised" License
44 stars 34 forks source link

Enhance GitHub app error messaging and support Base64 encoded keys #2129

Open jstvz opened 1 year ago

jstvz commented 1 year ago

A user encountered difficulties while using Metecho on Docker, specifically in creating projects and authenticating. Despite correctly configuring permissions and populating the .env file, they received error messages:

  1. "We couldn’t find any Projects you have access to on GitHub. Confirm that you are logged into the correct account or contact an admin on GitHub."
  2. "You are not a member of any GitHub Organization with permissions to create new Projects on Metecho. Confirm that you are logged into the correct account or contact an admin on GitHub."
  3. "GitHub App has not been installed on this organization"

The problem was identified as an additional newline character \n in the DOCKER_GITHUB_APP_KEY, leading to authentication issues.

Occasionally, developers incorrectly format other private keys, resulting in similar problems. This indicates a wider issue related to key handling.

Suggested Improvement:

  1. Improve error messaging related to the GitHub app to provide more descriptive and helpful guidance for identifying potential problems with key formatting or content. The messages should include checks for common mistakes like extra characters, spaces, or newline characters.

  2. Add support for Base64 encoded keys to help avoid the problem of incorrect formatting. This improvement would make the integration more resilient and tolerant of minor formatting errors in private keys, ultimately reducing user frustration and the need for support assistance.

jstvz commented 1 year ago

Tracked in: