framework icon indicating copy to clipboard operation
framework copied to clipboard

Automatic PR at framework after submodule PR

Open juanangp opened this issue 2 years ago • 6 comments

Looking at the issues on validation that we had recently, I think a new workflow for the PR is required. Here my proposal:

  • PR on submodules trigger the creation of a PR on framework and the submodule hash is updated accordingly in framework. If the PR of the same branch already exist in framework with the same branch name it just commit the changes on the submodule hash. For instance, something similar is done at https://github.com/releasehub-com/github-action-create-pr-parent-submodule
  • PR can only be merged from framework and it will automatically trigger the submodule, this can address this issue https://github.com/rest-for-physics/framework/issues/250 since some work has been done here https://github.com/rest-for-physics/framework/pull/259
  • The pipeline validation will only run at framework so we avoid to trigger the pipeline when a PR is performed in e.g. different submodules and in framework.

@jgalan and @lobis let me know what do you think since this is a lot of work.

juanangp avatar Apr 27 '23 16:04 juanangp

  • PR on submodules trigger the creation of a PR on framework and the submodule hash is updated accordingly in framework. If the PR of the same branch already exist in framework with the same branch name it just commit the changes on the submodule hash. For instance, something similar is done at https://github.com/releasehub-com/github-action-create-pr-parent-submodule

Then, each time we commit on the submodule a new commit will appear on the framework PR updating the submodule hash?

As I understand once we press framework merge PR, it will trigger the merging of the PR at the corresponding submodules?

For me I think it could work. I just don't understand the technicalities about the implementation, but if that it is possible, just let me know how can I help on the transition.

Perhaps @nkx111 may have some comments too

jgalan avatar Apr 28 '23 10:04 jgalan

We could update the PR submodule description to indicate how to proceed. I.e. explain that a new framework PR has been created automatically.

jgalan avatar Apr 28 '23 10:04 jgalan

I understand we will then have a dedicated lml for each submodule inside the framework? E.g. axionlib_validation.yml ... restG4_validation.yml ... that will be launched independently?

jgalan avatar Apr 28 '23 10:04 jgalan

We could update the PR submodule description to indicate how to proceed. I.e. explain that a new framework PR has been created automatically.

It is difficult to imagine all the users case, but some developers can create their own PR on framework and in a submodule. Rigth now the PR is only automatically created if the branch doesn't exist in framework, so developers should be responsible on creating their own PR if the framework branch is already present.

The message that will be displayed in case of automatic PR is:

--title 'Submodule Updates from ${{ inputs.submodule }} branch ${{ inputs.branch }}'
--body 'Automatic PR from ${{ inputs.submodule }} branch ${{ inputs.branch }}, related PR ${{ steps.PRCheck.outputs.prurl }}'

juanangp avatar Apr 28 '23 11:04 juanangp

We could update the PR submodule description to indicate how to proceed. I.e. explain that a new framework PR has been created automatically.

This is possible but not straightforward, it is difficult to check if the message is present or not. Perhaps would be better to make all the developers aware of new PR workflow.

Anyhow, I will provide a proposal and we can iterate over it.

juanangp avatar Apr 28 '23 12:04 juanangp

I understand we will then have a dedicated lml for each submodule inside the framework? E.g. axionlib_validation.yml ... restG4_validation.yml ... that will be launched independently?

In principle, this is unchanged but we could think moving the submodule validation inside framework, but for me this is a different topic.

juanangp avatar Apr 28 '23 12:04 juanangp