Skip to content

Fix patch workflow - fix linux patch command compatibility #4055

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

Merged

Conversation

yue9944882
Copy link
Member

This PR fixes the linux compatibility for patch command as github workflow is linux-based... My previous PRs are tested in mac environment so it didn't reproduce the interactive error from the last generate workflow:

Run ls scripts/patches/*.diff | xargs -I {} patch -p0 -i {}
  ls scripts/patches/*.diff | xargs -I {} patch -p0 -i {}
  git add *.java
  git commit -s -m 'Applied patches under scripts/patches/*.diff'
  shell: /usr/bin/bash -e {0}
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/x64
    BRANCH: automated-generate-0b1f95cb
    PROJECT_VERSION: [2](https://github.com/yue9944882/java/actions/runs/15144087833/job/42575359321#step:9:2)4.0.0-SNAPSHOT
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From eeb5069c974d[3](https://github.com/yue9944882/java/actions/runs/15144087833/job/42575359321#step:9:3)146495f8a9dc52653f029d3cc2d Mon Sep 17 00:00:00 2001
|From: Min Jin <[email protected]>
|Date: Tue, [4](https://github.com/yue9944882/java/actions/runs/15144087833/job/42575359321#step:9:4) Feb 2025 11:59:25 -0800
|Subject: [PATCH] manually apply JSON patch
|
|---
| .../io/kubernetes/client/openapi/JSON.java    | 3[6](https://github.com/yue9944882/java/actions/runs/15144087833/job/42575359321#step:9:6) ++++++++++++++++---
| 1 file changed, 32 insertions(+), 4 deletions(-)
|
|diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java
|index dda3ec[7](https://github.com/yue9944882/java/actions/runs/15144087833/job/42575359321#step:9:7)08..fe902b293 100644
|--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java
|+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.

Successfully run in my fork repo:

https://github.com/yue9944882/java/actions/runs/15145131606/job/42578868105

Copy link

linux-foundation-easycla bot commented May 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: yue9944882 / name: Min Jin (78ddf29)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 20, 2025
@yue9944882 yue9944882 force-pushed the fix-patch-workflow branch from 8da6284 to 78ddf29 Compare May 20, 2025 18:38
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 20, 2025
@brendandburns
Copy link
Contributor

/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 May 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, yue9944882

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:
  • OWNERS [brendandburns,yue9944882]

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 merged commit 8f435aa into kubernetes-client:master May 20, 2025
18 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants