-
Notifications
You must be signed in to change notification settings - Fork 43
Add support for custom event dispatching #621
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
base: main
Are you sure you want to change the base?
Conversation
|
Admin commands cheatsheet:
|
ff1c83e to
01882d1
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
README.md
Outdated
|
|
||
| # List of Github Events which should be treated as Pull Requests, | ||
| # analyzing the .coverage file as described in [PR Mode](#pr-mode) | ||
| # above. Specified as a comma-separated list | ||
| EVENTS_AS_PR: "" | ||
|
|
||
| # List of Github Events which should extract the coverage rate and store | ||
| # information onto the dedicated coverage branch, as described in | ||
| # [Default Branch Mode](#default-branch-mode) above. Specified as a | ||
| # comma-separated list. | ||
| EVENTS_AS_COVERAGE: "" | ||
|
|
||
| # List of Github Events which should result solely in comments being posted | ||
| # to the pull request. See | ||
| # [Commenting on the PR on the `push` event](#commenting-on-the-pr-on-the-push-event) | ||
| # below. Specified as a comma-separated list. | ||
| EVENTS_AS_COMMENT: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit skeptical of exposing events_as configuration, as something like push could be a PR if on a feature branch and a "coverage" if on the default branch ? Shouldn't we expose directly activity = "process_pr" / "post_comment" / "save_coverage_data_files" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would certainly lead to much simpler code in the action, at the cost (but power) of logic in the user's workflow files. I wish the embedded logic in workflows was a bit cleaner, or that you could directly embed a snippet of javascript in the action definition, but there are always ways of achieving what you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add readme for "usual" cases:
with:
activity: "${{ github.event_name == 'push' && 'save_coverage_data_files' || 'process_pr' }}"
# or
with:
activity: "${{ (github.event_name == 'push' && github.ref_name == 'main') && 'save_coverage_data_files' || 'process_pr' }}"
I'd say that starting from this, it should be fairly easy to tweak and achieve what you want ? I'm open to different opinions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that makes sense, and I've updated the code accordingly.
ewjoachim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome start :)
6550942 to
89e663b
Compare
### Description This addresses py-cov-action#615 by adding the new ACTIVITY parameters. When this is specified, it overrides the default event-to-activity heuristic in #find_activity and selects the activity to run directly. This allows the end user to write their logic in the workflows when required. ### Testing I've added unit tests for these, but I haven't added integration or end-to-end tests, I was unable to get the environment set up correctly.
7358075 to
f636f2d
Compare
for more information, see https://pre-commit.ci
|
@ewjoachim sorry, I lost track of this. What are your thoughts on the last update here? |
Description
This addresses #615 by adding the new ACTIVITY parameters. When this is specified, it overrides the default event-to-activity heuristic in #find_activity and selects the activity to run directly. This allows the end user to write their logic in the workflows when required.
Testing
I've added unit tests for these, but I haven't added integration or end-to-end tests, I was unable to get the environment set up correctly.