Skip to content

Add jsonnet function to patch upstream rules#1073

Merged
openshift-merge-robot merged 4 commits into
openshift:masterfrom
dgrisonnet:patch-rules
Mar 19, 2021
Merged

Add jsonnet function to patch upstream rules#1073
openshift-merge-robot merged 4 commits into
openshift:masterfrom
dgrisonnet:patch-rules

Conversation

@dgrisonnet

@dgrisonnet dgrisonnet commented Mar 9, 2021

Copy link
Copy Markdown
Member

Wtih the recent requests to patch upstream alerts to match OCP use cases, we will need a jsonnet function to easily apply the downstream patches.

This PR is based on the changes made in #1044.

  • I added CHANGELOG entry for this change.
  • No user facing changes, so no entry in CHANGELOG was needed.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 9, 2021
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@dgrisonnet

Copy link
Copy Markdown
Member Author

Holding as we need to wait for #1044.

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 9, 2021
@dgrisonnet

Copy link
Copy Markdown
Member Author

This PR is still WIP as we need to wait for the jsonnet refactor before applying these functions in the main script.

@paulfantom can you please do a first pass on this PR? I tested it on top of your refactor and the assets are correctly generated.

Comment thread jsonnet/exclude-rules.libsonnet Outdated
@paulfantom

Copy link
Copy Markdown
Contributor

Can we implement a wrapping function like sanitizeRules which would do all necessary operations on rules - patching, excluding, removing fields (like runbook_url annotation)? Without such we will end up composing all functions in main.jsonnet file and it looks a bit ugly.

@dgrisonnet dgrisonnet changed the title WIP: Add jsonnet function to patch upstream rules Add jsonnet function to patch upstream rules Mar 10, 2021
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 10, 2021
@dgrisonnet

Copy link
Copy Markdown
Member Author

@paulfantom are you OK with implementing sanitizeRules in a separate PR?

@dgrisonnet

Copy link
Copy Markdown
Member Author

/unhold

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 10, 2021
Comment thread jsonnet/exclude-rules.libsonnet Outdated
@dgrisonnet

Copy link
Copy Markdown
Member Author

@s-urbaniak @paulfantom I applied your comments PTAL

Comment thread jsonnet/patch-rules.libsonnet
@dgrisonnet dgrisonnet force-pushed the patch-rules branch 2 times, most recently from 5a2a43d to 6be0dc0 Compare March 11, 2021 16:05
@paulfantom

Copy link
Copy Markdown
Contributor

/lgtm
/retest

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 15, 2021
@paulfantom

Copy link
Copy Markdown
Contributor

@dgrisonnet this needs a rebase :(

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
@openshift-ci-robot openshift-ci-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 16, 2021
@paulfantom

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2021
Merge patch and exclude intermediate functions.

Use std.startsWith instead of the `==` operator for comparison to make
it easier to modify group of rules.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2021
@s-urbaniak

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2021
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgrisonnet, paulfantom, s-urbaniak

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [dgrisonnet,paulfantom,s-urbaniak]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@paulfantom

Copy link
Copy Markdown
Contributor

/retest

@openshift-bot

Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot

Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@dgrisonnet

Copy link
Copy Markdown
Member Author

/retest

@dgrisonnet

Copy link
Copy Markdown
Member Author

/test e2e-agnostic-upgrade

1 similar comment
@dgrisonnet

Copy link
Copy Markdown
Member Author

/test e2e-agnostic-upgrade

@paulfantom

Copy link
Copy Markdown
Contributor

/retest

2 similar comments
@dgrisonnet

Copy link
Copy Markdown
Member Author

/retest

@dgrisonnet

Copy link
Copy Markdown
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 02d1245 into openshift:master Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants