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

Verify if the docker images compilation is triggered correctly from robotology #24

Closed
valegagge opened this issue Dec 19, 2023 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@valegagge
Copy link
Member

We want to verify that the automatic compilation works correctly on the Superbuild release event.

We already did this check here #2, but with the last release, we noticed that the trigger didn't work.

Dod
Understand the cause of the missing trigger and fix it if it is possible

@valegagge valegagge added the bug Something isn't working label Dec 27, 2023
@MSECode
Copy link
Member

MSECode commented Dec 28, 2023

It seems that the problem is related to the TOKEN used when triggering the release remotely from the robotology/robotology-superbuild repo to the icubtech-iit/docker-deployment-images. Probably we are still using the tokens from the older code repo and those token probably do not exist anymore.
So we need to check that and moreover, we have to understand if we have to use the same exact token on all repos that use the repository dispatch trigger to launch the action
Then we have to check if we need to add those same secrets on the new repo

@MSECode
Copy link
Member

MSECode commented Dec 28, 2023

If you wanna understand how the repository dispatch events works among remote repositories here a clear explanation:
https://blog.marcnuri.com/triggering-github-actions-across-different-repositories

@pattacini
Copy link
Member

pattacini commented Dec 28, 2023

For dispatching from robotology-superbuild to this repo, the token is grabbed using the App. See https://github.com/robotology/robotology-superbuild/blob/master/.github/workflows/build-docker-images.yml#L17-L23.

This should be fine and already tested in #2, as @valegagge said.

I've noticed that the dispatcher has been upgraded to v2 via robotology/robotology-superbuild#1480. After that, you've been observing problems, if I'm not mistaken. It may be related.

In the meantime, there've been more releases of the dispatcher. Check it out:

Perhaps, they deployed some bug fixes.

cc @MSECode @Nicogene @traversaro

@pattacini
Copy link
Member

More simply, the dispatcher for Distro 2023.11.0 failed:

@pattacini
Copy link
Member

I think the problem is this change to tibdex/github-app-token:

According to the documentation, v2 introduces breaking changes:

I will propose a PR to fix this.

@pattacini
Copy link
Member

pattacini commented Dec 28, 2023

I will propose a PR to fix this.

cc @traversaro @valegagge @MSECode @Nicogene

@MSECode
Copy link
Member

MSECode commented Dec 28, 2023

Yep @pattacini,
me and @valegagge are experiencing problem in the triggering of the automatic launch of the release_trigger repository_dispatch job since a couple of superbuild releases ago. I think since the 2023.8.0 or 2023.10, which has been launched manually on the repository docker-deployment-images
As you say, version v2 may be the problem.
Another thing is that I did not understand if the secret we are using, i.e. secrets.ICUB_TECH_IIT_APP_KEY must be present with the same name and value in all the repos we are using. I mean that, considering that the robotology-superbuild grabs the token using the app, do I have also to add that specific secret-value pair in the repo docker-deployment-images other than in icubtech-iit/code and in all the repos that needs that specific release_trigger (I've not a wide knowledge on these workflows, but probably @pattacini, you can explain that to me ).
Because currently in docker-deployment-images we are using the token as in here:

@pattacini
Copy link
Member

pattacini commented Dec 28, 2023

do I have also to add that specific secret-value pair in the repo docker-deployment-images other than in icubtech-iit/code and in all the repos that needs that specific release_trigger

The App is capable of generating tokens when required. In this particular workflow, the token needs to be available with the appropriate permissions only at the origin of the request, that is robotology-superbuild.

Also, adding/removing tokens is a very sensitive operation, thus only admins can/shall do that.

GITHUB_TOKEN is a special token that is scoped with the repository where it is generated, hence it is limited. Further, for new repositories, GitHub will grant GITHUB_TOKEN only read permissions by default.

@MSECode
Copy link
Member

MSECode commented Dec 28, 2023

repository

Understood, thanks a lot for the explanation

@valegagge
Copy link
Member Author

Hi @pattacini ,
we noticed that in the workflow build-docker-images.ym of robotology-superbuyild the get_token step uses secrets that I can't find in the Code repo. Please see here. Are they secrets of the icub-tech organization?

@pattacini
Copy link
Member

Those are secrets defined within the robotology org and serve to ask the App to generate tokens as per #24 (comment).

image

@valegagge
Copy link
Member Author

Now with this PR #30, all should be fine.
Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants