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

JHipster Online: Continuous Integration feature fails #241

Closed
amchavan opened this issue Sep 29, 2020 · 11 comments
Closed

JHipster Online: Continuous Integration feature fails #241

amchavan opened this issue Sep 29, 2020 · 11 comments
Labels
Type: Bug 😢 A confirmed bug or something that isn't working as expected

Comments

@amchavan
Copy link

I'm trying JHipster Online for the first time, so maybe I'm doing something wrong, but anyway.
I created a project, all is well, see https://github.com/amchavan/jhipster-demo. Next I tried to add Continuous Integration features to it, went to that Web page, selected my project and GitHub Actions and clicked on the Yes, add Continuous Integration button. The popup window shows:

Configuring Continuous Integration/Continuous Deployment

Sending request to the server...
Continuous Integration with Github is going to be applied to amchavan/jhipster-demo
Cloning GitHub repository `amchavan/jhipster-demo`
Creating branch `jhipster-github-ci-110399324861994`
Generating Continuous Integration configuration
Running `jhipster ci-cd`
Error during generation: Stream closed
Generation failed

I tried several times over two days, choosing different options, but the outcome is always the same. The error message is not very informative, can somebody please tell me what to do?

@SudharakaP
Copy link
Member

@amchavan : Thanks much for reporting this problem. I have seen this error in our logs but couldn't figure out where it is coming from; now I know. We'll look into this and hopefully have a fix soon. 😄

SudharakaP added a commit to SudharakaP/jhipster-online that referenced this issue Oct 2, 2020
This upgrades to the process creation to ProcessBuilder and also upgrades the github-api

Related to jhipster#241
@SudharakaP
Copy link
Member

Part of the problem is that there seems to be a problem with the output stream closing during generation of the ci-cd configuration files which seems to give the error. I've corrected this in #242. However it seems there's another problem specific to creating the GitHub Actions configuration. When trying to create the pull request for this configuration there seems to be a error coming from the github-api. I believe this might be a bug on the github-api side as this involves a special folder specific to GitHub. Anyways I've opened a issue at; hub4j/github-api#959 outlining this issue. 🤔

@SudharakaP SudharakaP added the Type: Bug 😢 A confirmed bug or something that isn't working as expected label Oct 2, 2020
SudharakaP added a commit that referenced this issue Oct 2, 2020
This upgrades to the process creation to ProcessBuilder and also upgrades the github-api

Related to #241
@SudharakaP
Copy link
Member

Okay I found the final part of this puzzle. It seems the bot's oauth token is missing the workflow permission. We need to modify the bot such that it's oauth token includes the workflow permission. This will ensure the bot can create/modify the .github folder.

@jdubois @PierreBesson : I don't have access to the jhispter-bot. Could one of you please make sure the both has the workflow permission added to it's oauth token? 😄

@jdubois
Copy link
Member

jdubois commented Oct 2, 2020

I have created such a token but can you confirm that I need to put it inside the "JHIPSTER_BOT_OAUTH_TOKEN" secret variable? I'm having some doubts

@jdubois
Copy link
Member

jdubois commented Oct 2, 2020

Indeed, it seems that we authenticate using the user's oauth token, not the JHipster Bot OAuth token (which doesn't seem to be used anywhere!!)

@vishal423
Copy link
Contributor

As far as I remember, we don't use the bot for GitHub in our code. The configuration and docs are a bit misleading on that front.

@jdubois
Copy link
Member

jdubois commented Oct 2, 2020

Indeed, it seems that this is not used anymore, I'm also going to fix that. I need some time to check as it's a bit complex, but I should do 2 PRs fixing those

SudharakaP added a commit to SudharakaP/jhipster-online that referenced this issue Oct 2, 2020
This adds the workflow token to user token along with refactoring code to remove the bot token which is no longer used.

Related to jhipster#241
@SudharakaP
Copy link
Member

SudharakaP commented Oct 2, 2020

@jdubois : You are right; sorry for my mistake. I was seeing a very small log implying the missing workflow permission in the token and thought it comes from the bot token; but the bot token is no longer used and as you said we use the user token. I've opened a PR adding the workflow permission to the user token. This should take care of it. Feel free to review and merge. 😄

EDIT: Also in the above PR I've went ahead to clean up the old code relevant to the bot token.

@SudharakaP
Copy link
Member

@amchavan : We've fixed this issue. Please give it a try and let us know if you see any further issues. You should refresh your GitHub token as mentioned at https://start.jhipster.tech/ci-cd under the GitHub Actions section. 😄

@amchavan
Copy link
Author

amchavan commented Oct 6, 2020

It does work now, thank you!!

@SudharakaP
Copy link
Member

It does work now, thank you!!

Great. You are welcome. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 😢 A confirmed bug or something that isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants