Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporter says that app is not installed #71

Open
Dekkee opened this issue Dec 15, 2019 · 5 comments
Open

Reporter says that app is not installed #71

Dekkee opened this issue Dec 15, 2019 · 5 comments

Comments

@Dekkee
Copy link

Dekkee commented Dec 15, 2019

Hello! I have my own teamcity server. And reporter says:

It looks like you don't have the "Jest Results" Github App installed to your repo! https://github.com/apps/jest-results

Here is PR with integration: https://github.com/Dekkee/tuktuk-scg-scrapper/pull/17/files
App is installed:
image
Tried to make my own app as shown in readme.md, but error is the same.

As I see, it happens due to bad credentials: https://github.com/hipstersmoothie/create-check/blob/68da97dd5f59acf2cea7c156c60b71acfb20643a/src/index.ts#L85
But it happens even with your hard-coded key.

What did I miss? Thanks!

@Dekkee
Copy link
Author

Dekkee commented Jan 8, 2020

I found an issue. It was because of this line: https://github.com/hipstersmoothie/create-check/blob/68da97dd5f59acf2cea7c156c60b71acfb20643a/src/index.ts#L10
My CI (TeamCity) doesn't have owner and repo information, so I pass them via Environment Variables.
I think it should be mentioned in README

@hipstersmoothie
Copy link
Owner

hipstersmoothie commented Jan 8, 2020 via email

@Dekkee
Copy link
Author

Dekkee commented Jan 8, 2020

I need your explanation about your CI. Because in my case slug looks like:
image
In this case first argument is truthy and owner becomes 'Test' (it is name of my job), but second argument is falsy and it becomes process.env.REPO.

I think it could be more universal solution.
Module create-check is a github-only tool as the terms REPO and OWNER are github-only too.
So we can take them from repo url taken by git remote get-url origin.
This solution is CI independent and can run locally, because repo url will be the same.
URL pattern for all repos will be the same, so we can extract by regExp.

Explanation:

const { exec } = require('child_process');
const regex = /https?:\/\/.*\/(.+)\/(.+)\.git/;
exec('git remote get-url origin', (err, stdout) => {
    // stdout = https://github.com/owner/repo.git
    const [, owner = process.env.OWNER, repo = process.env.REPO] = stdout.match(regex) || [];
    console.log('=== rev-parse', owner, repo, stdout);
});

Sandbox with the mock: https://repl.it/repls/TremendousMoccasinCrypto

If its ok for you, I will wake PR to https://github.com/hipstersmoothie/create-check first, and then to reporter.

@Dekkee
Copy link
Author

Dekkee commented Jan 8, 2020

Something like that: hipstersmoothie/create-check#70

@rhutchison
Copy link

There are still issues with the plugin, but I just set OWNER/REPO environment variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants