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

Fix author #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix author #30

wants to merge 5 commits into from

Conversation

naseemkullah
Copy link
Contributor

This is implements a workaround for github owner info not being available in the github app triggered build object, but wanting to fetch the author info.

Also some slight refactoring and package update.

@naseemkullah
Copy link
Contributor Author

bump

@Philmod
Copy link
Owner

Philmod commented Nov 8, 2019

I would prefer not to add yet another configuration. Why is this necessary? Is it missing in the build information? In which case a bug should be filed to Cloud Build.

@naseemkullah
Copy link
Contributor Author

naseemkullah commented Nov 8, 2019

Github repo owner information is indeed missing from the build object. It is used to fetch the github author info. This is an imperfect but good enough work around until Cloud Build provides either github owner or github commit author or both in the build object of a github app triggered build. When they do I will gladly remove the excess code if this is merged.

If we do not merge this and cloud build cannot provide the required info in the build object, we should advise/set a guard that fetching author info is not possible with github app triggered builds.

@Philmod
Copy link
Owner

Philmod commented Nov 8, 2019

Did you file a bug to Cloud Build? Can you link it here?

@naseemkullah
Copy link
Contributor Author

https://issuetracker.google.com/issues/144151357 created! Kindly star the issue.

@LanceSandino
Copy link

I tried this and I only get
Error: TypeError: Cannot read property 'author' of undefined

@naseemkullah
Copy link
Contributor Author

Hi @LanceSandino this is for github triggered apps right? We will have to wait for https://issuetracker.google.com/issues/144151357 for a proper solution. At which point I think we will remove all the github fetching code and just say that we need to use github triggered apps for author info, which will be provided in build objects.

If you need this now though fork my branch and provide GITHUB_TOKEN and GITHUB_OWNER values

@LanceSandino
Copy link

Hi @LanceSandino this is for github triggered apps right? We will have to wait for https://issuetracker.google.com/issues/144151357 for a proper solution. At which point I think we will remove all the github fetching code and just say that we need to use github triggered apps for author info, which will be provided in build objects.

If you need this now though fork my branch and provide GITHUB_TOKEN and GITHUB_OWNER values

I did fork yours, and that's where I got the TypeError 'author' :(

@naseemkullah
Copy link
Contributor Author

Hi @LanceSandino this is for github triggered apps right? We will have to wait for https://issuetracker.google.com/issues/144151357 for a proper solution. At which point I think we will remove all the github fetching code and just say that we need to use github triggered apps for author info, which will be provided in build objects.
If you need this now though fork my branch and provide GITHUB_TOKEN and GITHUB_OWNER values

I did fork yours, and that's where I got the TypeError 'author' :(

Oh ok, sorry. Maybe best we wait for https://issuetracker.google.com/issues/144151357

@sneko
Copy link

sneko commented Mar 24, 2020

Hi @naseemkullah ,

I also made a PR #33 , for me this is in addition to yours, just to avoid doing extra steps not needed if no GitHub token (and also avoiding the issue you target).

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

Successfully merging this pull request may close these issues.

4 participants