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

Github action to sync tudat-space submodule #47

Merged

Conversation

larshinueber
Copy link
Collaborator

This PR adds a Github action to update the submodule commit in tudat-space on each push to the tudatpy-examples master branch. It makes tudatpy-examples the leading repository for example applications (see #13 for a discussion on the workflow).

Changes include:

  • Remove deprecated workflow files
  • Add new workflow to sync tudat-space

Before merging

Any feedback is appreciated!

@DominicDirkx
Copy link
Member

Great to have this! Have you been able to test this already somehow?

@larshinueber
Copy link
Collaborator Author

Hi Dominic,

Yes, I have tested this in the dummy-repos https://github.com/larshinueber/foo-space/tree/submodules and https://github.com/larshinueber/foopy-examples/tree/submodules on the submodules branches.

If a change is made in foopy-examples, e.g. commit larshinueber/foopy-examples@7b64f2a, the action will make a commit in foo-space like this: larshinueber/foo-space@86e170f. The commit message and authors can of course be changed if desired.
Here is the log file of the action: https://github.com/larshinueber/foopy-examples/actions/runs/10470939960/job/28997145747

The workflow files are fundamentally the same between the tudat repos and the foo repos, with the only changes being the branch names on which the workflow should be triggered and where the commit is pushed to.

Let me know if there is anything unclear :)

@DominicDirkx
Copy link
Member

Great, thanks!

@DominicDirkx
Copy link
Member

I've merged tudat-team/tudat-space#148, which works exactly as it should, many thanks for this improvement. It's going to help us out a lot in ensuring consistency!

If you could do:

Add a repository secret GH_PAT to tudatpy-examples with permissions to push to tudat-space

I can merge this as well!

@larshinueber
Copy link
Collaborator Author

Thank you for merging the tudat-space part :)
Unfortunately I cannot access the settings in the tudatpy-examples repo, I think the permissions are not entirely consistent between the tudat-team repositories, as I can access the settings in other tudat-repos.

Maybe we could also revive @Delfi-C3 to create a personal access token which is not tied to any user?

@larshinueber larshinueber marked this pull request as ready for review September 4, 2024 18:19
@DominicDirkx
Copy link
Member

DominicDirkx commented Sep 4, 2024

You should have access now.l :) Let's first get this to work, the see if we should create/revive a bot

@larshinueber
Copy link
Collaborator Author

Thank you!
The GH_PAT is already set (I assume that's from the previous version of the Github action), so from my side this PR is ready to be merged. If the PAT doesn't work anymore I will update it with a new one :)

@DominicDirkx DominicDirkx merged commit a4e37f6 into tudat-team:master Sep 5, 2024
@DominicDirkx
Copy link
Member

Great! Merged :)

@DominicDirkx
Copy link
Member

DominicDirkx commented Sep 5, 2024

It doesn't work yet, I'm afraid:
https://github.com/tudat-team/tudatpy-examples/actions/runs/10715714863/job/29711709939
with error:
Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled
Is this something you encountered in your local test setup?

@larshinueber
Copy link
Collaborator Author

It should have worked now :)
I created a new token and added it to the repository secrets. Following this issue I set the expiry date to 05/09/2025, so the token needs to be updated next year.

Let me know if there is anything else :)

@DominicDirkx
Copy link
Member

This works! Could you briefly describe here how/where to update this token?

@larshinueber
Copy link
Collaborator Author

larshinueber commented Sep 12, 2024

Sure!

First, a personal access token needs to be created in the personal user settings (this could be replaced by the Delfi-C3 bot in the future, so the token is not tied to a single person). The process to generate a PAT is already documented in the Tudat developer docs and can be followed. I gave the token the repo scope.

Copy the token that you generated.

The token is then added in settings of the tudatpy-examples repository. For this, go to Settings -> Security -> Secrects and Variables -> Actions -> New repository secret:
image

Then, name the token (in this case GH_PAT) and paste the token you copied before in the Secret field:
image

Add the secret and everything should work as before 👍

I could also add this to the developer docs, although I would wait until the big PR (tudat-team/tudat-developer-docs#28) is merged to avoid duplications :)

@larshinueber larshinueber deleted the feature/automate-workflow branch September 29, 2024 20:08
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.

2 participants