-
Notifications
You must be signed in to change notification settings - Fork 7
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
Modularize dependencies for GH payload consumption and Slack message sending #92
Conversation
465d570
to
e894628
Compare
define local + remote implementations of each more concise decode_string_pad implementation
The config file now distinguishes between undefined lists and empty lists. This applies to `allowed_pipelines` in the main config, and `allow` and `ignore` in the prefix/label rules. Now, an undefined field is interpreted as a global whitelist, and an empty list is interpreted as a global blacklist.
Temporarily disable auxiliary commands. Config.t is now mostly redundant but kept for compatibility with status_rules parsing.
…ests) Auxiliary cli commands have been reenabled. The tests, as well as `check_gh_action` and `check_slack_action`, now rely on the functor-based Action module.
9422dac
to
2b291a1
Compare
Secrets are now in their own record field within the context, so that future secret additions don’t pollute the outer context structure. Getters are also defined to reduce boilerplate exception handling.
What is the usecase for this distinction? |
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.
bug fixes and improvements sound good, but they should have been done in separate PRs or on master, in current shape this PR is impossible to review at large, too many logic changes, the title "Modularize dependencies for GH payload consumption and Slack message sending" is definitely a lie. Hence the review is cursory.
As a user, if I'm told that |
`Action.process_github_notification` logs all errors raised in its subroutines.
37e7a90
to
ab23e00
Compare
yes, but what is the usecase fpr the rule that allows nothing? it will never match, so there is no usecase for it. I guess the change is alright from consistency pov, but I don't like unnecessary changes (e.g. now you need to ensure this change is applied to deployed configs as well, luckily there is only one currently) |
Restore earlier behavior that treated empty list `[]` as “include everything” for compatibility with existing deployments.
That's fair. I've reverted the changes and updated the description. This PR doesn't break existing deployed configs anymore. |
5e0d7af
to
d21b7e3
Compare
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.
minor comment, lets get this merged
9e91562
to
66916a5
Compare
Modularize dependencies for GH payload consumption and Slack message sending
Description of the task
Additions
Modularize dependencies for GH payload consumption and Slack message sending
Identified the minimal set of functions that need to be configurable during local vs remote handling, and extracted them to an interface in
api.ml
. Created local (api_local.ml
) and remote (api_remote.ml
) implementations of this interface. Turnedaction.ml
into a functor that consumes these implementations. Reused the same functions inaction.ml
as much as possible in both the production and test environment (seenotabot.ml
andtest.ml
). This should extend test coverage and make it easier to triage when something goes wrong in production that worked in testing.(The name of this branch is misleading. I initially thought the whole
Context
needs to be differentiated b/w remote and local (see #90), but it in fact only the HTTP calls to Slack and GH needed it.)Improve documentation
Documented more edge case behaviors in config options.
Bug Fixes
Other
How to test
All tests should pass:
References