-
Notifications
You must be signed in to change notification settings - Fork 37
Multiple Hooks simultaneously #246
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
Multiple Hooks simultaneously #246
Conversation
|
This is exactly, what causes the problem. This was missing in the first version of the readme and is now added as brownbaerchen mentioned. |
|
@brownbaerchen Can you change that in the PR, please? |
|
@jakob-fritz Now the pipeline is not executed when I start a PR. What did I do wrong? |
|
I don' know, why it is not shown. When I look at the commit itself I can see a GitHub-Workflow that started I have no idea, why this is not shown in the merge-request |
No that's different. That is run on my fork on push. But since I can do whatever on my fork, we need to run it here as well. The actions tab does not show any action run for the latest commit on this PR on the main repo. |
|
Then, maybe @pancetta needs to confirm this execution first? As the secrets (and potentially the compute-time in other cases) from his repo are used? |
|
Can't do. Nothing to confirm here! |
|
People seem to have some security concerns regarding This actually raises the following point: If anyone can change the pipeline to |
That totally makes sense to be sceptic on that. In the documentation I read, that first-time contributors need to be confirmed to the workflow to run in pull-requests (this is why I was wondering if he has to confirm it). This is even more important when using other services (e.g. Gitlab on KIT-machines) and after seeing #194 (no words on that). So your point is valid, that it makes sense that "pull_request" can only be changed to "pull_request_target" from within the main repo and not from the outside. |
And I did confirm that @brownbaerchen can run stuff during his PRs. I think it is the duty of the maintainer to take care of PR's content, i.e. if a PR from a first-time contributor contains crap, then get rid of it. I cannot prevent a known contributor from going rogue, though. |
|
You may want to merge the changes from the |
|
I think I like this one! |
You can now add hooks either as a single hook, so the API is backwards compatible, or as an array of hooks. All hooks will be called one after another in the order that they are added whenever previously a single hook was called. The order should not matter since the hooks are not supposed to modify anything.
I wrote a few hooks that record small pieces of data that is interesting when using a certain convergence controller, which are added automagically when the respective convergence controller is added. For instance after each step, the step size is recorded as 'dt' when using adaptivity and so on.
Since the hooks have no access to the controller, I left the
__statsvariable in the hooks and merge them after the fact in the controller.Since I need the
__num_restartsvariable foradd_to_statssuch that I can filter recomputed values afterwards, it is unfortunately still necessary to call the parent method withsuper().whatever()just like before.However, for most people it doesn't matter. Actually, my tests pass without calling the parent's methods, but there is a number of fringe cases where it might make a difference. So whenever we write general hooks, we should keep calling the parent's method, but individual projects can choose to forgo this if they never restart anything.
Closes #243