Skip to content

update doc about GitHub PR cycle #162

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

atolosadelgado
Copy link
Contributor

BEGINRELEASENOTES

  • Update description about how to open a Pull Request in GitHub for Key4hep repositories

ENDRELEASENOTES

Any comment is more than welcome :)

Also, I do not like the references to working in lxplus, is it really a recommendation to work on lxplus UI machines?


When working on lxplus we recommend to clone github repositories via SSH, especially if you want to contribute code. For this to work, you need to generate ssh keys for authentication. See the corresponding github [help-page](https://help.github.com/articles/generating-an-ssh-key/).

:::{admonition} Generate and set up ssh keys for github
:class: callout

If you only want to use the software it may be easier to use https. In that case you don't need to generate the keys but have to replace `git@github:` with `https://github.com/` in all the instructions. Note that you'll not be able to push to your repository when you are on lxplus. You can also start using https for now and later re-add your repository with ssh authentication, see the [trouble shooting section](#trouble-shooting)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sentence "Note that you'll not be able to push to your repository" doesn't make much sense now in the middle of this. I think originally what was meant to go here is that if you have your keys locally you can't push from a different place without the keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! how would you change the text then?

cd FCCSW
git remote add hep-fcc git@github.com:HEP-FCC/FCCSW.git # add official repo (1) as additional remote
git remote add upstream https://github.com/key4hep/key4hep_repo.git

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the opposite here, I typically want to clone the repository from Key4hep and then add my remote. This makes it so that pulling will pull by default from the Key4hep one instead of your fork, that may never receive any updates.


- fetch all changes from the official repository (1)
This section shows how to work with a non-global package, how to develop a change and upstream it to the official repository.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What non-global means is not very clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true! Thanks for spotting it. I will replace the whole sentence by the following, is it better?
This section explains how to use a locally installed package instead of the one provided in the stack, make changes to it, and contribute those changes to the official repository.

Once all your changes are ready, please run the ctests. To do so, go to the build directory and run `ctest` as follows.
```bash
cd build
ctest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention ctest -j N runs N parallel, depending on the repo it can take forever with one job (k4geo...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ctest -j N does not honor the dependency among tests, so for a new person running this, can be misleading (there should not be dependencies among tests in first place, but we know how it works...)


During the rebase process, you may encounter conflicts if you have modified the same file that has already been changed in the main repository. **Do not panic!** Read carefully the terminal messages and follow their instructions.

#### Handling Merge Conflicts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be done from Github, close to the bottom of the PR page and can be very quick to do if the conflicts are simple - one can also click some options to take either the version in HEAD from the conflict or the introduced one directly (also possible from the command line, but maybe less known).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Never used myself. I have added the following to the end of the section, do you think it is ok?

:::{admonition}
GitHub web interface allows to update (rebase) and solve simple merge conflicts as well, see link
:::

Copy link
Contributor Author

@atolosadelgado atolosadelgado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jmcarcell for the review! I left unresolved some questions. I will commit the rest of the comments


When working on lxplus we recommend to clone github repositories via SSH, especially if you want to contribute code. For this to work, you need to generate ssh keys for authentication. See the corresponding github [help-page](https://help.github.com/articles/generating-an-ssh-key/).

:::{admonition} Generate and set up ssh keys for github
:class: callout

If you only want to use the software it may be easier to use https. In that case you don't need to generate the keys but have to replace `git@github:` with `https://github.com/` in all the instructions. Note that you'll not be able to push to your repository when you are on lxplus. You can also start using https for now and later re-add your repository with ssh authentication, see the [trouble shooting section](#trouble-shooting)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! how would you change the text then?


- fetch all changes from the official repository (1)
This section shows how to work with a non-global package, how to develop a change and upstream it to the official repository.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true! Thanks for spotting it. I will replace the whole sentence by the following, is it better?
This section explains how to use a locally installed package instead of the one provided in the stack, make changes to it, and contribute those changes to the official repository.

Once all your changes are ready, please run the ctests. To do so, go to the build directory and run `ctest` as follows.
```bash
cd build
ctest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ctest -j N does not honor the dependency among tests, so for a new person running this, can be misleading (there should not be dependencies among tests in first place, but we know how it works...)


During the rebase process, you may encounter conflicts if you have modified the same file that has already been changed in the main repository. **Do not panic!** Read carefully the terminal messages and follow their instructions.

#### Handling Merge Conflicts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Never used myself. I have added the following to the end of the section, do you think it is ok?

:::{admonition}
GitHub web interface allows to update (rebase) and solve simple merge conflicts as well, see link
:::

@kjvbrt kjvbrt changed the title update doc about GihHub PR cycle update doc about GitHub PR cycle Mar 7, 2025
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