Skip to content

App fails to compile if no GITHUB_APP_PEM environment variable #823

Closed

Description

@begedin

Problem

Without the mentioned key present in the environment, with any value whatsoever, the app fails to compile, both when running it, or when running tests.

This blocks new contributors from helping and forces us to either explicitly set the evn variable source the .env on every new tab to be able to do any work at all.

Additionally, adding an incorrect value to the env variable causes the app to compile, but then two tests fail:

  1) test authenticated_integration_request/5 handles an error response (CodeCorps.GitHubTest)
     test/lib/code_corps/github_test.exs:45
     ** (FunctionClauseError) no function clause matching in Joken.Signer.rs/2
     stacktrace:
       lib/joken/signer.ex:78: Joken.Signer.rs("RS256", [])
       (code_corps) lib/code_corps/github.ex:138: CodeCorps.GitHub.generate_jwt/0
       (code_corps) lib/code_corps/github.ex:157: CodeCorps.GitHub.add_jwt_header/1
       (code_corps) lib/code_corps/github.ex:230: CodeCorps.GitHub.authenticated_integration_request/5
       test/lib/code_corps/github_test.exs:46: (test)



  2) test authenticated_integration_request/5 handles a successful response (CodeCorps.GitHubTest)
     test/lib/code_corps/github_test.exs:39
     ** (FunctionClauseError) no function clause matching in Joken.Signer.rs/2
     stacktrace:
       lib/joken/signer.ex:78: Joken.Signer.rs("RS256", [])
       (code_corps) lib/code_corps/github.ex:138: CodeCorps.GitHub.generate_jwt/0
       (code_corps) lib/code_corps/github.ex:157: CodeCorps.GitHub.add_jwt_header/1
       (code_corps) lib/code_corps/github.ex:230: CodeCorps.GitHub.authenticated_integration_request/5
       test/lib/code_corps/github_test.exs:40: (test)

The compilation fails due to trying to Base64.decode a nil so that problem can be simply fixed by adding a "" fallback to the variable in config.ex.

As for the failing tests, we need to decide what to do there. Do we skip them, or do we inject the data?

Subtasks

  • Make it so the variable is not strictly necessary
  • Decide what to do with the failing tests

Activity

  1. changed the title [-]App fails to compile if no GITHUB_APP_PEM environment fariable[/-] [+]App fails to compile if no GITHUB_APP_PEM environment variable[/+] on Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions