-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: named callbacks ADR #676
Conversation
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Could you show a compete example of what this would look like? |
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Added suggestion by @btlghrants Co-authored-by: Barrett <81570928+btlghrants@users.noreply.github.com>
committing suggestion Co-authored-by: Barrett <81570928+btlghrants@users.noreply.github.com>
Co-authored-by: Barrett <81570928+btlghrants@users.noreply.github.com>
Was chatting with @brandtkeller about a Lula use-case where they need to validate that certain policies exist and it seems like this could be a useful mechanism to tell a compliance tool what a binding is responsible for. When(a.Pod)
.IsCreatedOrUpdated()
.Validate(po => {
// reject is running as root, or is privileged, etc
})
.Alias("reject:pods:runAsRoot:privileged:runAsGroup<10:allowPrivilegeEscalation") going to go ahead and get this prioritized because the Lula team needs it. |
We need to verify that we are able to inject the name of the If it were possible it would need to be done with the const Log = pino({
transport,
timestamp: pinoTimeFunction,
}); and import that into the mutate processor and set
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #676 +/- ##
=======================================
Coverage 85.71% 85.71%
=======================================
Files 26 26
Lines 1008 1008
Branches 212 197 -15
=======================================
Hits 864 864
- Misses 133 142 +9
+ Partials 11 2 -9 |
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.
The new Alias function matches what is described in the ADR
adr/0008-named-callbacks.md
Outdated
|
||
## Status | ||
|
||
Delayed - Revisiting this in the future and recommending that named callbacks be used in the interim. |
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.
Accepted
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.
approved, just changed status to accepted!
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | Type | Update | |---|---|---|---|---|---|---|---| | [husky](https://github.com/typicode/husky) | [`9.1.5` -> `9.1.6`](https://renovatebot.com/diffs/npm/husky/9.1.5/9.1.6) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | devDependencies | patch | | [pepr](https://github.com/defenseunicorns/pepr) | [`0.34.1` -> `0.36.0`](https://renovatebot.com/diffs/npm/pepr/0.34.1/0.36.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | minor | | [registry1.dso.mil/ironbank/opensource/defenseunicorns/pepr/controller](https://github.com/defenseunicorns/pepr) ([source](https://repo1.dso.mil/dsop/opensource/defenseunicorns/pepr/controller)) | `v0.34.1` -> `v0.36.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | minor | | [ts-jest](https://kulshekhar.github.io/ts-jest) ([source](https://github.com/kulshekhar/ts-jest)) | [`29.2.4` -> `29.2.5`](https://renovatebot.com/diffs/npm/ts-jest/29.2.4/29.2.5) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | devDependencies | patch | --- ### Release Notes <details> <summary>typicode/husky (husky)</summary> ### [`v9.1.6`](https://github.com/typicode/husky/compare/v9.1.5...a2d942a670b3d6a04578005a0fd2dc310e511849) [Compare Source](https://github.com/typicode/husky/compare/v9.1.5...v9.1.6) </details> <details> <summary>defenseunicorns/pepr (pepr)</summary> ### [`v0.36.0`](https://github.com/defenseunicorns/pepr/releases/tag/v0.36.0) [Compare Source](https://github.com/defenseunicorns/pepr/compare/v0.35.0...v0.36.0) ##### Features - feat: withdeletiontimestamp filter by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1026](https://github.com/defenseunicorns/pepr/pull/1026) - feat: update CODEOWNERS by [@​daveworth](https://github.com/daveworth) in [https://github.com/defenseunicorns/pepr/pull/1111](https://github.com/defenseunicorns/pepr/pull/1111) - feat: update pepr reconcile strategy by [@​btlghrants](https://github.com/btlghrants) in [https://github.com/defenseunicorns/pepr/pull/1127](https://github.com/defenseunicorns/pepr/pull/1127) ##### What's Changed - chore: support optional fields in ownerReferences by [@​samayer12](https://github.com/samayer12) in [https://github.com/defenseunicorns/pepr/pull/1104](https://github.com/defenseunicorns/pepr/pull/1104) - fix: reconcile queues scrambling Action callbacks by [@​btlghrants](https://github.com/btlghrants) in [https://github.com/defenseunicorns/pepr/pull/1119](https://github.com/defenseunicorns/pepr/pull/1119) - chore: squash High findings in pepr controller image by [@​btlghrants](https://github.com/btlghrants) in [https://github.com/defenseunicorns/pepr/pull/1123](https://github.com/defenseunicorns/pepr/pull/1123) - chore: bump github/codeql-action from 3.26.5 to 3.26.6 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1107](https://github.com/defenseunicorns/pepr/pull/1107) - chore: bump actions/upload-artifact from 4.3.6 to 4.4.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1112](https://github.com/defenseunicorns/pepr/pull/1112) - chore: bump pino from 9.3.2 to 9.4.0 in the production-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1117](https://github.com/defenseunicorns/pepr/pull/1117) - chore: bump [@​types/node](https://github.com/types/node) from 22.5.1 to 22.5.4 in the dev-deps group across 1 directory by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1118](https://github.com/defenseunicorns/pepr/pull/1118) - chore: bump the development-dependencies group with 2 updates by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1132](https://github.com/defenseunicorns/pepr/pull/1132) - chore: bump send and express by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1133](https://github.com/defenseunicorns/pepr/pull/1133) - chore: bump step-security/harden-runner from 2.9.1 to 2.10.1 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1130](https://github.com/defenseunicorns/pepr/pull/1130) - chore: bump github/codeql-action from 3.26.6 to 3.26.7 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1135](https://github.com/defenseunicorns/pepr/pull/1135) - chore: bump kubernetes-fluent-client from 3.0.2 to 3.0.3 in the production-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1136](https://github.com/defenseunicorns/pepr/pull/1136) - chore: bump chainguard/node from `0a7847d` to `5b59be4` by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1138](https://github.com/defenseunicorns/pepr/pull/1138) - chore: bump [@​types/node](https://github.com/types/node) from 22.5.4 to 22.5.5 in the development-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1137](https://github.com/defenseunicorns/pepr/pull/1137) ##### New Contributors - [@​daveworth](https://github.com/daveworth) made their first contribution in [https://github.com/defenseunicorns/pepr/pull/1111](https://github.com/defenseunicorns/pepr/pull/1111) - [@​samayer12](https://github.com/samayer12) made their first contribution in [https://github.com/defenseunicorns/pepr/pull/1104](https://github.com/defenseunicorns/pepr/pull/1104) **Full Changelog**: defenseunicorns/pepr@v0.35.0...v0.36.0 ### [`v0.35.0`](https://github.com/defenseunicorns/pepr/releases/tag/v0.35.0) [Compare Source](https://github.com/defenseunicorns/pepr/compare/v0.34.1...v0.35.0) #### What's Changed **Features** - feat: add custom liveness and readiness probes to helm chart by [@​nfoucha](https://github.com/nfoucha) in [https://github.com/defenseunicorns/pepr/pull/1086](https://github.com/defenseunicorns/pepr/pull/1086) - feat: sharded queue implementation by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1025](https://github.com/defenseunicorns/pepr/pull/1025) - feat: sharded queue feature flag [@​btlghrants](https://github.com/btlghrants) in [https://github.com/defenseunicorns/pepr/pull/1025](https://github.com/defenseunicorns/pepr/pull/1025) **Other** - chore: bash based soak by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1072](https://github.com/defenseunicorns/pepr/pull/1072) - chore: named callbacks ADR by [@​schaeferka](https://github.com/schaeferka) in [https://github.com/defenseunicorns/pepr/pull/676](https://github.com/defenseunicorns/pepr/pull/676) - chore: add e2e test reference in pr template by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1091](https://github.com/defenseunicorns/pepr/pull/1091) - chore: address GHSA-952p-6rrq-rcjv by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1084](https://github.com/defenseunicorns/pepr/pull/1084) - chore: pin deps soak test by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1083](https://github.com/defenseunicorns/pepr/pull/1083) - chore: pin deps release action by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1082](https://github.com/defenseunicorns/pepr/pull/1082) - chore: default relist interval 10 min by [@​cmwylie19](https://github.com/cmwylie19) in [https://github.com/defenseunicorns/pepr/pull/1099](https://github.com/defenseunicorns/pepr/pull/1099) - chore: added waitForConfigMapKey by [@​schaeferka](https://github.com/schaeferka) in [https://github.com/defenseunicorns/pepr/pull/1066](https://github.com/defenseunicorns/pepr/pull/1066) **Dependency Updates** - chore: bump actions/upload-artifact from 2 to 4 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1071](https://github.com/defenseunicorns/pepr/pull/1071) - chore: bump nock from 13.5.4 to 13.5.5 in the development-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1070](https://github.com/defenseunicorns/pepr/pull/1070) - chore: bump [@​types/node](https://github.com/types/node) from 22.4.1 to 22.5.0 in the development-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1078](https://github.com/defenseunicorns/pepr/pull/1078) - chore: bump github/codeql-action from 3.26.2 to 3.26.3 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1067](https://github.com/defenseunicorns/pepr/pull/1067) - chore: bump anchore/scan-action from 4.1.1 to 4.1.2 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1077](https://github.com/defenseunicorns/pepr/pull/1077) - chore: bump actions/upload-artifact from 3 to 4 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1076](https://github.com/defenseunicorns/pepr/pull/1076) - chore: bump github/codeql-action from 3.26.3 to 3.26.4 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1074](https://github.com/defenseunicorns/pepr/pull/1074) - chore: bump azure/setup-kubectl from 3 to 4 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1075](https://github.com/defenseunicorns/pepr/pull/1075) - chore: bump github/codeql-action from 3.26.4 to 3.26.5 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1089](https://github.com/defenseunicorns/pepr/pull/1089) - chore: bump micromatch from 4.0.7 to 4.0.8 by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1090](https://github.com/defenseunicorns/pepr/pull/1090) - chore: bump ts-jest from 29.2.4 to 29.2.5 in the development-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1088](https://github.com/defenseunicorns/pepr/pull/1088) - chore: bump the development-dependencies group with 3 updates by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1095](https://github.com/defenseunicorns/pepr/pull/1095) - chore: bump [@​types/ramda](https://github.com/types/ramda) from 0.30.1 to 0.30.2 in the production-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1094](https://github.com/defenseunicorns/pepr/pull/1094) - chore: bump kubernetes-fluent-client from 3.0.1 to 3.0.2 in the production-dependencies group by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1100](https://github.com/defenseunicorns/pepr/pull/1100) - chore: bump the development-dependencies group with 3 updates by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1101](https://github.com/defenseunicorns/pepr/pull/1101) - chore: bump chainguard/node-lts from `c48eef3` to `62bbead` by [@​dependabot](https://github.com/dependabot) in [https://github.com/defenseunicorns/pepr/pull/1064](https://github.com/defenseunicorns/pepr/pull/1064) #### New Contributors - [@​nfoucha](https://github.com/nfoucha) made their first contribution in [https://github.com/defenseunicorns/pepr/pull/1086](https://github.com/defenseunicorns/pepr/pull/1086) **Full Changelog**: defenseunicorns/pepr@v0.34.1...v0.35.0 </details> <details> <summary>kulshekhar/ts-jest (ts-jest)</summary> ### [`v29.2.5`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#2925-2024-08-23) [Compare Source](https://github.com/kulshekhar/ts-jest/compare/v29.2.4...v29.2.5) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/defenseunicorns/uds-core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
## Description We need to verify that we are able to inject the name of the .Alias into logs of the callback function. If it were possible it would need to be done with the Log object (import it into the mutate/validate/watch processor) ```ts const Log = pino({ transport, timestamp: pinoTimeFunction, }); ``` and import that into the [mutate processor](https://github.com/defenseunicorns/pepr/blob/0ec535efc6547f15fb4a02c35f6c3b8b4e5ecc22/src/lib/mutate-processor.ts#L80) and set set Log.prefix = the bindings alias before executing the callback Checklist - [x] Ensure `npx pepr monitor` is working and soak - [ ] soak and verify with user base that feature is performing as expected ## Related Issue Fixes #858 <!-- or --> Relates to #676 ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [ ] [Contributor Guide Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request) followed --------- Co-authored-by: Case Wylie <cmwylie19@defenseunicorns.com>
Description
Pepr is a system of callbacks that produce logs. The callbacks are anonymous, so debugging which log comes from which callback can be confusing unless you manually write a name in the log message from within the callback. This consideration needs an ADR.
Related Issue
Fixes #675
Relates to #
Type of change
Checklist before merging