Skip to content
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

upgrade json-patch to v4.11.0 #102467

Merged
merged 2 commits into from
Jun 4, 2021
Merged

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Jun 1, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #98080

refer to https://github.com/evanphx/json-patch/releases/tag/v5.5.0 which include the fix evanphx/json-patch#143

Special notes for your reviewer:

We upgrade to 4.11.0 for nulls in arrays merge.

And we don't choose v5.5.0 for its Break change:

  • JSON patch implemented by https://github.com/evanphx/json-patch now conforms to RFC6902 replacement semantics and does not accept "replace" patch operations if the specified path does not exist.

Does this PR introduce a user-facing change?

fix nulls are handles of array's and objects in json patches.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 1, 2021
@k8s-ci-robot k8s-ci-robot requested review from ahg-g, andrewsykim and a team June 1, 2021 03:14
@k8s-ci-robot k8s-ci-robot added area/apiserver area/cloudprovider area/dependency Issues or PRs related to dependency changes area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 1, 2021
@k8s-ci-robot k8s-ci-robot added area/code-generation area/kubeadm area/provider/gcp Issues or PRs related to gcp provider sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels Jun 1, 2021
@pacoxu pacoxu marked this pull request as ready for review June 1, 2021 08:44
@liggitt
Copy link
Member

liggitt commented Jun 2, 2021

Looks like json-patch also released v4.10.0 to make the fix available in the v4 stream. That seems like it might be a better version to switch to.

@pacoxu pacoxu changed the title upgrade json-patch to v5.5.0 upgrade json-patch to v4.10.0 Jun 3, 2021
@pacoxu
Copy link
Member Author

pacoxu commented Jun 3, 2021

/hold
go mod problem during upgrading to 4.10.0
I opened evanphx/json-patch#145.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2021
@monopole
Copy link
Contributor

monopole commented Jun 3, 2021

Thanks @pacoxu for looking into this.
Holding on kubernetes-sigs/kustomize#3938 as well.

@BenTheElder
Copy link
Member

v4.11.0 should be out and fixed per evanphx/json-patch#145 (comment)

Signed-off-by: pacoxu <paco.xu@daocloud.io>
@pacoxu pacoxu changed the title upgrade json-patch to v4.10.0 upgrade json-patch to v5.5.0 Jun 4, 2021
@pacoxu pacoxu changed the title upgrade json-patch to v5.5.0 upgrade json-patch to v4.11.0 Jun 4, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 4, 2021
@pacoxu
Copy link
Member Author

pacoxu commented Jun 4, 2021

Thanks. @BenTheElder
I updated the PR with v4.11.0.

@pacoxu
Copy link
Member Author

pacoxu commented Jun 4, 2021

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 4, 2021
@liggitt
Copy link
Member

liggitt commented Jun 4, 2021

dependency update looks great.

would be good to add an explicit test case to cover #98080 to ensure this works as expected with this update and does not regress in the future

Signed-off-by: pacoxu <paco.xu@daocloud.io>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 4, 2021
@pacoxu
Copy link
Member Author

pacoxu commented Jun 4, 2021

A test case with drop array is added.

FAIL with master + cherry-pick this case.
image

PASS in json-patch-5.5.0(v4.11.0) branch as well as v5.5.0.

Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liggitt
Copy link
Member

liggitt commented Jun 4, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, liggitt, pacoxu

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit 81b9789 into kubernetes:master Jun 4, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jun 4, 2021
@pacoxu pacoxu deleted the json-patch-5.5.0 branch June 23, 2021 05:44
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. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubeadm area/kubectl area/provider/gcp Issues or PRs related to gcp provider area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CustomResources dropping "null" values from arrays
6 participants